.ym-lab-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:11px;padding:15px;background:var(--surface);border:1px solid var(--border);border-radius:17px;margin-bottom:18px}.ym-lab-toolbar>input{flex:1;min-width:190px;padding:12px;border:1px solid var(--border);border-radius:11px}
.ym-lab-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:17px}.ym-lab-source,.ym-lab-output{min-width:0;border:1px solid var(--border);background:var(--surface);border-radius:18px;overflow:hidden;box-shadow:var(--shadow)}
.ym-lab-tabs,.ym-lab-output-head{display:flex;align-items:center;gap:4px;background:var(--surface-alt);padding:12px;border-bottom:1px solid var(--border);color:var(--muted);font-size:11px;font-weight:850;letter-spacing:.06em}
.ym-lab-tabs button{border:0;background:transparent;padding:10px 15px;border-radius:9px;color:var(--muted);cursor:pointer}.ym-lab-tabs button.active{background:var(--surface);color:var(--primary);box-shadow:var(--shadow)}
.ym-lab-source textarea{width:100%;height:540px;min-width:0;display:block;resize:vertical;border:0;outline:0;padding:19px;font:13px/1.7 Consolas,Monaco,monospace;color:#27324c;background:#fdfdff;tab-size:4;white-space:pre}
.ym-lab-source textarea[hidden]{display:none}.ym-lab-hint{padding:10px 16px;font-size:11px;color:var(--muted)}.ym-lab-output-head{justify-content:space-between}.ym-lab-output-head button{border:0;background:transparent;color:var(--primary);cursor:pointer}
#ym-lab-frame{display:block;background:#fff;width:100%;height:360px;border:0}#ym-lab-console{min-height:200px;max-height:330px;overflow:auto;padding:14px;font:12px/1.6 Consolas,monospace}
.ym-lab-log{padding:7px 10px;margin-bottom:6px;background:#f6f7fb;border-radius:7px;overflow-wrap:anywhere}.ym-lab-log.error{color:#b63459;background:#fff1f3}.ym-lab-log.warn{color:#9a6f28;background:#fff8e8}.ym-lab-log.success{color:#147755;background:#eaf9f0}
.ym-lab-package{margin-top:20px}.ym-lab-package form{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-top:22px}#ym-lab-validation{white-space:pre-wrap;margin-top:15px;line-height:1.7}.ym-lab-invalid{color:#bd4264}.ym-lab-valid{color:#137b54}
@media(max-width:900px){.ym-lab-layout{grid-template-columns:1fr}.ym-lab-source textarea{height:350px}}


/* V5 guided, file-based package creation */
#ym-lab-app{min-width:0}
.ym-lab-project-picker{display:grid;grid-template-columns:minmax(280px,390px) minmax(0,1fr);gap:22px;align-items:center;margin-bottom:16px;padding:18px 20px;background:linear-gradient(120deg,#fff,#f6f4ff 62%,#eefafa)}
.ym-lab-project-picker label{display:grid;gap:8px}
.ym-lab-project-picker select,.ym-lab-file-add select,.ym-lab-custom-add input,.ym-lab-preview-switch select{width:100%;background:var(--surface);border:1px solid var(--border);color:var(--text);padding:11px 12px;border-radius:11px;min-width:0}
.ym-lab-project-guide{font-size:12px;line-height:1.7;color:var(--muted)}
.ym-lab-source [hidden],.ym-lab-output [hidden]{display:none!important}
.ym-lab-file-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap;padding:13px 16px;background:linear-gradient(100deg,#f1ecff,#eaf8ff);border-bottom:1px solid var(--border)}
.ym-lab-file-toolbar strong{display:block;font-size:11px;letter-spacing:.08em;color:var(--primary)}
.ym-lab-file-toolbar small{display:block;font-size:11px;color:var(--muted)}
.ym-lab-package-grid{display:grid;grid-template-columns:minmax(160px,32%) minmax(0,1fr);min-height:510px}
.ym-lab-file-list{display:flex;flex-direction:column;gap:3px;max-height:605px;overflow:auto;background:#f5f6fc;border-right:1px solid var(--border);padding:11px}
.ym-lab-file-item{font:600 11px/1.5 Consolas,monospace;display:block;width:100%;text-align:left;white-space:normal;overflow-wrap:anywhere;border:1px solid transparent;border-radius:9px;padding:10px 8px;color:#616983;background:transparent;cursor:pointer}
.ym-lab-file-item::before{content:'▤';margin-right:7px;color:#8572d9}
.ym-lab-file-item:hover{background:#e8e6fa}
.ym-lab-file-item.selected{background:#fff;color:#5739c9;border-color:#dcd5fa;box-shadow:0 6px 15px #46359613}
.ym-lab-code-pane{min-width:0;display:flex;flex-direction:column}
.ym-lab-file-head{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:10px 13px;background:#fafaff;border-bottom:1px solid var(--border)}
.ym-lab-file-head strong{font:650 11px/1.4 Consolas,monospace;color:var(--primary);overflow-wrap:anywhere}
.ym-lab-code-pane #ym-lab-file-editor{flex:1;height:480px;min-height:420px;resize:vertical;width:100%;border:0;outline:none;color:#222d52;background:#fff;display:block;padding:17px;font:12px/1.75 Consolas,monospace;white-space:pre;tab-size:4}
.ym-lab-file-add,.ym-lab-custom-add{display:flex;gap:9px;align-items:center;flex-wrap:wrap;padding:11px 14px;border-top:1px solid var(--border)}
.ym-lab-file-add label,.ym-lab-custom-add label{font-size:11px;color:var(--muted);font-weight:750}
.ym-lab-file-add select,.ym-lab-custom-add input{flex:1 1 190px;font:12px/1.5 Consolas,monospace}
.ym-lab-custom-add{background:#fafaff}
.ym-lab-file-note{padding:10px 15px;font-size:11px;color:var(--muted);background:var(--surface-alt)}
.ym-lab-preview-switch{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:9px 13px;background:#fff;font-size:10px;color:#626b8b}
.ym-lab-preview-switch label{display:flex;align-items:center;gap:9px}
.ym-lab-preview-switch select{font-size:11px;width:auto;padding:6px 8px}
.ym-lab-preview-stage{display:flex;justify-content:center;overflow:auto;background:repeating-linear-gradient(45deg,#edf0f8,#edf0f8 10px,#f7f8fc 10px,#f7f8fc 20px);padding:12px}
.ym-lab-preview-stage #ym-lab-frame{height:490px;max-width:100%;border:1px solid #dce0ef;border-radius:9px;box-shadow:0 18px 40px #3345801c;transition:max-width .2s}
#ym-lab-file-editor:focus{box-shadow:inset 0 0 0 2px #ded6fa}
@media(max-width:1100px){.ym-lab-package-grid{grid-template-columns:minmax(120px,35%) minmax(0,1fr)}}
@media(max-width:720px){.ym-lab-project-picker{grid-template-columns:1fr}.ym-lab-package-grid{grid-template-columns:1fr}.ym-lab-file-list{max-height:155px;border-right:0;border-bottom:1px solid var(--border)}.ym-lab-code-pane #ym-lab-file-editor{min-height:300px;height:360px}.ym-lab-preview-stage #ym-lab-frame{height:390px}}


/* V5.1 full-source templates: stable project-picker / loading feedback. */
.ym-lab-project-info{display:grid;gap:10px;min-width:0}
.ym-lab-sample-controls{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ym-lab-sample-controls[hidden],.ym-lab-sample-controls [hidden]{display:none!important}
.ym-lab-sample-controls label{display:flex;gap:8px;align-items:center;color:var(--muted);font-size:11px;font-weight:750}
.ym-lab-sample-controls select{max-width:260px;min-width:160px;padding:9px;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--text)}
#ym-lab-sample-status{display:inline-block;font-size:11px;font-weight:700;color:var(--primary);overflow-wrap:anywhere}
.ym-lab-sample-controls button{white-space:normal}
@media(max-width:680px){.ym-lab-sample-controls{align-items:stretch}.ym-lab-sample-controls label{flex-wrap:wrap;width:100%}.ym-lab-sample-controls select{max-width:100%;width:100%}}


/* V5.2: color-coded Ace syntax editors, responsive formatter and fallback. */
.ym-lab-ace{height:540px;min-height:330px;width:100%;min-width:0;position:relative;display:block;border:0;background:#1d2233;color:#e6ecff;font:13px/1.65 Consolas,"SFMono-Regular",monospace}
.ym-lab-ace[hidden]{display:none!important}
.ym-lab-source .ym-lab-ace .ace_gutter{background:#171c2b;color:#7f91b3;border-right:1px solid #35405a}
.ym-lab-source .ym-lab-ace .ace_marker-layer .ace_active-line{background:rgba(137,153,211,.10)}
.ym-lab-source .ym-lab-ace .ace_gutter-active-line{background:#252e44}
.ym-lab-source .ym-lab-ace .ace_indent-guide{opacity:.6}
.ym-lab-source .ym-lab-ace .ace_cursor{color:#f4d27f}
.ym-lab-source .ym-lab-ace .ace_print-margin{display:none}
.ym-lab-code-pane .ym-lab-ace[data-lab-editor="file"]{min-height:430px;height:510px;flex:1}
.ym-lab-code-meta{display:flex;align-items:flex-start;flex-direction:column;gap:5px;min-width:0}
.ym-lab-code-meta small{font:700 10px/1.3 Inter,system-ui,sans-serif;letter-spacing:.05em;color:#1b958f;background:#def7f3;border:1px solid #b9ebe4;border-radius:999px;padding:3px 9px}
.ym-lab-autoformat-label{display:inline-flex;align-items:center;gap:8px;white-space:nowrap;font-size:11px;font-weight:700;color:var(--muted);padding:5px 8px}
.ym-lab-autoformat-label input{width:16px;height:16px;accent-color:var(--primary)}
#ym-lab-editor-status{font-size:11px;color:#107a70;font-weight:680;flex:1 1 190px;line-height:1.5}
#ym-lab-editor-status.error{color:#b43a5e}
.ym-lab-toolbar{align-items:center}
.ym-lab-source .ym-lab-ace + textarea{display:none}
@media(max-width:900px){.ym-lab-ace{height:380px}.ym-lab-code-pane .ym-lab-ace[data-lab-editor="file"]{height:410px}}
@media(max-width:680px){.ym-lab-ace{height:330px;font-size:12px}.ym-lab-code-pane .ym-lab-ace[data-lab-editor="file"]{min-height:330px;height:390px}.ym-lab-autoformat-label{white-space:normal}}
