:root{color-scheme:dark;--bg:#171b1d;--ink:#ebeae5;--muted:#8b9496;--surface:#252a2c;--panel:#202527;--line:#5361664d;--stroke:#4e5a5f;--accent:#aebcd0;--photo:#f5f5f2;--shadow:0 18px 65px #080a0c55;--font:system-ui,-apple-system,"Helvetica Neue",sans-serif}
*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden}body{font-family:var(--font);background:var(--bg);color:var(--ink);font-size:14px}button,input,textarea,select{font:inherit}button{cursor:pointer;background:none;color:inherit;border:0}button:disabled{opacity:.42;cursor:default}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid #89aaff;outline-offset:2px}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;clip:rect(0,0,0,0);overflow:hidden}
#studio{height:100%;width:100%;position:relative;isolation:isolate}.topbar{position:absolute;z-index:20;top:0;left:0;right:0;height:65px;padding:0 26px;display:flex;justify-content:space-between;align-items:center;pointer-events:none}.topbar>*{pointer-events:auto}.brand{display:flex;align-items:baseline;gap:10px}.brand button:first-child{font-weight:800;letter-spacing:-.075em;font-size:21px;padding:5px 0;background:linear-gradient(110deg,#a3f2dd,#a9b9ee 48%,#df9bc9 76%,#efd7b1);background-size:230% 100%;color:transparent;background-clip:text;-webkit-background-clip:text;animation:shift 9s ease-in-out infinite}.brand button:last-child{font-size:10px;color:var(--muted);letter-spacing:.03em}.top-controls{display:flex;align-items:center;gap:13px}.top-controls>button:first-child{font-size:12px;color:var(--muted);padding:9px 12px;border-radius:22px;background:#10151669}.top-controls span{font-size:13px}.top-controls>button:last-child{width:33px;height:33px;border-radius:50%;background:#ffffff18;border:1px solid #7b858338;display:grid;place-items:center;overflow:hidden}.top-controls img{width:100%;height:100%;object-fit:cover}
#board{position:absolute;inset:0;overflow:hidden;background:radial-gradient(ellipse at 50% 49%,#22292a 0%,var(--bg) 74%);touch-action:none;cursor:grab}#board.grabbing{cursor:grabbing}#boardWorld{position:absolute;left:50%;top:50%;width:0;height:0;transform-origin:0 0;will-change:transform}#links{position:absolute;left:-5000px;top:-5000px;overflow:visible;pointer-events:none}#linkLines path{stroke:var(--stroke);stroke-width:1.2;opacity:.42;fill:none;stroke-linecap:round}#pictures{position:absolute;left:0;top:0}.picture{--w:220px;position:absolute;width:var(--w);transform:translate(-50%,-50%);touch-action:none;user-select:none;cursor:move;z-index:2;margin:0}.picture.hero{--w:410px;z-index:3}.picture.component{--w:180px}.picture-inner{background:var(--photo);padding:5px;box-shadow:0 10px 27px #02050740,0 2px 5px #02050720;border:1px solid #e4e5de;transition:box-shadow .2s ease,transform .2s ease;line-height:0}.picture img{display:block;width:100%;height:155px;object-fit:contain;pointer-events:none}.picture.hero img{height:270px}.picture.component img{height:123px}.picture.selected .picture-inner{box-shadow:0 0 0 1px #afd9e8,0 18px 40px #070b0e6c}.picture.dragging{z-index:10}.picture figcaption{font-size:11px;color:var(--muted);font-weight:500;line-height:1.25;text-align:center;letter-spacing:.025em;margin:10px -5px 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.picture.hero figcaption{font-size:12px;color:#bec6c6;margin-top:12px}.picture:hover .picture-inner{box-shadow:0 12px 38px #02050760}#emptyState{position:absolute;top:35%;left:50%;transform:translate(-50%,-50%);text-align:center;pointer-events:none;max-width:85vw;transition:opacity .2s}#emptyState h1{font-size:clamp(24px,3.1vw,42px);font-weight:450;letter-spacing:-.045em;margin:0 0 11px}#emptyState p{color:var(--muted);font-size:12px;margin:0}#boardHelp{position:absolute;bottom:14px;left:17px;font-size:11px;color:#718080}
.prompt-card{position:absolute;z-index:15;bottom:max(22px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(730px,calc(100vw - 34px));min-height:63px;display:flex;gap:10px;align-items:end;padding:10px 11px 10px 10px;background:#262c2ce9;backdrop-filter:blur(25px);border:1px solid #56606059;border-radius:18px;box-shadow:0 7px 40px #0004}.prompt-card #uploadButton{width:39px;height:39px;border-radius:13px;color:#d8dedc;font-size:24px;font-weight:300;flex-shrink:0}.prompt-card textarea{flex:1;resize:none;border:0;background:transparent;color:var(--ink);min-width:80px;max-height:170px;overflow-y:auto;outline:0;padding:11px 2px 5px;font-size:14px}.prompt-card textarea::placeholder{color:#8b9998}select,input{background:#ffffff08;color:var(--ink);border:1px solid #6e77764b;border-radius:9px;padding:9px;min-width:0}select option{color:#1b2021;background:#eef1ef}.prompt-card select{width:132px;flex-shrink:0;border:0;color:#9aabaa;font-size:11px;background:transparent;text-overflow:ellipsis;align-self:end;margin-bottom:7px}.create-button{flex-shrink:0;padding:11px 15px;background:#d5e4e0;color:#1b2729;border-radius:13px;font-size:12px;font-weight:700}.create-button span{font-size:17px;margin-left:6px}
.photo-actions{position:absolute;z-index:14;bottom:105px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 30px);display:flex;gap:6px;align-items:center;justify-content:center;background:#273031ee;border:1px solid #71808038;box-shadow:0 8px 25px #0002;backdrop-filter:blur(18px);padding:5px 6px;border-radius:28px}.photo-actions span{font-size:11px;color:#a8b4b4;max-width:145px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0 8px}.photo-actions button{padding:9px 11px;font-size:12px;border-radius:22px;white-space:nowrap}.photo-actions button:hover{background:#ffffff17}.photo-actions button:nth-of-type(2),.photo-actions button:nth-of-type(3){background:#d2e0dc;color:#203033}
.job-status{position:absolute;z-index:30;top:74px;left:50%;transform:translateX(-50%);max-width:min(490px,calc(100vw - 24px));min-width:320px;display:flex;gap:11px;align-items:center;padding:10px 13px;border-radius:17px;background:#252c2be9;border:1px solid #73817b5c;box-shadow:var(--shadow);backdrop-filter:blur(25px)}.job-orb{width:17px;height:17px;flex:none;border-radius:50%;background:conic-gradient(#89e8cb,#9db5ea,#d3a5db,#89e8cb);animation:spin 2s linear infinite}.job-body{min-width:0;flex:1;display:flex;flex-direction:column;gap:5px}.job-body strong{font-size:12px}.job-body>span{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.job-track{height:2px;background:#6a787652;overflow:hidden;border-radius:3px}.job-track span{display:block;height:100%;width:0;background:linear-gradient(90deg,#99dac4,#a1aaf1,#e2b0c8);transition:width .4s}#jobTimer{font-size:11px;color:#a5b4b0;font-variant-numeric:tabular-nums}#stopJob{font-size:11px;color:#b9d7cd;padding:7px}
.drawer{position:absolute;z-index:25;top:73px;right:18px;bottom:14px;width:min(410px,calc(100vw - 28px));background:#222929fa;border:1px solid #65706d4b;border-radius:17px;box-shadow:var(--shadow);backdrop-filter:blur(24px);padding:21px 18px;overflow:auto}.drawer-top,.modal-title{display:flex;align-items:center;justify-content:space-between}.drawer h2,.modal-card h2{font-size:16px;margin:0;font-weight:570;letter-spacing:-.025em}.drawer-top button,.modal-title button{font-size:23px;color:var(--muted);padding:0 5px}.drawer-tabs{display:flex;gap:7px;flex-wrap:wrap;margin:18px 0}.drawer-tabs button{font-size:11px;border:1px solid #6f808047;border-radius:18px;padding:7px 10px;color:var(--muted)}.drawer-tabs button.active{background:#d8e7e2;color:#243030;border-color:transparent}.tab-content{display:flex;flex-direction:column;gap:13px}.stack{display:flex;flex-direction:column;gap:11px}.stack label,.tab-content>label,.modal-card>label{display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:12px}.stack label input,.stack label select,.tab-content>label input,.tab-content>label select,.modal-card>label select{color:var(--ink);font-size:13px}.stack .check-row{flex-direction:row;align-items:center}.check-row input{width:auto}.button-row{display:flex;flex-wrap:wrap;gap:7px}.button-row button,.subtle-primary{font-size:12px;padding:9px 11px;background:#ffffff10;border:1px solid #717d785c;border-radius:10px}.button-row .subtle-primary,.subtle-primary{background:#d3e2dc;color:#273333;border:0}#providerInfo,.quiet{font-size:12px;color:var(--muted);line-height:1.55;margin:0}#providerResult{min-height:30px}.drawer pre{white-space:pre-wrap;font-size:11px;line-height:1.6;color:#cbd5d1;max-height:60vh;overflow:auto;background:#141c1d;border-radius:10px;padding:12px}#projectsList button{border:1px solid #6978753c;text-align:left;border-radius:9px;padding:12px;color:var(--ink);font-size:12px}#projectsList button small{display:block;color:var(--muted);margin-top:5px}.source-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.source-grid button{min-width:0;padding:0;text-align:left}.source-grid img{background:#eceeec;object-fit:contain;width:100%;height:95px;border:3px solid #eee;border-radius:2px}.source-grid span{display:block;font-size:10px;margin-top:5px;color:var(--muted)}
.modal-scrim{position:absolute;z-index:50;inset:0;background:#070a0c9e;display:grid;place-items:center;padding:18px}.modal-card{background:#252d2c;border:1px solid #68797466;border-radius:18px;padding:22px;width:min(510px,100%);max-height:85vh;overflow:auto;display:flex;flex-direction:column;gap:18px;box-shadow:var(--shadow)}.modal-card.small{width:min(400px,100%)}.modal-card>label select{width:100%}.modal-actions{justify-content:flex-end}.chips{display:flex;gap:7px;flex-wrap:wrap;max-height:145px;overflow:auto}.chips span{padding:7px 9px;border:1px solid #67797450;border-radius:15px;color:#aab7b5;font-size:11px}.auth-switch{display:flex;gap:7px}.auth-switch button{padding:7px 10px;border-radius:17px;font-size:12px;color:var(--muted)}.auth-switch button.active{background:#d3e2dc;color:#273333}.error{color:#f4aeb2;font-size:12px;min-height:13px}.toast{position:absolute;bottom:95px;right:22px;z-index:99;border-radius:12px;padding:11px 14px;background:#293634;color:#e7f0ea;box-shadow:var(--shadow);border:1px solid #77948b6b;max-width:min(440px,calc(100vw - 30px));font-size:12px}
body[data-theme=warm]{--bg:#29221e;--surface:#3e312a;--ink:#f3ebdf;--muted:#c3b5a6;--stroke:#b89d796c;--photo:#f7f0e4}body[data-theme=warm] #board{background:radial-gradient(ellipse at center,#372c25,#211b18)}body[data-theme=light]{--bg:#e9e9e4;--ink:#262e2e;--muted:#657371;--surface:#fafbf9;--stroke:#55656066;--photo:#fff}body[data-theme=light] #board{background:radial-gradient(ellipse at center,#f2f2ed,#e3e6e1)}body[data-theme=light] .picture.hero figcaption{color:#50625e}
@keyframes shift{50%{background-position:100% 50%}}@keyframes spin{to{transform:rotate(360deg)}}
@media(max-width:700px){.topbar{padding:0 15px}.photo-actions{bottom:112px;max-width:96vw;flex-wrap:wrap;border-radius:16px}.photo-actions span{display:none}.photo-actions button{padding:7px 8px;font-size:11px}.prompt-card{width:calc(100vw - 20px);border-radius:14px;gap:4px}.prompt-card select{width:78px;font-size:10px}.prompt-card textarea{font-size:13px}.create-button{padding:10px}.drawer{right:8px;top:62px;bottom:8px}.picture.hero{--w:340px}}@media(prefers-reduced-motion:reduce){.brand button:first-child,.job-orb{animation:none}}
/* v0.2.1 — planned photo slots and collections, no full-screen controls */
#boardWorld.camera-follow{transition:transform .85s cubic-bezier(.21,.67,.16,1)}
.picture.placeholder .picture-inner{background:#f6f6f3;border:1px dashed #9ca8a7;height:140px;display:grid;place-items:center;box-shadow:0 7px 19px #0003}
.picture.placeholder .blank-image{display:flex;align-items:center;justify-content:center;flex-direction:column;color:#b2bbba;font-size:28px;font-weight:250;gap:6px}
.picture.placeholder .blank-image small{font-size:10px;color:#8c9a98;font-weight:450}
.picture.placeholder.failed .picture-inner{border:2px dashed #c78d87}
.picture.placeholder.generating .picture-inner{border:2px solid #b7c8f1;box-shadow:0 0 16px #85aeb76a;animation:slot-breathe 2s ease infinite}
@keyframes slot-breathe{50%{box-shadow:0 0 6px #c8a4e18c}}
.pack-shelf{position:absolute;z-index:12;top:74px;left:19px;display:flex;flex-direction:column;gap:14px;max-height:55vh;overflow:auto;padding:8px 13px 8px 4px;scrollbar-width:thin;pointer-events:auto}
.envelope{position:relative;display:flex;flex-direction:column;justify-content:end;align-items:start;gap:4px;text-align:left;width:116px;min-height:77px;padding:12px 11px 9px;border:1px solid #81948b64;border-radius:3px 9px 9px 9px;background:linear-gradient(149deg,#697e75 0%,#46584f 47%,#2d3938 100%);box-shadow:0 7px 24px #0007;transform:rotate(-2deg);transition:transform .18s ease}
.envelope:nth-child(2n){transform:rotate(2deg)}.envelope:hover{transform:translateX(4px) rotate(0deg)}.envelope:before{content:'';position:absolute;top:-7px;left:0;width:43px;height:10px;background:#687d73;border:1px solid #81948b64;border-bottom:0;border-radius:4px 8px 0 0}
.envelope:after{content:'';position:absolute;top:18px;left:8px;right:8px;height:20px;border-top:1px solid #ffffff21;transform:skewY(7deg);pointer-events:none}
.envelope strong{font-size:11px;color:#f5f7f2;font-weight:550;max-width:90px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;z-index:1}.envelope small{font-size:10px;color:#d8e4dfad;z-index:1}.envelope img{width:34px;height:29px;position:absolute;right:7px;top:8px;object-fit:cover;border:2px solid #f1f0eb;transform:rotate(7deg)}
.queue-rest{position:absolute;z-index:14;bottom:122px;left:50%;transform:translateX(-50%);display:flex;gap:13px;align-items:center;padding:8px 13px;border:1px solid #9ba8a84d;border-radius:18px;background:#252e2dea;box-shadow:var(--shadow);font-size:12px;white-space:nowrap}
.queue-rest button{padding:7px 11px;border-radius:12px;background:#dde8e3;color:#243330;font-size:11px}
.queue-rest #retryFailed{background:#bdccca}
.follow-toggle{display:flex;gap:4px;align-items:center;color:#c2d1cc;font-size:11px;white-space:nowrap}.follow-toggle input{accent-color:#9ed9c5}
.parts-planner{width:min(640px,100%);max-height:88vh}.parts-planner input[type=search],#imageSearch{width:100%;font-size:12px;padding:11px;border-radius:10px;background:#151b1ba6;border:1px solid #65757050;color:var(--ink)}
.parts-checklist{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;overflow-y:auto;max-height:36vh;min-height:100px;padding:4px}
.part-row{display:flex;align-items:center;gap:7px;min-width:0;padding:7px 6px;border-radius:7px;border:1px solid #62746c29;font-size:12px;cursor:pointer}.part-row input{accent-color:#bdd8d2}.part-row span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.part-row small{font-size:9px;color:var(--muted);margin-left:auto}
.pack-list{display:flex;flex-direction:column;gap:7px}.pack-line{padding:12px 10px;background:#53665b33;text-align:left;font-size:12px;border:1px solid #8fa19643;border-radius:10px}
.pack-items{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;max-height:38vh;overflow:auto;margin:12px 0}.pack-item{display:flex;flex-direction:column;gap:4px;align-items:center;min-width:0;padding:5px;background:#71817b17;border:1px solid #798b8266;border-radius:5px}.pack-item img,.pack-item span{width:100%;height:55px;object-fit:contain;background:#ebece8;color:#afbbb6;display:grid;place-items:center}.pack-item small{font-size:10px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:100%}
.mesh-task{display:flex;flex-direction:column;gap:8px;padding:10px;border-bottom:1px solid #67796d47;font-size:11px}.mesh-task a{color:#9dcbd0}.mesh-task button{align-self:start;background:#e1e5de;color:#26322e;padding:5px 10px;border-radius:8px}
@media(max-width:700px){.pack-shelf{top:65px;left:6px;max-height:31vh}.envelope{width:77px;min-height:53px}.envelope img{width:18px;height:18px}.envelope strong{font-size:9px}.parts-checklist{grid-template-columns:1fr}.queue-rest{bottom:150px;max-width:96vw;font-size:10px}}

/* v0.2.3: quiet layout menu and visibility toggles on photo envelopes */
.arrange-tools{position:absolute;z-index:13;top:78px;right:22px;display:flex;flex-direction:column;align-items:end;gap:5px}
.arrange-tools>button{font-size:12px;padding:9px 13px;background:#202928d9;border:1px solid #80908955;border-radius:24px;color:#c8d1ce;box-shadow:0 6px 20px #0003;backdrop-filter:blur(18px)}
.arrange-menu{display:flex;flex-direction:column;min-width:135px;background:#202928f3;border:1px solid #80908955;border-radius:12px;padding:5px;box-shadow:0 8px 22px #0005}
.arrange-menu button{text-align:left;padding:9px 10px;border-radius:7px;font-size:12px}.arrange-menu button:hover{background:#ffffff13}
.envelope-wrap{position:relative;width:120px;flex:none}.envelope-wrap .envelope{width:100%}.envelope-wrap .eye-button{position:absolute;z-index:2;top:4px;left:4px;width:28px;height:25px;display:grid;place-items:center;background:#172320df;border:1px solid #d8e2d044;border-radius:7px;color:#e8f4ed;font-size:13px}
.envelope-wrap.is-hidden .envelope{filter:grayscale(.7);opacity:.48}.envelope-wrap .eye-button[aria-pressed="true"]{background:#52625b;color:#fff}
.custom-part{display:flex;gap:6px}.custom-part input{flex:1;min-width:0;font-size:12px}.custom-part button{border:1px solid #71808070;padding:7px 13px;border-radius:10px;font-size:12px;background:#e2e6df17}
@media(max-width:700px){.arrange-tools{top:70px;right:10px}.envelope-wrap{width:82px}.envelope-wrap .eye-button{width:21px;height:21px;font-size:11px}}

.photo-actions #sceneKind{min-width:85px;max-width:112px;border:1px solid #ffffff25;border-radius:18px;padding:6px 7px;color:#d1ddda;font-size:11px;background:#ffffff0b}
.pack-line-row{display:flex;align-items:center;gap:7px}.pack-line-row .pack-line{flex:1}.pack-list-eye{padding:8px;border:1px solid #81998a69;border-radius:9px;color:var(--muted);font-size:11px}
/* v0.2.4 — object intelligence, unobtrusive queue, undo and group selection */
.canvas-marquee{position:absolute;z-index:8;border:1px solid #bddacb;background:#a2d6ba15;pointer-events:none;box-shadow:0 0 0 1px #13292588 inset}
.selection-bar{position:absolute;z-index:25;top:135px;left:50%;transform:translateX(-50%);display:flex;flex-wrap:wrap;align-items:center;gap:7px;padding:9px 11px;background:#26322ff5;border:1px solid #85a39965;border-radius:14px;box-shadow:0 8px 28px #0008;font-size:12px;max-width:min(90vw,800px)}
.selection-bar input{width:130px;padding:7px;background:#17211e;color:#ecf5ef;border:1px solid #728b7f5d;border-radius:7px}.selection-bar select{max-width:150px;background:#17211e;color:#ecf5ef;border:1px solid #728b7f5d;border-radius:7px;padding:7px}.selection-bar button,.history-bar button{background:#eef5f0;color:#23352f;padding:7px 9px;border-radius:8px;font-size:12px}.selection-bar button:disabled,.history-bar button:disabled{opacity:.4}
.history-bar{position:absolute;top:36px;left:50%;transform:translateX(-50%);z-index:13;display:flex;gap:6px;align-items:center;background:#202928d9;border:1px solid #7891884b;padding:4px;border-radius:20px;backdrop-filter:blur(14px)}.history-bar span{max-width:175px;color:#98aba5;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0 8px}
.picture.selected .picture-inner{outline:2px solid #a0d9c4;outline-offset:4px}
.queue-rest{top:135px;right:20px;bottom:auto;left:auto;transform:none;max-width:305px;white-space:normal;flex-wrap:wrap;gap:8px;justify-content:space-between;font-size:11px;z-index:11}.queue-rest button{padding:5px 8px;font-size:10px}
.analysis-object{display:flex;justify-content:space-between;align-items:start;gap:8px;border-bottom:1px solid #7b90883c;padding:8px 0}.analysis-object strong{font-size:12px;font-weight:550}.analysis-object small{font-size:10px;color:var(--muted);text-align:right;max-width:180px}
.photo-actions #analyzePhoto{background:#b7d3c7;color:#193127}
.quiet-danger{color:#ffb3a5!important}
@media(max-width:700px){.history-bar{top:65px;left:48%}.history-bar span{max-width:70px}.selection-bar{top:112px;gap:5px;max-width:98vw}.selection-bar input{width:84px}.queue-rest{top:190px;right:10px;max-width:190px;z-index:11}}
