:root{--bg: #f4f5f8;--panel: #ffffff;--line: #e3e6ec;--text: #1c2230;--muted: #6b7280;--accent: #4f46e5;--accent-2: #eef0ff;--ok: #059669;--warn: #d97706;--bad: #dc2626;--radius: 8px;font-family:Inter,system-ui,sans-serif;font-size:13px;color:var(--text)}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg)}button,.btn{font:inherit;border:1px solid var(--line);background:#fff;color:var(--text);border-radius:6px;padding:6px 10px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:4px;white-space:nowrap}button:hover:not(:disabled){border-color:#c7cbd4;background:#fafbfc}button:disabled{opacity:.5;cursor:default}button.primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}button.primary:hover:not(:disabled){background:#4338ca}button.ghost,.btn.ghost{border-color:transparent;background:transparent;padding:4px 8px}button.ghost:hover:not(:disabled){background:#f0f1f5}button.danger{color:var(--bad)}button.big{width:100%;padding:10px;font-size:14px;justify-content:center}input,select,textarea{font:inherit;border:1px solid var(--line);border-radius:6px;padding:6px 8px;background:#fff;color:var(--text);width:100%;min-width:0}input[type=color]{width:36px;height:28px;padding:2px}input[type=checkbox]{width:auto}input[type=range]{padding:0}label{display:flex;flex-direction:column;gap:4px;color:var(--muted);font-size:12px}label.check{flex-direction:row;align-items:center;gap:8px;color:var(--text);font-size:13px}label.row{flex-direction:row;align-items:center}h4{margin:0 0 8px;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted)}hr{border:0;border-top:1px solid var(--line);margin:6px 0;width:100%}.row{display:flex;align-items:center}.row.gap{gap:8px}.row.tight{gap:4px}.row.wrap{flex-wrap:wrap}.row.between{justify-content:space-between}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px}.sep{width:1px;height:20px;background:var(--line)}.nowrap{white-space:nowrap}.app{display:flex;flex-direction:column;height:100%}.topbar{display:flex;align-items:center;gap:24px;padding:0 16px;height:50px;background:#151a2d;color:#fff;flex-shrink:0}.brand{font-weight:700;font-size:15px;display:flex;align-items:center;gap:8px}.logo{color:#a5b4fc;font-size:20px}.modes{display:flex;gap:4px}.modes button{background:transparent;border:0;color:#c7cbe0;padding:8px 14px}.modes button.on{background:#ffffff1f;color:#fff;font-weight:600}.modes button:hover:not(.on){background:#ffffff0f}.topbar .hint{margin-left:auto;color:#8b92ad;font-size:12px}.loading{padding:40px;text-align:center;color:var(--muted)}.workspace{flex:1;display:grid;grid-template-columns:330px 1fr 300px;min-height:0}.left,.right{background:var(--panel);overflow-y:auto;min-height:0}.left{border-right:1px solid var(--line)}.right{border-left:1px solid var(--line);padding:12px;display:flex;flex-direction:column;gap:12px}.right section{display:flex;flex-direction:column;gap:8px;padding-bottom:12px;border-bottom:1px solid var(--line)}.right section:last-child{border-bottom:0}.center{display:flex;flex-direction:column;min-width:0;min-height:0}.tabs{display:flex;border-bottom:1px solid var(--line);position:sticky;top:0;background:#fff;z-index:2}.tabs button{flex:1;border:0;border-radius:0;padding:10px 6px;background:transparent;color:var(--muted);border-bottom:2px solid transparent;justify-content:center}.tabs button.on{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}.tabs.inline{border:0;position:static;background:transparent}.tabs.inline button{flex:none;padding:6px 12px}.panel-body{padding:12px;display:flex;flex-direction:column;gap:10px}.lbl{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}.note{color:var(--muted);font-size:12px;background:#f6f7f9;border-radius:6px;padding:8px}.note.err{color:var(--bad);background:#fef2f2}.note.warn{color:var(--warn);background:#fffbeb}.small-controls select{width:auto;flex:1}.chips{display:flex;flex-wrap:wrap;gap:6px}.chip{border-radius:999px;padding:4px 10px;font-size:12px}.chip.on{background:var(--accent-2);border-color:var(--accent);color:var(--accent)}.ideas{display:flex;flex-direction:column;gap:8px}.prompts{display:flex;flex-direction:column;gap:4px}.prompt{white-space:normal;text-align:left;font-size:12px;line-height:1.3}.results{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.result{position:relative;aspect-ratio:1;border-radius:6px;overflow:hidden;border:2px solid transparent;background:#f0f1f5}.result.picked{border-color:var(--accent)}.result img{width:100%;height:100%;object-fit:contain;cursor:pointer;display:block}.result .pick{position:absolute;top:4px;right:4px;width:24px;height:24px;padding:0;justify-content:center;border-radius:50%;font-weight:700}.result.picked .pick{background:var(--accent);color:#fff;border-color:var(--accent)}.quickbuild{position:sticky;bottom:0;background:#fff;border:1px solid var(--accent);border-radius:var(--radius);padding:10px;display:flex;flex-direction:column;gap:8px;box-shadow:0 -4px 12px #0000000f}.checker{background-color:#fff;background-image:linear-gradient(45deg,#e6e8ec 25%,transparent 25%),linear-gradient(-45deg,#e6e8ec 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e6e8ec 75%),linear-gradient(-45deg,transparent 75%,#e6e8ec 75%);background-size:14px 14px;background-position:0 0,0 7px,7px -7px,-7px 0}.drop{border:2px dashed #c7cbd4;border-radius:var(--radius);padding:18px;text-align:center;color:var(--muted);cursor:pointer}.drop.on,.drop:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-2)}.lib-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.lib-grid.compact{grid-template-columns:repeat(4,1fr)}.lib-grid.compact .lib-meta,.lib-grid.compact .row{display:none}.lib-item{border:1px solid var(--line);border-radius:var(--radius);padding:6px;display:flex;flex-direction:column;gap:4px;min-width:0}.lib-item .thumb{aspect-ratio:1;border-radius:4px;display:flex;align-items:center;justify-content:center;overflow:hidden}.lib-item .thumb img{max-width:100%;max-height:100%}.lib-name{font-weight:600;font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lib-meta{font-size:11px;color:var(--muted)}.lib-item input{padding:4px;width:46px}.lib-item .row.tight span{font-size:11px;color:var(--muted)}.lib-item button{padding:3px 6px;font-size:12px}.toolbar{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;border-bottom:1px solid var(--line);background:#fff;gap:12px}.sheet-title{font-weight:600}.zoom{width:44px;text-align:center;color:var(--muted)}.canvas-scroll{flex:1;overflow:auto;padding:16px;position:relative;display:flex;flex-direction:column;gap:10px}.canvas-wrap{width:100%}.block-editor{width:100%;margin:0 auto}.empty-hint{color:var(--muted);text-align:center;padding:10px}.empty-hint.big{margin:auto;line-height:1.8;font-size:14px;max-width:520px}.settings,.inspector,.text-style{display:flex;flex-direction:column;gap:8px}.dpi{font-size:12px;padding:6px 8px;border-radius:6px}.dpi.ok{background:#ecfdf5;color:var(--ok)}.dpi.warn{background:#fffbeb;color:var(--warn)}.dpi.bad{background:#fef2f2;color:var(--bad)}.summary{display:flex;flex-direction:column;gap:6px}.summary>div{display:flex;justify-content:space-between;align-items:center;gap:8px}.summary span{color:var(--muted)}.summary input{width:100px;text-align:right}.export{display:flex;flex-direction:column;gap:6px}.export small{color:var(--muted)}.progress{position:relative;height:22px;background:#eef0f4;border-radius:6px;overflow:hidden}.progress div{position:absolute;inset:0 auto 0 0;background:#c7d2fe;transition:width .2s}.progress span{position:relative;font-size:11px;padding:0 8px;line-height:22px}.modal-back{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f121e80;display:flex;align-items:center;justify-content:center;z-index:50;padding:16px}.modal{background:#fff;border-radius:12px;width:min(640px,100%);max-height:90vh;overflow:auto;display:flex;flex-direction:column}.modal.wide{width:min(1000px,100%)}.modal-head{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--line)}.modal-head h3{margin:0;font-size:15px}.modal-foot{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid var(--line)}.adapt-body{display:grid;grid-template-columns:1fr 320px;min-height:0}.adapt-preview{display:flex;align-items:center;justify-content:center;padding:16px;min-height:420px}.adapt-preview canvas{max-width:100%;max-height:62vh}.adapt-controls{padding:14px;display:flex;flex-direction:column;gap:10px;border-left:1px solid var(--line)}.sub{display:flex;flex-direction:column;gap:6px;padding-left:22px}.sub small{color:var(--muted);font-size:11px}.seg{display:flex}.seg button{flex:1;border-radius:0;justify-content:center;font-size:12px}.seg button:first-child{border-radius:6px 0 0 6px}.seg button:last-child{border-radius:0 6px 6px 0}.seg button.on{background:var(--accent-2);border-color:var(--accent);color:var(--accent)}.ai-progress{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}.ai-progress .bar{height:6px;border-radius:3px;background:var(--line);overflow:hidden}.ai-progress .bar>div{height:100%;background:var(--accent);transition:width .2s}.ai-progress .bar>.indet{width:30%;animation:ai-indet 1.1s ease-in-out infinite}@keyframes ai-indet{0%{transform:translate(-100%)}to{transform:translate(340%)}}.tpl-list{display:flex;flex-direction:column;gap:6px}.tpl{display:flex;justify-content:space-between;align-items:center;padding:8px;border:1px solid var(--line);border-radius:var(--radius);cursor:pointer}.tpl.on{border-color:var(--accent);background:var(--accent-2)}.tpl small{display:block;color:var(--muted);font-size:11px}.newtpl{display:flex;flex-direction:column;gap:8px;padding:10px;background:#f8f9fb;border-radius:var(--radius)}.variants{display:flex;flex-direction:column;gap:12px}.table-wrap{overflow:auto;background:#fff;border:1px solid var(--line);border-radius:var(--radius)}table{border-collapse:collapse;width:100%}th,td{border-bottom:1px solid var(--line);padding:6px 8px;text-align:left;vertical-align:middle}th{font-size:11px;text-transform:uppercase;color:var(--muted);background:#fafbfc;position:sticky;top:0}td input{min-width:120px}.cell-img{width:64px;height:64px;padding:2px;justify-content:center}.cell-img img{max-width:100%;max-height:100%}.cell-img span{color:var(--accent);font-size:11px}@media (max-width: 1100px){.workspace{grid-template-columns:280px 1fr 260px}}@media (max-width: 860px){.workspace{grid-template-columns:1fr;overflow-y:auto}.left,.right{border:0;overflow:visible}.center{min-height:70vh}.adapt-body{grid-template-columns:1fr}.adapt-controls{border-left:0;border-top:1px solid var(--line)}}.ai-btn{background:linear-gradient(90deg,#6366f1,#a855f7);border:0;color:#fff;font-weight:600}.ai-btn:hover:not(:disabled){background:linear-gradient(90deg,#4f46e5,#9333ea)}.modal.aichat{width:min(1180px,100%);height:min(860px,92vh);max-height:92vh;overflow:hidden}.modal-head .title-input{max-width:320px;margin:0 auto 0 16px}.aichat-body{flex:1;display:grid;grid-template-columns:1fr 400px;min-height:0}.aichat-stage{display:flex;flex-direction:column;gap:10px;padding:14px;min-height:0}.aichat-preview{flex:1;min-height:0;border-radius:var(--radius);display:flex;align-items:center;justify-content:center;overflow:hidden;border:1px solid var(--line)}.aichat-preview>img{max-width:100%;max-height:100%;object-fit:contain}.aichat-start{background:#fff;padding:20px;border-radius:var(--radius);display:flex;flex-direction:column;gap:10px;align-items:center;text-align:center;max-width:420px;color:var(--muted);box-shadow:0 4px 16px #00000014}.aichat-start b{color:var(--text);font-size:15px}.versions{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px}.versions button{position:relative;width:64px;height:64px;padding:2px;flex-shrink:0;justify-content:center}.versions button.on{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent-2)}.versions img{max-width:100%;max-height:100%}.versions span{position:absolute;bottom:2px;right:4px;font-size:10px;background:#ffffffd9;border-radius:4px;padding:0 3px}.aichat-side{border-left:1px solid var(--line);display:flex;flex-direction:column;gap:8px;padding:12px;min-height:0}.aichat-msgs{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:8px;min-height:0}.msg{max-width:90%;display:flex;flex-direction:column;gap:6px}.msg-text{padding:8px 10px;border-radius:10px;white-space:pre-wrap;line-height:1.4}.msg.user{align-self:flex-end}.msg.user .msg-text{background:var(--accent);color:#fff}.msg.ai,.msg.info,.msg.error{align-self:flex-start}.msg.ai .msg-text,.msg.info .msg-text{background:#f1f2f6}.msg.error .msg-text{background:#fef2f2;color:var(--bad)}.msg.typing{color:var(--muted);font-style:italic;padding:4px 2px}.msg-img{width:180px;height:180px;padding:4px;justify-content:center}.msg-img img{max-width:100%;max-height:100%}.aichat-side .chips{max-height:96px;overflow-y:auto}.aichat-side .chip{white-space:normal;text-align:left}.aichat-input{display:flex;gap:8px;align-items:flex-end}.aichat-input textarea{resize:none}.result .pick.ai{top:auto;bottom:4px}.web-import{display:flex;flex-direction:column;gap:6px}.web-import small{color:var(--muted);font-size:11px}@media (max-width: 860px){.aichat-body{grid-template-columns:1fr;overflow-y:auto}.aichat-side{border-left:0;border-top:1px solid var(--line)}.aichat-preview{min-height:280px}}.hint-text{color:var(--muted);font-size:11px;line-height:1.4}.note.ok{color:var(--ok);background:#ecfdf5}.motifs{display:flex;flex-direction:column;gap:6px}.motif{display:flex;gap:8px;align-items:center;border:1px solid var(--line);border-radius:var(--radius);padding:6px}.motif.working{border-color:#c7d2fe;background:#f8f9ff}.motif.failed{opacity:.6}.motif-thumb{width:48px;height:48px;flex-shrink:0;border-radius:6px;display:flex;align-items:center;justify-content:center;overflow:hidden;color:var(--muted)}.motif-thumb img{max-width:100%;max-height:100%}.motif-info{display:flex;flex-direction:column;min-width:0}.motif-info b{font-size:12px}.motif-info small{color:var(--muted);font-size:11px;overflow:hidden;text-overflow:ellipsis}.motif.done .motif-info small{color:var(--ok)}.top-btn{background:#ffffff14;border:0;color:#e5e7f0}.top-btn:hover:not(:disabled){background:#ffffff29}.modal.usage,.modal.gallery{width:min(1180px,100%);height:min(860px,92vh);max-height:92vh}.usage-body{padding:14px 16px;display:flex;flex-direction:column;gap:12px;overflow:auto;min-height:0}.usage-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px}.ucard{border:1px solid var(--line);border-radius:var(--radius);padding:12px;display:flex;flex-direction:column;gap:4px}.ucard h5{margin:0;font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}.ucard .big{font-size:24px;font-weight:700}.ucard small{color:var(--muted)}.usub{display:flex;gap:12px;flex-wrap:wrap;font-size:12px;margin-top:4px}.table-wrap.tall{max-height:340px}tr.sel td{background:var(--accent-2)}tr.bad td{color:var(--bad)}td.ellip{max-width:320px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}.gcard{border:1px solid var(--line);border-radius:var(--radius);padding:8px;display:flex;flex-direction:column;gap:6px}.gthumb{height:280px;padding:0;justify-content:center;background:#8a8f98;overflow:hidden}.gthumb img{max-width:100%;max-height:100%}.gthumb span{color:#fff;font-size:12px}.gtitle:first-letter{text-transform:uppercase}.gtags{display:flex;flex-wrap:wrap;gap:4px}.tag{font-size:11px;padding:2px 6px;border-radius:999px;background:#f1f2f6;color:var(--muted)}.tag.dtf{background:#e0f2fe;color:#0369a1}.tag.uv{background:#f3e8ff;color:#7e22ce}.lightbox{position:fixed;top:0;right:0;bottom:0;left:0;z-index:60;background:#0a0c14d9;display:flex;align-items:center;justify-content:center;padding:16px;cursor:zoom-out}.lightbox img{max-width:100%;max-height:100%}.outline-box{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 8px;border:1px solid var(--line);border-radius:6px}.outline-box input[type=number]{width:60px}.modal.refdlg{width:min(1240px,100%);height:min(880px,94vh);max-height:94vh;overflow:hidden}.ref-body{flex:1;display:grid;grid-template-columns:1fr 380px;min-height:0}.ref-left{padding:14px;min-height:0;overflow:auto;display:flex}.ref-right{padding:14px;border-left:1px solid var(--line);display:flex;flex-direction:column;gap:8px;overflow:auto;min-height:0}.ref-source{display:flex;flex-direction:column;gap:10px;width:100%}.ref-results{grid-template-columns:repeat(5,1fr)}.ref-stage{flex:1;display:flex;align-items:center;justify-content:center;border-radius:var(--radius);padding:8px;min-height:0}.ref-imgwrap{position:relative;display:inline-block;max-height:100%}.ref-imgwrap img{display:block;max-width:100%;max-height:calc(94vh - 120px)}.ref-box{position:absolute;padding:0;border:2px dashed;background:#ffffff0d;border-radius:4px;opacity:.45}.ref-box.on{opacity:1;border-style:solid;background:#4f46e514}.ref-box span{position:absolute;top:-2px;left:-2px;color:#fff;font-size:11px;font-weight:700;padding:1px 5px;border-radius:4px 0}.ref-list{display:flex;flex-direction:column;gap:4px;max-height:280px;overflow:auto}.ref-item{align-items:flex-start;font-size:12px}.ref-num{color:#fff;font-size:10px;font-weight:700;border-radius:4px;padding:1px 5px;flex-shrink:0}.aivariant{display:flex;flex-direction:column;gap:6px;border:1px solid #c7d2fe;background:#f8f9ff;border-radius:var(--radius);padding:8px}.ai-variant-row{background:#f8f9ff;border:1px solid #c7d2fe;border-radius:var(--radius);padding:8px}.ai-variant-row input{width:180px}@media (max-width: 860px){.ref-body{grid-template-columns:1fr;overflow:auto}}.ref-id{color:var(--muted);font-style:normal;font-size:11px}.motif-info .redo{align-self:flex-start;padding:0 4px;font-size:11px}.span2{grid-column:1 / -1}.review{display:flex;flex-direction:column;gap:8px;border:1px solid #c7d2fe;background:#f8f9ff;border-radius:var(--radius);padding:10px}.review p{margin:0;line-height:1.4}.questions{display:flex;flex-direction:column;gap:6px}.questions label{color:var(--text)}.ref-thumb{width:52px;height:52px;padding:2px;justify-content:center}.ref-thumb img{max-width:100%;max-height:100%}.plan-list{display:flex;flex-direction:column;gap:4px;max-height:320px;overflow:auto}.plan-item{display:grid;grid-template-columns:120px 1fr auto;gap:4px;align-items:center}.plan-item select,.plan-item input{padding:4px 6px;font-size:12px}.login-wrap{min-height:100%;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#151a2d,#312e81);padding:16px}.login-card{background:#fff;border-radius:14px;padding:24px;width:min(380px,100%);display:flex;flex-direction:column;gap:12px;box-shadow:0 20px 60px #00000059}.login-card h2{margin:4px 0 0;font-size:18px}.brand.dark{color:var(--text)}.user-box{display:flex;align-items:center;gap:6px}.user-box .muted{color:#8b92ad}.top-link{color:#c7cbe0;padding:2px 6px}.top-link:hover:not(:disabled){background:#ffffff1a!important;color:#fff}.invite-form{display:flex;flex-direction:column;gap:8px;border:1px solid var(--line);border-radius:var(--radius);padding:12px}.invite-form input[type=email]{width:260px}.inline-label{flex-direction:row;align-items:center;color:var(--muted)}.inline-label input{width:80px}.invite-link{display:flex;align-items:center;justify-content:space-between;gap:8px;word-break:break-all}.small-num{width:90px}
