:root{font-family:"Segoe UI","Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;color:#243144;background:#f6f8fb;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer}a{color:inherit}h1,h2,p{margin:0}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #87b6f0;outline-offset:2px}.topbar{min-height:68px;padding:12px 25px;display:flex;align-items:center;justify-content:space-between;gap:14px;background:#142337;color:#fff}.brand{display:flex;align-items:center;gap:11px;flex-wrap:wrap;font-size:17px}.brand-home{font-weight:800;text-decoration:none}.brand-home span{color:#7dc6ec}.slash{color:#8da1ba}.tag{font-weight:700;font-size:10px;border:1px solid #8da1ba;border-radius:5px;padding:3px 6px;color:#d2dceb}.toplinks{display:flex;align-items:center;gap:10px;font-size:12px;flex-wrap:wrap}.btn{border:1px solid #b9c8da;border-radius:9px;padding:9px 13px;font-weight:700;font-size:13px;background:white;color:#23415e}.btn:hover{filter:brightness(.96)}.btn.primary{background:#1173c4;border-color:#1173c4;color:white}.btn.light{background:#fff}.btn.wide{width:100%}.warning-banner{background:#fff3d8;border-bottom:1px solid #e8d7a4;color:#66511d;padding:9px 24px;font-size:12px}.layout{display:grid;grid-template-columns:264px minmax(0,1fr);max-width:1650px;margin:auto;min-height:calc(100vh - 145px)}.sidebar{border-right:1px solid #e2e7ef;padding:18px 14px 24px;background:#fff;min-width:0}.sidebar-title{font-size:13px;font-weight:800;color:#244464;margin-bottom:12px}.sidebar-title.space{margin-top:25px}.field{display:grid;gap:6px;margin-bottom:12px;font-size:12px;font-weight:700;color:#58677b}.field input,.field select{width:100%;border:1px solid #ccd6e1;background:#fff;color:#202f40;border-radius:8px;padding:9px 10px;font-weight:500;font-size:13px}.field select:disabled{color:#55657a;background:#f0f3f7}.help{color:#728199;line-height:1.6}.help.small{font-size:11px;margin-bottom:8px}.palette-group{padding-bottom:11px}.palette-label{font-size:10px;font-weight:800;letter-spacing:.08em;color:#71849d;margin:9px 0 7px}.palette-item{display:flex;text-align:left;align-items:center;gap:9px;cursor:pointer;width:100%;border:1px solid #e3e9f0;background:#fbfcfe;border-radius:8px;padding:8px 9px;color:#384963;font-size:12px;margin:5px 0}.palette-item:hover{border-color:#80afd9;background:#f3f8ff}.palette-mark{height:11px;width:11px;border-radius:3px;flex:none}.sidebar-end{border-top:1px solid #e5eaf1;margin-top:14px;padding-top:15px}.sidebar-end p{margin-top:9px}.main{padding:22px 25px 34px;min-width:0}.workspace-head{display:flex;gap:16px;justify-content:space-between;align-items:flex-start}.workspace-head h1{font-size:21px;font-weight:800}.workspace-head p{color:#6e7e92;font-size:12px;margin-top:6px;line-height:1.5}.workspace-actions{display:flex;gap:7px}.events-nav{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin:22px 0 12px}.ev-btn{background:#f0f4f9;border:1px solid #dbe4ee;border-radius:10px;padding:10px 14px;color:#53687f;font-size:12px;font-weight:750}.ev-btn.active{background:#22486a;color:white;border-color:#22486a}.canvas{background:#f1f5fa;border:1px solid #d7e1ed;border-radius:13px;min-height:350px;padding:15px 19px 26px;background-image:radial-gradient(#d9e2ee 1px,transparent 1px);background-size:21px 21px}.canvas-header{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:20px}.canvas-header strong{font-size:14px}.canvas-header p{font-size:11px;color:#738398;margin-top:4px}.canvas-hint{font-size:10px;color:#748296}.blocks-root{display:grid;gap:8px}.empty-state{padding:55px 15px;text-align:center;color:#8291a5;border:2px dashed #d2dfed;border-radius:10px;background:#ffffff80;font-size:12px}.block{position:relative;border-radius:9px;border-left:7px solid var(--accent);background:#fff;box-shadow:0 2px 9px #23476112;padding:11px 12px;max-width:720px;margin-bottom:7px}.block[draggable="true"]{cursor:grab}.block-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.block-name{font-size:13px;font-weight:800;color:#24384d}.block-kind{font-size:10px;letter-spacing:.03em;color:var(--accent);font-weight:700}.block-tools{display:flex;align-items:center;gap:5px;margin-left:auto}.tiny{background:#f6f8fa;border:1px solid #dbe4eb;border-radius:6px;padding:4px 7px;color:#536678;font-size:11px}.tiny.danger{color:#9b4d4d}.block-fields{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:10px}.block-fields label{font-size:11px;color:#5a6e82;display:flex;align-items:center;gap:5px}.block-fields input,.block-fields select{width:130px;max-width:100%;border-radius:6px;border:1px solid #cfdbe7;padding:6px 8px;font-size:12px;background:#fbfdff;color:#263c51}.block-fields input[type=number]{width:75px}.block-fields input.long{width:min(330px,100%)}.nested{margin:12px 0 2px 18px;border-left:3px dashed var(--accent);padding:10px 0 7px 15px;display:grid;gap:7px}.nested-title{font-size:11px;font-weight:700;color:#718396}.insert{font-size:11px;border:1px dashed #b0c6d7;border-radius:7px;background:#f4f9fd;color:#416481;padding:7px 11px;justify-self:start}.drop-marker{border:2px dashed #69a0db;min-height:15px;max-width:680px;border-radius:8px;margin:4px 0;background:#d7e8fbaa}.status{margin:14px 0;display:none;padding:12px 14px;border-radius:10px;font-size:12px;line-height:1.6;white-space:pre-wrap}.status.good{display:block;border:1px solid #b8e1cc;background:#effaf3;color:#236747}.status.bad{display:block;border:1px solid #f0b9b9;background:#fff2f2;color:#983d3d}.status.warn{display:block;border:1px solid #eadb9a;background:#fffaf0;color:#765b20}.code-panel{margin-top:19px;background:#172334;border-radius:12px;overflow:hidden;color:#e8f0f8}.code-head{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:13px 18px;border-bottom:1px solid #39475a}.code-head h2{font-size:13px}.code-head select{max-width:65%;background:#233247;color:#dbeaff;border:1px solid #526177;border-radius:7px;padding:7px;font-size:11px}#code-output{overflow:auto;max-height:390px;min-height:150px;padding:16px 18px;line-height:1.65;font:12px/1.65 Consolas,"Courier New",monospace;white-space:pre;margin:0}footer{padding:18px;text-align:center;color:#8190a3;font-size:11px}@media(max-width:930px){.layout{grid-template-columns:1fr}.sidebar{border-right:0;border-bottom:1px solid #e3e7ed}.sidebar #palette{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 14px}.topbar{align-items:flex-start}.workspace-head{flex-wrap:wrap}.main{padding:18px 12px}.toplinks{justify-content:flex-end}.canvas{padding:12px 9px}.nested{margin-left:6px;padding-left:8px}}@media(max-width:550px){.topbar{padding:10px 12px;flex-direction:column}.warning-banner{padding:10px 12px}.sidebar #palette{grid-template-columns:1fr}.block-fields input.long{width:200px}.canvas-hint{display:none}.workspace-actions .btn{font-size:11px}.main{padding:13px 8px}.ev-btn{padding:8px;font-size:11px}}

/* v0.2: reusable parts and two-branch workflow */
#features{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.feature{font-size:11px;color:#315778;text-align:left;background:#f0f7ff;border:1px solid #cbdff0;border-radius:8px;padding:9px 7px}
.feature:hover{background:#ddebfa}
.nested+.nested{margin-top:8px}
.block .nested:nth-last-child(1){border-left-color:#ad83bc}
.start-command{margin-top:14px;padding:10px 12px;border:1px solid #c9d9e7;background:#f3f8fd;border-radius:9px;display:flex;align-items:center;gap:12px;justify-content:space-between}
.start-command code{font-size:12px;word-break:break-all;color:#2e526b}
button:disabled{opacity:.48;cursor:not-allowed}
#empty-state[hidden]{display:none!important}
@media (max-width:550px){#features{grid-template-columns:1fr 1fr}.workspace-actions{flex-wrap:wrap}.start-command{align-items:flex-start;flex-direction:column}}

/* v0.3: typed expression sockets and reusable functions */
.inline-add{float:right;color:#386b4e;border:1px solid #bbd3c4;background:#e9f5eb;padding:2px 7px;border-radius:5px;font-size:11px;font-weight:700}
.definition-list{display:grid;gap:6px}.definition{padding:7px 8px;border:1px solid #d5e2d8;border-radius:6px;background:#f9fcfa;display:flex;align-items:center;justify-content:space-between;gap:7px;font-size:12px;min-width:0}.definition span{min-width:0;overflow-wrap:anywhere}
.definition small{font-size:10px;color:#6f7b74;display:block}.definition-button{width:100%;text-align:left;color:#345b44;cursor:pointer}.definition-button:hover{background:#e7f3ec}
.function-actions{margin:0 0 9px;display:flex;gap:8px}.function-actions[hidden]{display:none}
.expr-palette{padding:8px 10px;margin:5px 0;font-size:12px;font-weight:700;border-radius:8px;border:1px solid #97b8c6;cursor:grab;user-select:none}
.expr-palette.expr-number{color:#245a7b;background:#eaf4fb}.expr-palette.expr-boolean{color:#765b1d;background:#fdf4dc}.expr-palette.expr-any{color:#53654a;background:#eef5eb}
.expr-label{font-size:11px;font-weight:700;color:#536276}.block-fields{align-items:flex-start}.block-fields>.expr-socket{flex:1 1 100%}
.expr-socket{min-width:110px;max-width:100%;border:2px solid #8aaac1;border-radius:18px;background:#edf5fc;padding:4px 6px;margin:3px 0;box-shadow:inset 0 0 0 1px #fff9}
.expr-socket.expr-boolean{border-color:#d8b66b;background:#fff7e5}.expr-line{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.expr-line>select,.expr-line>input{font-size:11px;border-radius:7px;background:#fff;color:#263c51;border:1px solid #b5c5d1;padding:5px;max-width:100%}
.expr-line>input[type=number]{width:110px}.expr-children{display:flex;flex-direction:column;gap:3px;flex:1 1 100%;padding-left:10px;border-left:2px dotted #a3b9ca}
.param-slot{flex:1 1 100%;display:flex;gap:8px;align-items:center;flex-wrap:wrap;color:#41515e;font-size:11px}.param-slot>.expr-socket{flex:1}
.drop-marker:hover,.nested:hover>.drop-marker{border-color:#559f74;background:#e3f4e9;min-height:18px}
.block{box-shadow:0 1px 5px #2347610c}.ev-btn.active{background:#305a42;border-color:#305a42}.btn.primary{background:#397b52;border-color:#397b52}.tag{border-color:#76ae8e;color:#c8f4d1}
@media(max-width:550px){.definition{padding:8px}.expr-children{padding-left:5px}.expr-socket{width:100%}.block-fields{display:block}.block-fields>label{margin:7px 0}.expr-palette{display:inline-block;margin-right:5px}.sidebar #expression-palette{display:flex;flex-wrap:wrap;gap:4px}}

/* v0.4: movable event/function workspace */
#detail-view[hidden],#board-view[hidden]{display:none!important}
.view-switch{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.view-switch>span{font-size:11px;color:#647b8e;margin-left:6px}
.view-switch .active{background:#305a42;color:white;border-color:#305a42}
.event-creator{display:grid;gap:6px}
.event-creator input,.event-creator select{width:100%;border:1px solid #cbd8d0;border-radius:7px;padding:8px;font:12px system-ui;background:white;color:#273d32}
.board-tools{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:14px 0 10px;color:#60758c;font-size:12px}
.board-tools label{display:flex;gap:8px;align-items:center}.board-tools input{border:1px solid #c7d7d0;border-radius:6px;padding:8px 10px;max-width:220px}
.board-zoom{display:flex;gap:5px;align-items:center;margin-left:auto}.board-zoom span{min-width:42px;text-align:center}
.board-scroller{position:relative;min-height:540px;max-height:700px;overflow:auto;background-color:#eef4ef;background-image:radial-gradient(#d0ded4 1px,transparent 1px);background-size:24px 24px;border:1px solid #cbd9cf;border-radius:12px;overscroll-behavior:contain}
.studio-board{transform-origin:top left;position:relative;min-height:560px}
.board-node{position:absolute;width:290px;min-height:165px;border-radius:9px;border:1px solid #afc4b5;background:#fff;box-shadow:0 3px 10px #224b3520;overflow:hidden;touch-action:none;user-select:none}
.board-node.moving{z-index:5;box-shadow:0 6px 25px #19442844}
.board-handle{display:flex;justify-content:space-between;align-items:center;background:#315d46;color:white;padding:9px 12px;font-size:11px;font-weight:700;cursor:grab;touch-action:none}
.board-node h3{font-size:14px;font-weight:750;margin:11px 12px 6px;color:#244634;overflow-wrap:anywhere}
.grab-hint{letter-spacing:2px;font-weight:900}.board-stack{min-height:56px;max-height:158px;overflow:hidden;display:grid;gap:3px;margin:0 11px 7px}
.board-stack-item{border-left:4px solid #74a58a;background:#edf5ef;border-radius:3px;padding:5px 7px;font-size:11px;color:#315344;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.board-empty{font-size:11px;color:#91a097;padding:12px 3px}
.board-node-actions{display:flex;gap:8px;padding:8px 11px;border-top:1px solid #e2ece5}
.board-node-actions button{border:1px solid #c6dace;background:#f4faf5;color:#2e6345;border-radius:6px;font-size:11px;padding:6px 10px;font-weight:700;cursor:pointer}
.board-footnote{font-size:11px;color:#708679;margin:8px 0 16px}
@media(max-width:650px){.board-scroller{min-height:490px;max-height:620px}.board-tools{gap:7px}.board-tools label{width:100%}.board-tools input{flex:1;max-width:none}.board-zoom{margin-left:0}.view-switch>span{display:none}}

.custom-edit{display:flex;gap:6px;align-items:center;font-size:11px;color:#506b59;font-weight:700}
.custom-edit input{border:1px solid #c6d7cc;border-radius:6px;padding:7px;font-size:12px;max-width:170px;min-width:0}
#custom-actions{align-items:center;flex-wrap:wrap}
@media(max-width:600px){.custom-edit input{max-width:115px}}

.mobile-jump{display:none}
@media(max-width:930px){
 .layout{display:flex;flex-direction:column}
 .main{order:0}
 .sidebar{order:1;border-right:0;border-top:1px solid #d7e5db}
 .mobile-jump{display:inline-block;padding:7px 10px}
}

/* v0.5 — editable, connected blocks in the same free-position workspace */
.board-node{width:440px;min-height:150px;overflow:visible;touch-action:auto}
.board-handle{touch-action:none}.board-node h3{margin:10px 12px}
.board-live{padding:4px 11px 10px;max-height:530px;overflow:auto;overscroll-behavior:contain}
.board-live .block{max-width:none;box-shadow:none;background:color-mix(in srgb,var(--accent),white 88%);border:1px solid var(--accent);border-left:7px solid var(--accent);border-radius:7px 7px 7px 3px}
.board-live .block::before{content:"";position:absolute;left:26px;top:-6px;width:24px;height:5px;border-radius:3px;background:var(--accent)}
.board-live .block-name{cursor:pointer}.board-live .nested{margin-left:12px;padding-left:11px;border-left:3px solid var(--accent)}
.board-live .block-fields label{max-width:100%}.board-live .block-fields input.long{width:230px}
.board-live .drop-marker{min-height:12px;border:1px dashed #9ec4ac;background:#f0f8f2}
.board-live .drop-marker:hover,.board-live .drop-marker.drag-over{height:24px;background:#d8e8fb;border:2px dashed #4078ad}
.block.block-selected{outline:3px solid #297ecc;outline-offset:1px}
.selection-tools{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.selection-tools strong{font-weight:600;font-size:11px;white-space:nowrap}.selection-tools select{max-width:170px;min-width:110px;border:1px solid #b8c8c1;padding:6px;border-radius:6px;font-size:11px}
.file-toolbar{display:flex;gap:7px;flex-wrap:wrap;padding:12px;background:#213246;align-items:center}.file-toolbar .btn{padding:7px 10px;font-size:11px}
.file-toolbar #file-state{font-size:11px;color:#b5c9d6}
.file-help{font-size:11px;padding:8px 14px;color:#acc0d0;line-height:1.6}
#file-editor{display:block;width:100%;height:355px;min-height:160px;resize:vertical;background:#121d2c;color:#e4f5ec;border:0;border-top:1px solid #33455e;padding:14px 18px;white-space:pre;tab-size:2;line-height:1.6;font:12px/1.6 Consolas,monospace}
#file-editor:focus{outline:2px solid #75b599;outline-offset:-2px}
.preview-details summary{padding:10px 15px;font-size:11px;cursor:pointer;background:#1b293a}
@media(max-width:650px){.board-node{width:340px}.board-live .block-tools{margin-left:0}.selection-tools{width:100%}.board-live .block-fields input.long{width:180px}.file-toolbar .btn{flex:1 1 40%}}

/* Block quick search */
.block-filter{margin:10px 0 12px}.block-filter input{width:100%;min-width:0}

/* v0.6: independent, detachable and snappable block stacks */
.board-node.board-loose{border:2px dashed #bd8740;box-shadow:0 4px 14px #5a432822;background:#fffdf6}
.board-loose .board-handle{background:#845928}
.board-loose h3{color:#785323}
.board-loose .board-node-actions{flex-wrap:wrap}
.board-node-actions button.danger{color:#9e4040;background:#fff2ee;border-color:#e9c6ba}
.board-loose .board-live{max-height:650px}
.board-live .block{position:relative;border-radius:8px 8px 4px 4px;}
.board-live .block:after{content:'';position:absolute;bottom:-3px;left:28px;width:24px;height:5px;background:var(--accent);border-radius:3px;z-index:2}
.board-live .block-tools{flex-wrap:wrap;gap:3px}
.board-live .block-tools .tiny{padding:3px 5px}
.board-live .drop-marker.snap-target{height:30px;border:2px solid #3286bf;background:#bee7ff;box-shadow:0 0 0 3px #3286bf33;animation:snapPulse .7s ease-in-out infinite alternate}
@keyframes snapPulse{from{background:#cdeeff}to{background:#94d4fb}}
.loose-note{font-size:11px;color:#805d28;background:#fff5e5;border:1px solid #e7d2ae;border-radius:6px;padding:5px 9px}
.board-tools .loose-note:empty{display:none}
.board-node.moving{opacity:.88}
@media(max-width:650px){.board-live .block-top{flex-wrap:wrap}.board-live .block-tools{width:100%}.board-node-actions button{flex:1 1 auto}}


/* v0.7 — puzzle block shapes, accurate snap cues, arrangement and overview map */
.board-live .block,
#block-list .block{border-top:2px solid var(--accent);border-bottom:2px solid var(--accent);padding-top:14px;padding-bottom:13px;margin-bottom:9px;overflow:visible}
.board-live .block::before,
#block-list .block::before{content:"";position:absolute;top:-2px;left:23px;width:36px;height:9px;background:#fff;clip-path:polygon(0 0,100% 0,100% 27%,80% 27%,73% 95%,27% 95%,20% 27%,0 27%);z-index:2;pointer-events:none}
.board-live .block::after,
#block-list .block::after{content:"";position:absolute;bottom:-9px;left:23px;width:36px;height:9px;background:var(--accent);clip-path:polygon(0 0,100% 0,100% 35%,79% 35%,72% 95%,28% 95%,21% 35%,0 35%);z-index:3;pointer-events:none}
.board-live .block-control,
#block-list .block-control{border-left-width:9px;border-bottom-left-radius:6px}
.board-live .block-control>.nested,
#block-list .block-control>.nested{border-left:7px solid var(--accent);border-bottom:7px solid var(--accent);border-radius:0 0 0 9px;margin-left:8px;padding:10px 0 15px 13px;background:color-mix(in srgb,var(--accent),white 95%)}
.board-live .block-control>.nested:last-of-type,
#block-list .block-control>.nested:last-of-type{margin-bottom:10px}
.board-live .block-top .block-name,
#block-list .block-top .block-name{user-select:none}
.board-live .drop-marker{border:1px dashed transparent;background:transparent;min-height:10px;margin:2px 0 6px;transition:background-color .1s,border-color .1s}
.board-live .drop-marker:hover{border-color:#64b4e2;background:#e1f5ff}
.board-live .drop-marker.snap-target{height:28px!important;min-height:28px!important;background:#bcf0ff!important;border:2px solid #1681b9!important;box-shadow:0 0 0 3px #1681b933;animation:none;position:relative}
.board-live .drop-marker.snap-target::after{content:'ここに接続';position:absolute;right:7px;top:4px;font:700 10px system-ui;color:#146393}
.board-node.board-selected{outline:3px solid #d19533;outline-offset:2px;z-index:4}
.board-node.board-selected>.board-handle{background:#875b2c}
.board-handle .grab-hint{font-size:16px}
.arrange-tools{display:flex;gap:5px;flex-wrap:wrap;align-items:center}
.arrange-tools .tiny{border-color:#a9cbb5;background:#edf8f0;color:#306344;font-weight:750}
#selected-node-count:not(:empty){color:#835c29;font-size:11px;font-weight:700}
.board-shell{position:relative}
.board-minimap{position:absolute;right:15px;bottom:15px;z-index:10;width:207px;padding:7px;border:1px solid #95b69c;border-radius:9px;background:#f9fcf8ee;box-shadow:0 4px 18px #1d473329;backdrop-filter:blur(5px)}
.minimap-caption{display:flex;justify-content:space-between;align-items:center;color:#3d634b;font-size:11px;margin-bottom:4px}
.minimap-hide{border:0;background:transparent;font-size:17px;color:#526b57;cursor:pointer;line-height:1}
.board-minimap svg{display:block;width:100%;height:132px;border-radius:4px;background:#eaf1e9;cursor:crosshair;touch-action:none}
.board-minimap svg .map-viewport{fill:#2984c91a;stroke:#2679b3;stroke-width:5;vector-effect:non-scaling-stroke;pointer-events:none}
.board-minimap svg .map-node{stroke:#fff;stroke-width:3;vector-effect:non-scaling-stroke}
.minimap-show{position:absolute;right:12px;bottom:12px;border:1px solid #7eab87;background:#edf8f1;color:#275a3c;border-radius:8px;padding:8px 10px;font:700 11px system-ui;z-index:8;cursor:pointer}
#board-scroller:focus-visible{outline:3px solid #55a3cd;outline-offset:1px}
@media(max-width:650px){.arrange-tools{width:100%}.arrange-tools .tiny{flex:1}.board-minimap{width:146px;right:8px;bottom:8px;padding:5px}.board-minimap svg{height:96px}.minimap-caption{font-size:10px}}


/* v0.8 — Scratch-inspired left block palette and compact inspector */
:root{--library-width:258px}
.layout{display:grid;grid-template-columns:var(--library-width) minmax(0,1fr);max-width:none;align-items:start}
.block-library{grid-column:1;grid-row:1;position:sticky;top:0;height:calc(100vh - 2px);min-height:540px;display:flex;flex-direction:column;border-right:1px solid #cfdfd1;background:#f8fbf7;z-index:12;min-width:0}
.library-header{display:flex;justify-content:space-between;align-items:center;padding:14px 15px 10px;background:#e8f2e7;border-bottom:1px solid #c9dccd}
.library-header strong{display:block;color:#284d34;font-size:16px}.library-header small{font-size:11px;color:#58735c;display:block;margin-top:3px}
#close-library{display:none;border:0;background:transparent;color:#44634b;font-size:22px;line-height:1;padding:4px}
.library-scroll{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:10px 13px 28px;scrollbar-color:#b6cdb9 transparent}
.block-library .sidebar-title{margin-top:8px;margin-bottom:9px}
.block-library .sidebar-title.space{margin-top:18px}
.block-library #block-search{background:#fff}
.palette-categories{display:flex;flex-wrap:wrap;gap:5px;margin:0 0 10px}
.palette-cat{border:1px solid #cbdbd2;background:white;color:#486355;border-radius:20px;padding:6px 9px;font-size:10px;font-weight:700;cursor:pointer}
.palette-cat.active{color:#fff;background:#32734b;border-color:#32734b}
.palette-group{padding-bottom:10px}
.palette-group .palette-label{padding:4px 3px;color:#516c55;font-size:11px;letter-spacing:0}
.block-library .palette-item{--block-color:#648e76;position:relative;display:flex;align-items:center;min-height:39px;gap:8px;padding:8px 10px;background:var(--block-color);border:1px solid color-mix(in srgb,var(--block-color),black 17%);border-radius:8px;color:white;font-size:12px;font-weight:750;text-shadow:0 1px 1px #0003;box-shadow:inset 0 -3px 0 #0002;margin:6px 0;cursor:grab;user-select:none;touch-action:pan-y}
.block-library .palette-item::before{content:"";position:absolute;top:-1px;left:19px;width:33px;height:7px;background:#f8fbf7;clip-path:polygon(0 0,100% 0,80% 100%,20% 100%)}
.block-library .palette-item::after{content:"";position:absolute;bottom:-7px;left:19px;width:33px;height:7px;background:var(--block-color);clip-path:polygon(0 0,100% 0,80% 100%,20% 100%);z-index:1}
.block-library .palette-item:hover{background:color-mix(in srgb,var(--block-color),white 10%);border-color:#223b33;transform:translateX(2px)}
.block-library .palette-item:active{cursor:grabbing}
.block-library .palette-mark{background:#ffffff8c!important;width:7px;height:18px;border-radius:2px}
.block-library .palette-extras{margin-top:12px;border-top:1px solid #d3e0d3;padding-top:9px}
.palette-extras summary{cursor:pointer;font-weight:750;font-size:12px;color:#3d6248;padding:8px 0}
.block-library .expr-palette{border-radius:12px;padding:9px;cursor:grab;user-select:none}
.main{grid-column:2;grid-row:1;min-width:0;padding:17px 18px 30px}
.project-sidebar{display:block;position:fixed;top:75px;right:12px;bottom:12px;width:min(325px,calc(100vw - 24px));height:auto;overflow:auto;z-index:25;background:#fff;border:1px solid #bacfc2;box-shadow:0 16px 46px #233d3240;border-radius:13px;padding:17px}
.project-sidebar[hidden]{display:none!important}
.project-sidebar-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px;color:#274b36}
.project-sidebar-head button{background:transparent;border:0;font-size:24px;color:#577062}
.view-switch{position:relative;flex-wrap:wrap}
#toggle-library,#toggle-project{font-size:12px}
#toggle-library[aria-expanded="true"]{background:#def0e1;border-color:#85b395;color:#23683e}
#toggle-project[aria-expanded="true"]{background:#def0e1;border-color:#85b395;color:#23683e}
body.library-collapsed .layout{grid-template-columns:minmax(0,1fr)}
body.library-collapsed .block-library{display:none}
body.library-collapsed .main{grid-column:1}
.board-scroller.palette-drop-active{outline:3px dashed #2c9970;outline-offset:-5px;background-color:#e0f4e4}
.drop-marker.palette-target{background:#8ee6b2!important;border-color:#269a62!important;min-height:23px!important;box-shadow:0 0 0 3px #34a36b22}
.palette-drag-ghost{position:fixed;z-index:99999;pointer-events:none;min-width:155px;max-width:230px;padding:9px 12px;border-radius:8px;border:1px solid #ffffff8f;color:white;font-size:12px;font-weight:750;box-shadow:0 9px 24px #10291e44;transform:translate(12px,-45%);opacity:.95}
.library-empty-state{padding:20px;color:#607b66;font-size:12px;text-align:center}
@media(max-width:1050px){:root{--library-width:213px}.block-library .palette-item{font-size:11px;padding:9px 7px}.main{padding:12px}}
@media(max-width:650px){
 .layout{display:block!important}.main{display:block;padding:10px 8px 30px}
 .block-library{position:fixed;top:0;left:0;bottom:0;height:100dvh;min-height:0;width:min(290px,86vw);box-shadow:15px 0 40px #0003;z-index:35;display:none}
 body.mobile-library-open .block-library{display:flex}
 #close-library{display:inline-block}
 .project-sidebar{top:10px;bottom:10px;right:10px}
 #toggle-library[aria-expanded="true"]{background:#def0e1}
 body.mobile-library-open::after{content:"";position:fixed;z-index:30;inset:0;background:#14282055;pointer-events:none}
 body.palette-dragging::after{display:none}
 .library-scroll{padding-bottom:35px}
 .block-library .palette-item{font-size:13px}
 .workspace-head{gap:8px}.workspace-actions{gap:4px}
 }

/* Make insertion sockets reliably reachable by drag-and-drop. */
.board-live .drop-marker{min-height:21px!important;margin:3px 0 5px;border:1px dashed #b8d9bf;background:#ebf6ec70}
.board-live .drop-marker:hover{background:#cbefda;border-color:#339866}

/* v0.9: typed position and executor slots, project inspector */
.position-builder,.selector-builder{width:100%;border:2px dashed #8ebf98;border-radius:12px;background:#f0f8f1;padding:9px 11px;display:grid;gap:8px}.position-head{font-size:12px;font-weight:800;color:#385c44}.position-head span{font-size:10px;font-weight:400;color:#657c69}.position-axes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.position-axis{min-width:0;display:grid;gap:4px}.position-axis strong{font-size:12px}.position-axis>.expr-socket{min-width:0}.position-axis select{width:100%;max-width:100%}.position-axis input[type=number]{max-width:85px}.selector-builder{display:flex;align-items:center;flex-wrap:wrap}.selector-builder select{min-width:190px}.special-palette{display:grid;gap:5px}.debug-panel{margin:16px 0;padding:15px;border:1px solid #bfcfc2;background:#f8fbf8;border-radius:12px;color:#31493a}.debug-panel[hidden],.code-diff[hidden]{display:none!important}.debug-title{display:flex;align-items:center;justify-content:space-between;gap:10px}.debug-title h2,.debug-title h3{font-size:15px}.debug-search{display:flex;align-items:center;gap:9px;margin:12px 0;font-size:13px}.debug-search input{width:min(420px,90%);border:1px solid #bdcebe;padding:8px;border-radius:7px}#debug-results{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:5px;max-height:280px;overflow:auto}.debug-result{display:grid;gap:3px;text-align:left;background:white;border:1px solid #d7e6da;border-radius:8px;padding:8px;cursor:pointer}.debug-result small{color:#677f6e}.debug-error{color:#a33e37;font-size:12px;margin:3px 0}.debug-trace{white-space:pre-wrap;max-height:300px;overflow:auto;font:12px/1.7 ui-monospace,Consolas,monospace;background:#eaf1e9;border-radius:8px;padding:12px;margin-top:8px}.debug-focus{outline:3px solid #63aa79;outline-offset:2px}.code-diff{white-space:pre-wrap;max-height:300px;overflow:auto;font:11px/1.6 ui-monospace,Consolas,monospace;background:#0f1927;color:#ddeddd;padding:13px}.block-library .special-palette .expr-palette{background:#547d61;color:white;border-radius:9px}.file-toolbar #show-diff{white-space:nowrap}@media(max-width:720px){.position-axes{grid-template-columns:1fr}.position-axis{grid-template-columns:20px minmax(95px,1fr) minmax(110px,2fr);align-items:center}.position-axis>.expr-socket{width:100%}}

.expr-palette.selected-expr{outline:3px solid #257d51;outline-offset:2px;box-shadow:0 0 0 5px #8ccfae70}

/* v1.2: reliable offline recovery, module organization, and file search */
.recovery-bar{display:flex;flex-wrap:wrap;align-items:center;gap:9px;padding:9px 14px;background:#eaf4ec;border-bottom:1px solid #bfd3c1;color:#2e5140;font-size:12px}
.recovery-bar label{display:flex;gap:7px;align-items:center}.recovery-bar select{max-width:230px;min-width:135px;border:1px solid #bdcebe;border-radius:6px;padding:5px;background:#fff}
#autosave-state{font-weight:700;min-width:125px}#autosave-state.save-failed{color:#ab3333}
.module-panel{padding:10px 0;border-block:1px solid #c8d8ca}.module-actions{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin:8px 0}.module-actions button{font-size:11px;padding:7px 5px}
.module-panel .field{display:grid;gap:4px;margin:8px 0}.module-panel select{width:100%;min-width:0}
.file-search{display:flex;align-items:flex-start;gap:10px;flex-wrap:wrap;margin:10px 0}.file-search label{font-size:12px;display:flex;align-items:center;gap:7px}.file-search input{min-width:230px;max-width:100%;padding:7px;border:1px solid #aebdb1;border-radius:6px}
#file-search-results{display:flex;flex-wrap:wrap;gap:5px;max-height:88px;overflow:auto}.file-search-hit{font:11px/1.4 ui-monospace,Consolas,monospace;max-width:240px;overflow:hidden;text-overflow:ellipsis;background:#edf4ef;border:1px solid #ccdccf;border-radius:6px;padding:5px;cursor:pointer}.file-search-hit:hover{background:#d9eadf}
.board-node.board-summary .board-live{max-height:200px;overflow:auto}.board-overflow-hint{font-size:12px;color:#476953;padding:10px;border:1px dashed #a5bea9;border-radius:8px;background:#eaf4ec}
@media(max-width:720px){.recovery-bar{gap:6px;padding:9px}.recovery-bar select{max-width:150px}.file-search input{min-width:150px}.module-actions{grid-template-columns:1fr 1fr}}

/* Scratch-style compatibility feedback while dragging. */
.drop-marker.connection-compatible{min-height:19px;border-color:#3c9d6d;background:#dff5e7;transition:background-color .1s,border-color .1s}
.expr-socket.connection-compatible{outline:2px solid #50ac7b;outline-offset:2px}
.drop-marker.connection-incompatible{border-color:#d1d6d1!important;background:#eef0ee!important;opacity:.46}
.expr-socket.connection-incompatible{opacity:.52;outline:0!important}
.drop-marker.connection-hover,.drop-marker.connection-compatible:hover{min-height:27px!important;background:#a8efc3!important;border-color:#188552!important;box-shadow:0 0 0 3px #359f6d34}
.expr-socket.connection-hover{background:#bceec9;box-shadow:0 0 0 3px #359f6d44}

/* v1.3 typed value connectors and resource explorer */
.typed-palette{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:7px 0 18px}
.typed-piece{padding:9px 8px;border:1px solid #7f9489;border-radius:12px;background:#e4efe4;color:#24392d;font-weight:650;text-align:left;cursor:grab;font-size:12px;min-width:0}
.typed-piece:hover,.typed-active{outline:2px solid #67a573;outline-offset:1px}
.typed-fields{padding:6px 0 5px;display:grid;gap:5px;min-width:0}
.typed-slot{border:2px dashed #7d9d83;background:#e7f1e8;border-radius:11px;color:#1e422b;display:flex;flex-wrap:wrap;justify-content:space-between;gap:5px;padding:8px;cursor:copy;min-width:0}
.typed-slot strong{font-weight:650;font-size:11px;overflow-wrap:anywhere}
.typed-compatible{border-color:#1b9d54!important;background:#d5f4dd!important;box-shadow:0 0 0 2px #5ac78666}
.typed-incompatible{opacity:.42}
.file-wizard{display:flex;gap:8px;align-items:end;flex-wrap:wrap;padding:11px;margin:12px 0;background:#e4ede5;border:1px solid #b6c9bb;border-radius:12px}
.file-wizard label{display:grid;gap:3px;color:#1a3627;font-size:12px}.file-wizard input{min-width:155px}.file-wizard select{max-width:240px}
.file-browser{border:1px solid #d4dfd5;border-radius:11px;padding:10px;margin:10px 0;background:#f5f8f5}.file-browser>label{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
#asset-browser{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:5px;margin-top:9px;max-height:220px;overflow:auto}
.asset-entry{border:1px solid #d3dfd4;border-radius:5px;background:#fff;padding:7px 8px;min-width:0;text-align:left;font-size:11px;overflow-wrap:anywhere;cursor:pointer}
.asset-entry.chosen{border-color:#4b9871;background:#e3f1e7}.file-page{display:flex;align-items:center;justify-content:center;gap:9px;margin-top:9px}
@media(max-width:650px){.typed-palette{grid-template-columns:repeat(2,minmax(0,1fr))}.file-wizard{display:grid;grid-template-columns:minmax(0,1fr)}.file-wizard input{min-width:0;width:100%}#asset-browser{grid-template-columns:1fr}}


/* READABILITY_PASS_20261026: darker secondary text on Studio's light theme.
   Preserve all block colors, background surfaces, and editing controls. */
.help{color:#516277;}
.view-switch>span{color:#506477;}
.workspace-head p{color:#526377;}
.board-tools{color:#506478;}
.board-footnote{color:#526957;}
.board-empty{color:#526c57;}
.canvas-header p,.canvas-hint{color:#53677b;}
.empty-state{color:#5a6c7b;}
.palette-label{color:#556779;}
footer{color:#576879;}

/* v1.4 target/version hint is part of project settings; inherits existing neutral palette. */
.studio-version-hint{margin:9px 0 13px;padding:9px 10px;border:1px solid #bccbd7;border-radius:7px;background:#f1f5f8;color:#294459;font-size:12px;line-height:1.6;font-weight:600}
#block-search:focus{box-shadow:0 0 0 2px #adc7db}
#studio-recent-items{display:none}

/* v1.5: Item component panel embedded in existing block editor */
.item-components-editor{margin-top:10px;border:1px solid var(--line,#b9c5bb);border-radius:9px;padding:6px 10px;background:rgba(255,255,255,.55);max-width:100%;}
.item-components-editor summary{cursor:pointer;font-weight:700;padding:7px 4px;}
.item-components-editor summary .help{font-weight:400;margin-left:5px;}
.component-settings{display:flex;flex-direction:column;gap:10px;padding:8px 2px 5px;min-width:0;}
.component-settings label{display:flex;flex-direction:column;gap:4px;min-width:0;}
.component-settings input,.component-settings select,.component-settings textarea{width:100%;min-width:0;max-width:100%;box-sizing:border-box;}
.component-settings textarea{min-height:64px;resize:vertical;}
.component-settings .component-check{flex-direction:row;align-items:center;gap:8px;}
.component-settings .component-check input{width:auto;}
.component-section-label{display:flex;justify-content:space-between;align-items:center;gap:8px;font-weight:700;}
.component-pair{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(72px,1fr) auto;align-items:end;gap:7px;min-width:0;}
.component-pair button{margin-bottom:1px;}
.component-code{display:block;white-space:pre-wrap;overflow-wrap:anywhere;max-height:160px;overflow:auto;padding:8px;border:1px solid #d5ded5;border-radius:6px;background:#f4f8f4;font-size:12px;line-height:1.5;}
@media (max-width:590px){.component-pair{grid-template-columns:minmax(0,1fr) minmax(55px,.7fr) auto;gap:4px;}.item-components-editor{padding:5px;}}

/* v1.7: compact editor tools, without rearranging existing controls */
.board-node.board-grouped{border-top:4px solid #45758e}
.board-node.board-grouped .group-label{display:inline-block;margin-left:8px;padding:2px 6px;border-radius:5px;background:#e1eef2;color:#27607a;font-size:11px;vertical-align:middle}
.board-node.board-has-error{border-color:#b43e48;box-shadow:0 0 0 2px #c13b3b25}
.block.block-problem-error{outline:2px solid #c13e49;outline-offset:1px;background:#fff7f7}
.block.block-problem-warning{outline:2px solid #c3912d;outline-offset:1px}
.block.block-problem-error>.block-top:before{content:'!';display:inline-flex;width:16px;height:16px;align-items:center;justify-content:center;background:#b33e42;color:#fff;border-radius:50%;font:700 12px system-ui;margin-right:7px}
.studio-problems{margin:8px 12px 16px;border:1px solid #ccdcd2;background:#fff;border-radius:8px;padding:9px 12px}
.studio-problems-head{display:flex;align-items:center;justify-content:space-between;gap:12px;color:#405c50;font-size:13px}
#problems-list{max-height:240px;overflow:auto;margin-top:8px}
.studio-problem-row{width:100%;display:flex;align-items:center;gap:8px;text-align:left;padding:8px 10px;border:0;border-top:1px solid #e6eeea;background:#fff;cursor:pointer;color:#3b504c;font-size:12px}
.studio-problem-row:hover{background:#f3f8f4}.studio-problem-row small{color:#71817c;margin-left:auto}
.studio-problem-row.error strong{color:#a3353c}.studio-problem-row.warning strong{color:#94620d}
.expr-range{display:grid;gap:6px;padding:6px;background:#f9f3e4;border-radius:6px}
.expr-range>label{display:flex;align-items:center;flex-wrap:wrap;gap:5px}
@media(max-width:650px){.studio-problem-row{flex-wrap:wrap}.studio-problem-row small{margin:0}}

.board-marquee{position:absolute;z-index:10;pointer-events:none;border:1.5px solid #3683a1;background:#5cb1d12b;border-radius:4px}

/* v1.8: coherent file workspace; existing canvas/editor geometry unchanged */
.studio18-file-manager,.studio18-resource,.studio18-check{border:1px solid var(--line,#c9d7ce);border-radius:9px;padding:10px;margin:10px 0;background:var(--panel,#fff)}
.studio18-explorer-head,.studio18-resource-top{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.studio18-explorer-head input{max-width:250px;min-width:120px;padding:6px}
.studio18-tree{max-height:270px;overflow:auto;contain:content;margin-top:9px}
.studio18-tree details{margin:2px 0 3px 10px;min-width:0}.studio18-tree summary{cursor:pointer;padding:4px 8px;font-size:.91rem;border-radius:6px;font-weight:600}
.studio18-tree summary:hover,.studio18-tree button:hover{background:#e7efe8}.studio18-tree button{display:block;width:100%;border:0;text-align:left;padding:5px 9px;background:transparent;font:inherit;font-size:.88rem;cursor:pointer;border-radius:5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.studio18-tree button[aria-current="true"]{background:#d9e8dc;color:#163b29;font-weight:700}
.studio18-tabs{display:flex;flex-wrap:nowrap;gap:5px;overflow-x:auto;min-height:38px;padding:5px 0}.studio18-tab{display:inline-flex;align-items:center;white-space:nowrap;max-width:240px;background:#f2f7f2;border:1px solid #d1ded3;border-radius:7px;padding:0 0 0 8px}.studio18-tab.active{background:#dbeadd;border-color:#7a9e88}.studio18-tab button{font:inherit;border:0;cursor:pointer;background:transparent;color:inherit;padding:5px 6px;overflow:hidden;text-overflow:ellipsis}.studio18-tab button:last-child{font-size:16px}
.studio18-resource-top span,.studio18-check span{font-size:.85rem;color:#486651}
.studio18-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px;margin-top:10px}
.studio18-form label{display:flex;flex-direction:column;gap:4px;font-size:.88rem;font-weight:600;min-width:0}
.studio18-form input,.studio18-form textarea,.studio18-form select{max-width:100%;width:100%;font:inherit;padding:7px;box-sizing:border-box;border:1px solid #9fb7a3;border-radius:6px;background:white;color:#223428}
.studio18-form textarea{min-height:76px}.studio18-form .studio18-form-actions{grid-column:1/-1;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.studio18-audit-results{max-height:240px;overflow:auto;margin-top:10px}.studio18-audit-entry{padding:7px;border-top:1px solid #dde8de;display:flex;gap:8px;align-items:center;flex-wrap:wrap}.studio18-audit-entry button{cursor:pointer;background:transparent;border:0;text-decoration:underline;color:#255f40}
.studio18-audit-entry.error{color:#9b2d2d}.studio18-audit-entry.warning{color:#795622}
@media (max-width:650px){.studio18-explorer-head input{max-width:100%;flex:1}.studio18-tree{max-height:180px}.studio18-form{grid-template-columns:1fr}}

/* Datapack Studio v1.9 — production flow and parameter picker */
.studio19-preview{margin:16px 0;border:1px solid var(--border,#556372);border-radius:12px;background:var(--panel,#151e29);padding:15px;min-width:0}
.studio19-preview-header{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
.studio19-preview-header>div{flex:1 1 220px}.studio19-preview h2{font-size:1.08rem;margin:0 0 4px}.studio19-preview h3{font-size:.96rem;margin:0 0 8px}
.studio19-preview-header p,.studio19-note,.studio19-preview-foot{font-size:.85rem;opacity:.86;margin:3px 0}
.studio19-preview-header label{display:flex;align-items:center;gap:7px;font-size:.88rem}.studio19-preview-header select{max-width:270px;width:100%;padding:8px}
.studio19-preview-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin-top:12px}
.studio19-flow-wrap,.studio19-code-wrap{border:1px solid var(--border,#556372);border-radius:10px;padding:10px;min-width:0;overflow:hidden}
.studio19-flow{max-height:290px;overflow:auto;display:flex;flex-direction:column;gap:4px}.studio19-flow-row{width:calc(100% - min(var(--level),8)*10px);margin-left:calc(min(var(--level),8)*10px);padding:8px 10px;display:flex;align-items:center;gap:8px;text-align:left;border-radius:7px;border:1px solid var(--border,#59646d);background:var(--surface,#222d36);color:inherit;cursor:pointer;font:inherit}.studio19-flow-row:hover,.studio19-flow-row:focus-visible{border-color:#659ad7;outline-offset:2px}.studio19-flow-row strong{font-size:.87rem}.studio19-flow-row small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;opacity:.8}.studio19-flow-num{font-size:.76rem;opacity:.7;min-width:17px}.studio19-flow-branch{margin-left:calc(min(var(--level),8)*10px);font-size:.81rem;padding:4px 9px;border-left:3px solid #c8a46c;opacity:.9}
.studio19-code-wrap h3{display:flex;justify-content:space-between;align-items:center;gap:8px}.studio19-code-wrap small{overflow-wrap:anywhere;opacity:.75;font-size:.75rem}.studio19-code-wrap pre{overflow:auto;white-space:pre;max-height:280px;background:rgba(0,0,0,.17);border-radius:7px;padding:10px;font-size:.78rem;line-height:1.55;margin:5px 0 0}.studio19-preview-foot{margin-top:10px}
.studio19-choose{margin:5px 0 6px 6px;white-space:nowrap;font-size:.78rem!important;line-height:1.2;vertical-align:middle;cursor:pointer}
.studio19-picker{width:min(570px,calc(100vw - 24px));max-height:min(690px,90vh);padding:16px;border-radius:12px;border:1px solid #657586;background:#18232e;color:#f0f3f7;box-shadow:0 18px 65px rgba(0,0,0,.45)}.studio19-picker::backdrop{background:rgba(0,0,0,.58)}
.studio19-picker-top{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:12px}.studio19-picker-search{display:flex;flex-direction:column;gap:5px;font-size:.9rem}.studio19-picker-search input{width:100%;box-sizing:border-box;padding:10px;font-size:1rem}
.studio19-picker-list{margin-top:12px;display:flex;flex-direction:column;overflow:auto;max-height:min(450px,54vh);gap:5px}.studio19-choice{display:flex;justify-content:space-between;align-items:center;text-align:left;gap:10px;width:100%;padding:10px 12px;background:#233444;border:1px solid #465a6d;color:#f7f8fb;border-radius:8px;cursor:pointer}.studio19-choice:hover,.studio19-choice:focus-visible{background:#30485d;border-color:#92bcec}.studio19-choice strong{font-size:.88rem}.studio19-choice small{font-size:.78rem;color:#b8c9da;overflow-wrap:anywhere}.studio19-picker-foot{font-size:.78rem;opacity:.78;margin-bottom:0}
@media(max-width:820px){.studio19-preview-grid{grid-template-columns:minmax(0,1fr)}.studio19-preview-header label{width:100%}.studio19-preview-header select{max-width:none;flex:1}.studio19-flow,.studio19-code-wrap pre{max-height:240px}}

.studio19-reference{border-top:1px solid var(--border,#556372);margin-top:10px;padding-top:9px}.studio19-reference summary{cursor:pointer;font-size:.9rem;font-weight:600}.studio19-reference summary span{font-weight:400;font-size:.8rem;opacity:.8}.studio19-reference pre{white-space:pre;overflow:auto;max-height:280px;background:rgba(0,0,0,.14);padding:10px;border-radius:8px;font-size:.78rem;line-height:1.45}

/* v1.9.1: persistent project picker and pinned edition */
.studio-project-current{font-size:.8rem;opacity:.9;max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.studio-project-version{font-size:.83rem;white-space:nowrap;border:1px solid #95b49e;border-radius:6px;padding:5px 8px;background:#e4eee5;color:#24482f}
.studio-project-dialog{width:min(850px,calc(100vw - 24px));max-height:90vh;overflow:auto;box-sizing:border-box;padding:22px;border:1px solid #a7b9ad;border-radius:12px;background:#f8fbf8;color:#20392a;box-shadow:0 16px 55px #0005}.studio-project-dialog::backdrop{background:rgba(13,26,19,.72)}.studio-project-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;border-bottom:1px solid #d5e1d7;padding-bottom:10px}.studio-project-dialog h2{font-size:1.32rem;margin:0}.studio-project-dialog h3{font-size:1.06rem;margin:0 0 11px}.studio-project-dialog-head p{font-size:.87rem;margin:7px 0 0;color:#4b6454}.studio-project-dialog-grid{display:grid;grid-template-columns:1fr 1fr;gap:22px;margin-top:18px}.studio-project-dialog-grid>section{min-width:0}.studio-project-dialog form{display:grid;gap:10px}.studio-project-dialog form label{font-size:.9rem;display:grid;gap:4px;font-weight:600}.studio-project-dialog input,.studio-project-dialog select{min-width:0;width:100%;box-sizing:border-box;background:#fff;color:#20392a;border:1px solid #9cb4a1;border-radius:7px;padding:10px;font:inherit}.studio-project-dialog button{cursor:pointer}.studio-project-dialog form .btn{margin-top:4px}.studio-project-hint{color:#4d6453;font-size:.84rem;line-height:1.5}.studio-project-saved-list{max-height:310px;overflow-y:auto;border-top:1px solid #dbe5de;margin-bottom:12px}.studio-project-entry{display:flex;align-items:center;gap:7px;padding:10px 0;border-bottom:1px solid #dbe5de}.studio-project-entry>div{min-width:0;flex:1;display:grid;gap:3px}.studio-project-entry strong{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:.9rem}.studio-project-entry small{color:#546a59;font-size:.78rem}.studio-project-error{color:#a12d2d;font-weight:600;min-height:1.2rem;margin:12px 0 0}.studio-project-dialog .btn:disabled{opacity:.6;cursor:default}
@media(max-width:730px){.studio-project-dialog-grid{grid-template-columns:1fr}.studio-project-dialog{padding:14px}.studio-project-current{display:none}.studio-project-version{white-space:normal}}

/* v2.0: management panels use the existing studio palette and controls. */
.v20-section{border:1px solid var(--border,#536277);border-radius:12px;margin:22px 0;padding:18px;background:var(--card,#182536);color:inherit;}
.v20-section h2{font-size:1.25rem;margin:0 0 6px}.v20-section h3{font-size:1rem;margin:0 0 9px}.v20-section-head p{font-size:.87rem;margin:0 0 15px;opacity:.78}
.v20-columns{display:grid;grid-template-columns:minmax(270px,1fr) minmax(270px,1fr);gap:12px}.v20-panel{background:rgba(128,143,165,.055);border:1px solid rgba(130,148,174,.22);border-radius:10px;padding:14px;min-width:0}
.v20-panel label{display:flex;flex-direction:column;gap:4px;margin:8px 0;font-size:.86rem;min-width:0}.v20-panel input,.v20-panel select,.v20-inline-form input,.v20-inline-form select{width:100%;min-width:0;padding:8px;border:1px solid #697688;border-radius:7px;background:#f6f8fa;color:#172634;font-size:.89rem}
.v20-inline-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:8px 0 12px}.v20-inline-form button{grid-column:1/-1}
.v20-entry{display:flex;gap:5px;align-items:center;justify-content:space-between;padding:7px 3px;border-bottom:1px solid rgba(140,150,165,.22);font-size:.83rem;flex-wrap:wrap}.v20-entry small{opacity:.7;display:block}.v20-entry strong{overflow-wrap:anywhere}.v20-entry .v20-actions{display:flex;gap:4px;flex-wrap:wrap}
.v20-scroll{max-height:370px;overflow-y:auto}.v20-dependencies{margin-top:12px}.v20-dep-head{display:flex;flex-wrap:wrap;align-items:center;gap:12px}.v20-dep-head label{margin-left:auto;min-width:200px}
.v20-dependency-list{max-height:410px;overflow:auto;display:grid;gap:5px}.v20-dependency-row{display:flex;flex-wrap:wrap;align-items:center;gap:5px;padding:7px 8px;border-left:3px solid #7398ac;background:rgba(116,153,190,.1);border-radius:5px;font-size:.83rem;overflow-wrap:anywhere}.v20-dependency-row button{font-size:.81rem;max-width:100%;overflow-wrap:anywhere;text-align:left}.v20-edge-arrow{opacity:.65}.v20-issues{padding-top:7px;color:#e4aa78;font-size:.83rem}.v20-issues p{margin:5px 0}.v20-section button:focus-visible,.v20-customs button:focus-visible,.v20-variables button:focus-visible{outline:3px solid #76b5e0;outline-offset:2px}
.v20-variables,.v20-customs{padding-top:8px;margin-top:6px;border-top:1px solid rgba(129,152,172,.25)}
@media(max-width:900px){.v20-columns{grid-template-columns:1fr}.v20-section{padding:12px}.v20-dep-head label{margin-left:0;width:100%}}

/* Final v2.0 readability: the main editor is light, so management panels follow it. */
.v20-section{background:#f8fafc;color:#26394d;border-color:#cbd7e4}
.v20-section .v20-panel{background:#fff;border-color:#d2dce8;color:#26394d}
.v20-section .v20-section-head p,.v20-section .help.small{color:#566b7f;opacity:1}
.v20-section .v20-entry{border-color:#d9e2ed}
.v20-section .v20-entry small{color:#5d7186;opacity:1}
.v20-section .v20-dependency-row{background:#edf4f9;color:#2b455e;border-left-color:#5f91b9}
.v20-section .v20-dependency-row .tiny{color:#234c71;background:#fff;border-color:#cdddea}
.v20-section .v20-dep-head h3,.v20-section h2,.v20-section h3{color:#243b51}
.v20-section .v20-issues{color:#a35128}
.v20-section .v20-issues p{padding:6px 0;border-bottom:1px solid #e3d5ca}

.v20-score-list{margin:8px 0;padding:6px 0;font-size:.8rem;color:#3b596a}.v20-score-list summary{cursor:pointer}.v20-score-list code{overflow-wrap:anywhere;font-size:.78rem}

.v20-unlinked{border-top:1px solid #d8e2eb;margin-top:12px;padding:10px 2px;font-size:.83rem}.v20-unlinked summary{cursor:pointer;color:#3e617d}.v20-unlinked #v20-unlinked-files{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}

/* v2.0.1: readable local diagnostics and compact in-block condition editor */
.block-inline-issues{margin:6px 0 10px;padding:7px 10px;border-left:3px solid #aa4c39;background:#fff4eb;color:#733f27;font-size:12px;border-radius:3px}
.block-inline-issues p{margin:3px 0}.block-problem-warning .block-inline-issues{border-color:#ad7a29}
.condition-inline{margin:9px 0;border:1px solid #b4c8bd;border-radius:6px;background:#f5f9f6;color:#203f31;padding:8px}
.condition-inline summary{cursor:pointer;font-weight:600;padding:3px}.condition-inline-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:7px;margin-top:8px}
.condition-inline-row label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:#244737}.condition-inline-row input,.condition-inline-row select{min-width:0;width:100%;box-sizing:border-box;padding:6px;color:#17392b;background:white;border:1px solid #a6bdae;border-radius:4px}
.condition-inline-row button{grid-column:1/-1;justify-self:start}.condition-invalid{border-color:#b85042;background:#fff5f2}

/* Readability fix (2026-10-27): production preview must not inherit dark
   foreground text from the light main editor onto a dark fallback surface. */
.studio19-preview {
  background: #f8fbff;
  color: #26394d;
  border-color: #c7d5e3;
}
.studio19-preview h2,
.studio19-preview h3,
.studio19-preview-header label,
.studio19-reference summary { color: #203950; }
.studio19-preview-header p,
.studio19-note,
.studio19-preview-foot,
.studio19-flow-branch {
  color: #475f77;
  opacity: 1;
}
.studio19-preview-header select {
  background: #ffffff;
  color: #203950;
  border: 1px solid #9bb2c8;
  border-radius: 7px;
}
.studio19-flow-wrap,
.studio19-code-wrap {
  background: #ffffff;
  color: #26394d;
  border-color: #c7d5e3;
}
.studio19-flow-row {
  background: #f1f6fb;
  color: #26394d;
  border-color: #c7d5e3;
}
.studio19-flow-row:hover,
.studio19-flow-row:focus-visible {
  background: #e7f1fa;
  color: #173950;
  border-color: #4580b6;
  outline-color: #4580b6;
}
.studio19-flow-row small,
.studio19-flow-num,
.studio19-code-wrap small,
.studio19-reference summary span {
  color: #4b6076;
  opacity: 1;
}
.studio19-flow-branch { border-left-color: #b48339; }
.studio19-code-wrap pre,
.studio19-reference pre {
  background: #152332;
  color: #e8f0fa;
  border: 1px solid #344b62;
}
.studio19-reference { border-top-color: #c7d5e3; }
.studio19-preview .help.small { color: #4b6076; }
.studio19-preview .tiny {
  background: #f9fbfd;
  color: #243c56;
  border-color: #b7c8d9;
}
.studio19-preview .tiny:hover,
.studio19-preview .tiny:focus-visible {
  background: #e6f1fb;
  color: #18354e;
}
/* Keep the selection label together instead of stacking one character per line. */
.studio19-preview-header label { white-space: nowrap; flex: 0 1 260px; }
.studio19-preview-header select { min-width: 150px; }
.studio19-code-wrap pre,
.studio19-reference pre { font-size: .83rem; }
@media (max-width: 820px) {
  .studio19-preview-header label { flex: 1 1 100%; }
  .studio19-preview-header select { min-width: 0; }
}

/* 2026-10-29: light boxes inside the dark code panel need dark text */
.code-panel .studio18-file-manager,.code-panel .studio18-resource,.code-panel .studio18-check,.code-panel .studio18-tab.active,.code-panel .file-browser{color:#243144}
