/* Builder — shared + 3 layouts */
html,body{height:100%;overflow:hidden}
.L{display:none;height:100vh;width:100vw;background:var(--bg);flex-direction:column}
.L.on{display:flex}
.bar{height:56px;display:flex;align-items:center;gap:12px;padding:0 14px;background:var(--surface);border-bottom:1px solid var(--line);flex:none}
.proj{display:flex;align-items:center;gap:9px;padding:5px 10px;border-radius:9px;font-weight:700;font-size:14px}.proj:hover{background:var(--surface-2)}
.saved{font-size:12px;color:var(--faint);display:flex;align-items:center;gap:5px}
.pill-c{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 11px;border-radius:20px;background:var(--surface-2);font-weight:700;font-size:12.5px}
.pill-c .ic{color:var(--accent)}
.lay-sw{display:inline-flex;background:var(--surface-2);border-radius:9px;padding:2px}
.lay-sw button{width:30px;height:28px;border-radius:7px;display:grid;place-items:center;color:var(--muted)}
.lay-sw button.on{background:var(--surface);color:var(--accent);box-shadow:var(--sh-sm)}
.lay-sw button:hover{color:var(--text)}
.pane{flex:1;display:flex;flex-direction:column;min-height:0;min-width:0;overflow:auto}
.pad-p{padding:22px 26px;max-width:880px;width:100%;margin:0 auto}
.pad-p h2{font-size:19px;letter-spacing:-.02em;margin-bottom:4px}.pad-p>p{color:var(--muted);margin-bottom:18px}

/* ===== sample generated app ===== */
.frame{background:#fff;border:1px solid var(--line-2);border-radius:12px;overflow:hidden;box-shadow:var(--sh-lg);margin:0 auto;transition:width .35s cubic-bezier(.3,.7,.2,1);width:100%;height:100%;position:relative;container-type:inline-size;color:#14141c;color-scheme:light}
.frame.dev-tablet{width:780px}.frame.dev-phone{width:390px}
.appfx{display:grid;grid-template-columns:208px 1fr;height:100%;font-size:13px;background:#f7f7fb;--p:#f0337a;--ps:#ffe9f1}
.ax-side{background:#fff;border-right:1px solid #e9e9f1;padding:16px 12px;display:flex;flex-direction:column;gap:3px}
.ax-brand{display:flex;align-items:center;gap:9px;font-weight:800;font-size:15px;padding:2px 8px 16px}
.ax-brand i{width:26px;height:26px;border-radius:8px;background:var(--p);display:grid;place-items:center;color:#fff}
.ax-brand i .ic{width:14px;height:14px}
.ax-nav{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;color:#6a6a7c;font-weight:600;font-size:12.8px}
.ax-nav.on{background:var(--ps);color:var(--p)}.ax-nav .ic{width:16px;height:16px}
.ax-user{margin-top:auto;display:flex;gap:9px;align-items:center;padding:10px;border:1px solid #e9e9f1;border-radius:10px;font-size:12px}
.ax-user b{display:block;font-size:12.5px}
.ax-main{display:flex;flex-direction:column;min-width:0;overflow:auto}
.ax-top{height:54px;background:#fff;border-bottom:1px solid #e9e9f1;display:flex;align-items:center;gap:12px;padding:0 22px;flex:none}
.ax-top h5{font-size:15px;font-weight:700}
.ax-search{flex:1;max-width:280px;height:32px;border-radius:8px;background:#f2f2f7;display:flex;align-items:center;gap:8px;padding:0 11px;color:#9b9bad;font-size:12.5px}
.ax-btn{height:32px;padding:0 13px;border-radius:8px;background:var(--p);color:#fff;font-weight:700;font-size:12.5px;display:inline-flex;align-items:center;gap:6px}
.ax-body{padding:22px;display:flex;flex-direction:column;gap:16px}
.ax-h{font-size:21px;font-weight:800;letter-spacing:-.03em}.ax-sub{color:#6a6a7c;margin-top:2px}
.ax-kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.ax-card{background:#fff;border:1px solid #e9e9f1;border-radius:12px;padding:15px 16px}
.ax-card .k{color:#6a6a7c;font-size:12px;font-weight:600}.ax-card .v{font-size:23px;font-weight:800;letter-spacing:-.03em;margin:3px 0}
.ax-card .d{font-size:11.5px;font-weight:700;color:#0f9d68}.ax-card .d.dn{color:#df3a3f}
.ax-row{display:grid;grid-template-columns:1.7fr 1fr;gap:14px}
.ax-card h6{font-size:13.5px;font-weight:700;margin-bottom:10px}
.ax-stage{display:flex;align-items:center;gap:10px;margin:9px 0;font-size:12.5px;font-weight:600}
.ax-stage .br{flex:1;height:7px;background:#eeeef4;border-radius:5px;overflow:hidden}.ax-stage .br i{display:block;height:100%;background:var(--p);border-radius:5px}
.ax-stage span:first-child{width:82px;color:#6a6a7c}.ax-stage span:last-child{width:50px;text-align:right}
.ax-t{width:100%;border-collapse:collapse;font-size:12.5px}.ax-t th{text-align:left;color:#9b9bad;font-size:11px;text-transform:uppercase;letter-spacing:.05em;padding:8px 10px;font-weight:600;border-bottom:1px solid #eeeef4}
.ax-t td{padding:10px;border-bottom:1px solid #f1f1f6;white-space:nowrap}.ax-t tr:last-child td{border:0}
.ax-pill{padding:3px 9px;border-radius:20px;font-size:11px;font-weight:700;background:#e1f5ec;color:#0f9d68}.ax-pill.w{background:#fff2d6;color:#c98100}.ax-pill.b{background:#e4f0fd;color:#1e7fe0}
.ax-av{width:24px;height:24px;border-radius:50%;display:inline-grid;place-items:center;color:#fff;font-size:10px;font-weight:700;margin-right:8px;vertical-align:middle}
[data-edit]{cursor:pointer;position:relative;transition:outline-color .12s}
[data-edit]:hover{outline:1.5px dashed #8b7dff;outline-offset:3px}
[data-edit].sel{outline:2px solid #f0337a;outline-offset:3px}
[data-edit].sel::before{content:attr(data-edit);position:absolute;top:-23px;left:-2px;background:#f0337a;color:#fff;font-size:10.5px;font-weight:700;padding:2px 8px;border-radius:5px 5px 5px 0;z-index:5;white-space:nowrap;font-family:var(--font);line-height:1.5;text-transform:none;letter-spacing:0}
@container (max-width:860px){.appfx{grid-template-columns:64px 1fr}.ax-nav{font-size:0;justify-content:center;gap:0}.ax-nav .ic{width:18px;height:18px}.ax-brand span,.ax-user div{display:none}.ax-brand{justify-content:center;padding:2px 0 16px}.ax-user{justify-content:center;padding:8px}.ax-kpis{grid-template-columns:repeat(2,1fr)}.ax-row{grid-template-columns:1fr}}
@container (max-width:520px){.appfx{grid-template-columns:1fr}.ax-side{display:none}.ax-search{display:none}.ax-body{padding:16px}.ax-kpis{gap:10px}.ax-t th:nth-child(n+4),.ax-t td:nth-child(n+4){display:none}}

/* ===== chat ===== */
.chat{display:flex;flex-direction:column;min-height:0;flex:1}
.chat-h{height:46px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid var(--line);font-weight:700;flex:none}
.chat-scroll{flex:1;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:14px}
.msg.user{align-self:flex-end;max-width:88%;background:var(--text);color:var(--bg);padding:10px 14px;border-radius:14px 14px 4px 14px;font-size:13.5px}
.msg.ai{display:flex;gap:10px}.msg.ai .av{width:26px;height:26px;border-radius:8px;background:linear-gradient(135deg,var(--accent),#c05cff);color:#fff;display:grid;place-items:center;flex:none;margin-top:2px}
.msg.ai .av .ic{width:14px;height:14px}.msg.ai .tx{min-width:0;flex:1;font-size:13.5px;display:flex;flex-direction:column;gap:10px}
.plan{border:1.5px solid var(--accent-line);border-radius:14px;background:linear-gradient(180deg,var(--accent-soft),var(--surface));overflow:hidden}
.plan .ph{padding:12px 14px;display:flex;align-items:center;gap:9px;font-weight:700}
.plan .pb{padding:0 14px 12px;display:flex;flex-direction:column;gap:9px}
.plan .pr{display:flex;gap:9px;align-items:flex-start;font-size:12.8px}.plan .pr .ic{color:var(--accent);width:15px;height:15px;margin-top:2px}
.plan .pr span{color:var(--muted)}
.plan .pf{padding:11px 14px;background:var(--surface);border-top:1px solid var(--accent-line);display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.est{display:flex;flex-direction:column;line-height:1.25;margin-right:auto}.est b{font-size:15px}.est small{color:var(--ok);font-weight:700;font-size:11.5px}
.steps{border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.step{display:flex;align-items:center;gap:10px;padding:9px 12px;font-size:12.8px;border-bottom:1px solid var(--line)}.step:last-child{border:0}
.step .si{width:18px;height:18px;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--ok);color:#fff}.step .si .ic{width:11px;height:11px;stroke-width:3}
.step.run .si{background:none;color:var(--accent);border:2px solid var(--accent-line);border-top-color:var(--accent);animation:spin .9s linear infinite}.step.run .si .ic{display:none}
.step.fix .si{background:var(--warn)}.step.wait{color:var(--faint)}.step.wait .si{background:var(--surface-3)}
.step .t{flex:1;min-width:0}.step small{color:var(--faint)}
.composer{margin:12px;border:1.5px solid var(--line-2);border-radius:16px;background:var(--surface);box-shadow:var(--sh-sm);transition:.15s;flex:none}
.composer:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.composer textarea{width:100%;border:0;outline:0;background:none;resize:none;padding:13px 14px 4px;height:62px;font-size:13.8px}
.composer .cb{display:flex;align-items:center;gap:6px;padding:6px 8px 8px}
.mode{display:inline-flex;background:var(--surface-2);border-radius:8px;padding:2px}
.mode button{height:26px;padding:0 10px;border-radius:6px;font-size:12px;font-weight:700;color:var(--muted)}.mode button.on{background:var(--surface);color:var(--accent);box-shadow:var(--sh-sm)}
.sendb{width:34px;height:34px;border-radius:10px;background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#fff;display:grid;place-items:center;margin-left:auto}
.mini-btn{height:30px;padding:0 9px;border-radius:8px;color:var(--muted);display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600}.mini-btn:hover{background:var(--surface-2);color:var(--text)}
.ct{font-size:11.5px;color:var(--faint);text-align:center;padding:0 0 10px}

/* ===== inspector ===== */
.insp{width:268px;background:var(--surface);border:1px solid var(--line);border-radius:14px;box-shadow:var(--sh-md);display:flex;flex-direction:column;overflow:hidden;flex:none}
.insp .ih{padding:12px 14px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:9px;font-weight:700}
.insp .ib{padding:14px;display:flex;flex-direction:column;gap:14px;overflow:auto}
.insp label{font-size:11.5px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;display:block;margin-bottom:6px}
.sw{display:flex;gap:7px}.sw i{width:24px;height:24px;border-radius:50%;border:2px solid var(--surface);box-shadow:0 0 0 1px var(--line-2);cursor:pointer}.sw i.on{box-shadow:0 0 0 2px var(--accent)}
.ask-ai{display:flex;gap:6px;align-items:center;border:1px solid var(--accent-line);background:var(--accent-soft);border-radius:10px;padding:0 6px 0 10px;height:38px}
.ask-ai input{flex:1;border:0;outline:0;background:none;font-size:12.5px;min-width:0}.ask-ai .ic{color:var(--accent)}

/* ===== panels (pages, data, design, integrations, history, code) ===== */
.list{display:flex;flex-direction:column}
.li{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:10px;font-weight:600;font-size:13.5px}
.li:hover{background:var(--surface-2)}.li.on{background:var(--accent-soft);color:var(--accent)}
.li .ic{color:var(--muted)}.li.on .ic{color:var(--accent)}.li small{color:var(--faint);font-weight:500;margin-left:auto}
.itg{display:flex;align-items:center;gap:13px;padding:13px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.itg .lg{width:38px;height:38px;border-radius:10px;display:grid;place-items:center;color:#fff;font-weight:800;flex:none}
.itg b{display:block;font-size:13.5px}.itg small{color:var(--muted);font-size:12px}
.code{background:#13131c;color:#d6d6e6;border-radius:12px;padding:16px 18px;font-family:var(--mono);font-size:12.3px;line-height:1.75;overflow:auto;white-space:pre}
.code .k{color:#ff9ec0}.code .s{color:#7ee0a8}.code .n{color:#ffb86b}.code .c{color:#5f5f7a}
.vers{display:flex;flex-direction:column;gap:0;position:relative}
.ver{display:flex;gap:13px;padding:0 0 18px;position:relative}.ver:before{content:"";position:absolute;left:8px;top:20px;bottom:0;width:2px;background:var(--line)}.ver:last-child:before{display:none}
.ver .vd{width:18px;height:18px;border-radius:50%;background:var(--surface);border:2px solid var(--accent);flex:none;margin-top:2px}.ver.cur .vd{background:var(--accent)}
.ver b{font-size:13.5px}.ver small{color:var(--muted);display:block}
.dgrid{width:100%;border-collapse:collapse;font-size:12.8px;background:var(--surface)}
.dgrid th{background:var(--surface-2);text-align:left;padding:9px 12px;font-size:11.5px;color:var(--muted);border:1px solid var(--line);font-weight:700}
.dgrid td{padding:9px 12px;border:1px solid var(--line)}
.dgrid tr:hover td{background:var(--accent-soft)}

/* ===== CLASSIC ===== */
.cl-body{flex:1;display:grid;grid-template-columns:410px 1fr;min-height:0}
.cl-chat{border-right:1px solid var(--line);background:var(--surface);display:flex;flex-direction:column;min-height:0}
.cl-stage{min-width:0;display:flex;flex-direction:column;background:var(--surface-2);min-height:0}
.stg-bar{height:52px;background:var(--surface);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px;padding:0 14px;flex:none}
.urlb{display:flex;align-items:center;gap:8px;height:32px;border-radius:9px;background:var(--surface-2);padding:0 12px;font-size:12.5px;color:var(--muted);flex:1;max-width:340px}
.urlb .ic{width:14px;height:14px;color:var(--ok)}
.stg-view{flex:1;display:flex;min-height:0;padding:18px;gap:14px;overflow:hidden;background:radial-gradient(circle,var(--line-2) 1px,transparent 1.4px) 0 0/16px 16px,var(--surface-2)}
.stg-view .frame{flex:1;height:100%}
.stg-view .frame-wrap{flex:1;min-width:0;display:flex;justify-content:center}

/* ===== CANVAS ===== */
.cv{position:relative;flex:1;min-height:0;overflow:hidden;background:radial-gradient(circle,var(--line-2) 1px,transparent 1.4px) 0 0/18px 18px,var(--surface-2)}
.cv .frame-wrap{position:absolute;inset:78px 24px 112px 84px;display:flex;justify-content:center}
.fl{position:absolute;background:var(--surface);border:1px solid var(--line);box-shadow:var(--sh-md);z-index:10}
.cv-top{top:14px;left:50%;transform:translateX(-50%);border-radius:30px;height:48px;padding:0 8px 0 14px;display:flex;align-items:center;gap:10px;white-space:nowrap}
.cv-dock{left:16px;top:50%;transform:translateY(-50%);border-radius:18px;padding:8px;display:flex;flex-direction:column;gap:4px}
.cv-dock button{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;color:var(--muted);position:relative}
.cv-dock button:hover{background:var(--surface-2);color:var(--text)}.cv-dock button.on{background:var(--accent-soft);color:var(--accent)}
.cv-pop{left:82px;top:50%;transform:translateY(-50%);width:340px;max-height:72%;border-radius:18px;display:flex;flex-direction:column;overflow:hidden;animation:up .25s}
.cv-pop .ph{padding:14px 16px;border-bottom:1px solid var(--line);font-weight:700;display:flex;align-items:center;justify-content:space-between}
.cv-pop .pb{padding:12px;overflow:auto}
.cv-cmd{bottom:20px;left:50%;transform:translateX(-50%);width:min(720px,calc(100% - 200px));border-radius:22px;padding:8px;border-color:var(--accent-line)}
.cv-tick{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translateX(-50%);background:var(--surface);border:1px solid var(--line);box-shadow:var(--sh-md);border-radius:30px;padding:6px 14px 6px 8px;display:flex;align-items:center;gap:10px;font-size:12.5px;font-weight:600;white-space:nowrap}
.cv-tick .sp{width:20px;height:20px;border:2.5px solid var(--accent-line);border-top-color:var(--accent);border-radius:50%;animation:spin .9s linear infinite}
.cv-cmd textarea{width:100%;border:0;outline:0;background:none;resize:none;height:46px;padding:10px 12px 2px;font-size:14px}
.cv-cmd .cb{display:flex;align-items:center;gap:6px;padding:0 4px 2px}
.cv-insp{right:18px;top:96px}
.cv-chat{right:0;top:0;bottom:0;width:380px;border-radius:0;border-width:0 0 0 1px;display:flex;flex-direction:column;z-index:20;box-shadow:var(--sh-lg);animation:up .25s}
.cv .frame{height:100%}

/* ===== STUDIO ===== */
.st-top{height:42px;background:var(--surface);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px;padding:0 12px;flex:none;font-size:12.8px}
.st-menu{display:flex;gap:2px}.st-menu span{padding:5px 9px;border-radius:6px;color:var(--muted);font-weight:550;cursor:pointer}.st-menu span:hover{background:var(--surface-2);color:var(--text)}
.st-cmd{flex:1;max-width:420px;margin:0 auto;height:28px;border-radius:8px;background:var(--surface-2);border:1px solid var(--line);display:flex;align-items:center;gap:8px;padding:0 10px;color:var(--faint)}
.st-body{flex:1;display:grid;grid-template-columns:48px 262px 1fr 370px;min-height:0}
.st-act{background:var(--surface-2);border-right:1px solid var(--line);display:flex;flex-direction:column;align-items:center;padding:8px 0;gap:2px}
.st-act button{width:40px;height:40px;display:grid;place-items:center;color:var(--faint);border-left:2px solid transparent;border-radius:0;position:relative}
.st-act button:hover{color:var(--text)}.st-act button.on{color:var(--accent);border-left-color:var(--accent)}
.st-act .sp{flex:1}
.st-side{background:var(--surface);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}
.st-side .sh{height:36px;display:flex;align-items:center;justify-content:space-between;padding:0 14px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);flex:none}
.st-side .sb{overflow:auto;padding:0 8px 12px;flex:1}
.tree-g{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--faint);padding:12px 8px 4px;display:flex;align-items:center;gap:5px}
.tr{display:flex;align-items:center;gap:8px;padding:5px 8px;border-radius:6px;font-size:13px;color:var(--muted);font-weight:550;cursor:pointer}
.tr:hover{background:var(--surface-2);color:var(--text)}.tr.on{background:var(--accent-soft);color:var(--accent)}.tr .ic{width:15px;height:15px}.tr small{margin-left:auto;font-size:10.5px;color:var(--faint)}
.tr.in{padding-left:22px}
.st-mid{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--bg)}
.etabs{display:flex;background:var(--surface-2);border-bottom:1px solid var(--line);flex:none;height:36px}
.etabs button{padding:0 14px;display:flex;align-items:center;gap:7px;font-size:12.5px;font-weight:600;color:var(--muted);border-right:1px solid var(--line);border-top:2px solid transparent}
.etabs button.on{background:var(--surface);color:var(--text);border-top-color:var(--accent)}
.st-ed{flex:1;display:flex;min-height:0}
.st-ed .pv{flex:1;min-width:0;padding:14px;background:radial-gradient(circle,var(--line-2) 1px,transparent 1.4px) 0 0/16px 16px,var(--surface-2);display:flex}
.st-ed .pv .frame{height:100%}
.st-ed .cd{width:38%;min-width:260px;border-left:1px solid var(--line);padding:12px;background:var(--surface);overflow:auto;display:flex}
.st-ed .cd .code{flex:1;border-radius:8px}
.st-bot{height:208px;border-top:1px solid var(--line);background:var(--surface);display:flex;flex-direction:column;flex:none}
.st-bot .etabs{background:var(--surface);height:34px}.st-bot .etabs button{border:0;border-bottom:2px solid transparent;border-top:0;height:34px}.st-bot .etabs button.on{border-bottom-color:var(--accent);background:none}
.logs{flex:1;overflow:auto;padding:10px 14px;font-family:var(--mono);font-size:12px;line-height:1.85;background:var(--surface)}
.logs .t{color:var(--faint)}.logs .o{color:var(--ok)}.logs .w{color:var(--warn)}.logs .i{color:var(--accent)}
.st-chat{border-left:1px solid var(--line);background:var(--surface);display:flex;flex-direction:column;min-height:0}
.st-status{height:24px;background:linear-gradient(90deg,var(--accent),var(--accent-2));color:#fff;display:flex;align-items:center;gap:16px;padding:0 12px;font-size:11.5px;font-weight:600;flex:none}
.st-status span{display:flex;align-items:center;gap:5px}.st-status .ic{width:12px;height:12px}
@media(max-width:1200px){.st-body{grid-template-columns:48px 220px 1fr 320px}.cl-body{grid-template-columns:360px 1fr}}
