*{box-sizing:border-box} :root{--ink:#263d33;--green:#2d5947;--soft:#eaf0e9;--line:#e4e7df;--muted:#7b857c;--paper:#f7f7f2;--warm:#e9e2d4;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--paper);font-synthesis:none}body{margin:0;font-size:14px;line-height:1.5}button,input,textarea{font:inherit}button,a,input,textarea{-webkit-tap-highlight-color:transparent}button,a{touch-action:manipulation}button{cursor:pointer}button:disabled{opacity:.5;cursor:default}button{color:inherit}button,a{outline-offset:4px}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #689174}a{color:inherit;text-decoration:none}svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.svg-defs{position:absolute;width:0;height:0;overflow:hidden}[hidden]{display:none!important}h1,h2,h3,p{margin:0}h2{font-size:16px;font-weight:650}h3{font-size:15px}small{font-size:12px;color:var(--muted)}.muted{color:var(--muted);margin-bottom:16px}.topbar{height:64px;padding:0 32px;display:flex;align-items:center;justify-content:space-between;background:#fff;border-bottom:1px solid var(--line);gap:12px}.brand{display:flex;align-items:center;gap:10px;font-size:15px}.brandmark{display:grid;place-items:center;width:33px;height:33px;background:var(--green);color:white;border-radius:10px;font-size:17px;font-family:serif}.brand-divider{color:#b9c1b7;margin:0 12px}.brand strong{font-size:14px;font-weight:500}.account-link{font-size:12px;color:var(--muted);max-width:100px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.shell{max-width:780px;margin:auto;padding:25px 24px 170px}.page-intro{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 22px}.eyebrow{font-size:12px;color:var(--muted);margin-bottom:5px;letter-spacing:1px}h1{font-size:25px;line-height:1.5;letter-spacing:-.7px;font-weight:650}.small-pill{font-size:11px;padding:5px 10px;border:1px solid #dce4d8;border-radius:99px;white-space:nowrap;color:#697d69}.step{background:white;border:1px solid var(--line);border-radius:17px;padding:18px;margin-bottom:13px}.section-line{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:13px}.section-line h2{display:flex;align-items:center;gap:8px}.step-num{font-size:11px;display:inline-grid;place-items:center;width:21px;height:21px;border-radius:7px;background:var(--soft);color:var(--green);margin-right:7px;font-weight:650}.section-line h2 .step-num{margin-right:0}.hint{font-size:11px;font-weight:400;color:var(--muted)}.text-button{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:40px;padding:6px 3px;border:0;background:none;color:var(--green);font-size:12px}.text-button svg{width:16px;height:16px}.product-select{width:100%;display:flex;align-items:center;gap:13px;border:1px dashed #cad7c6;border-radius:12px;background:#f9fbf7;text-align:left;padding:13px}.product-select.has-product{border-style:solid;background:#fff}.product-select strong{display:block;font-size:14px;overflow-wrap:anywhere}.product-select small{display:block;margin-top:2px}.product-placeholder,.product-select img{width:54px;height:54px;border-radius:10px;object-fit:cover;display:grid;place-items:center;background:#eaf0e6;color:#799174;flex-shrink:0}.chevron{margin-left:auto;width:18px;color:#8b9789}.reference-strip{display:flex;gap:8px;overflow-x:auto;padding-top:11px}.ref-choice{position:relative;flex-shrink:0;width:49px;height:49px;padding:0;border:2px solid transparent;border-radius:8px;background:#f1f4ed}.ref-choice img{width:100%;height:100%;object-fit:cover;border-radius:6px;opacity:.5}.ref-choice[aria-pressed=true]{border-color:var(--green)}.ref-choice[aria-pressed=true] img{opacity:1}.ref-choice .ref-check{position:absolute;right:-3px;bottom:-3px;border-radius:99px;background:var(--green);color:white;display:grid;place-items:center;width:16px;height:16px;border:2px solid white}.ref-check svg{width:10px;height:10px;stroke-width:3}.ref-caption{align-self:center;font-size:10px;color:var(--muted);min-width:50px;max-width:70px}.mode-tabs{display:grid;grid-template-columns:repeat(3,1fr);background:#f2f4ef;border-radius:10px;padding:4px;gap:4px;margin-bottom:13px}.mode-tabs button{border:0;border-radius:7px;background:none;min-height:40px;font-size:14px;color:#748170}.mode-tabs button.active{background:white;box-shadow:0 2px 5px #233e3210;color:var(--green);font-weight:650}.effects-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.effect-card{position:relative;text-align:left;padding:0 0 9px;border:2px solid transparent;background:#f5f5f0;border-radius:10px;overflow:hidden}.effect-card img{width:100%;height:110px;object-fit:cover;display:block}.effect-card strong{display:block;font-size:12px;padding:8px 9px 0;font-weight:550}.effect-card.active{border-color:var(--green);background:#f0f5ed}.effect-check{position:absolute;right:7px;top:7px;display:grid;place-items:center;width:21px;height:21px;border-radius:50%;background:#ffffffb3;border:1px solid #ffffffa8;color:transparent}.active .effect-check{background:var(--green);border-color:var(--green);color:white}.effect-check svg{width:14px;height:14px;stroke-width:2.5}.example-note{text-align:right;font-size:10px;color:#92998e;margin-top:7px}.poster-title{display:flex;align-items:center;gap:10px;font-size:12px;margin-top:12px}.poster-title input{flex:1;width:0}.output-step>h2{margin-bottom:14px}.platform-tabs{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:14px}.platform-tabs button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;border:1px solid var(--line);border-radius:9px;background:white;font-size:12px}.platform-tabs button.active{border-color:#52735a;background:#f1f6ee}.platform-dot{width:16px;height:16px;border-radius:5px;position:relative;display:inline-block}.moments{background:conic-gradient(#55996c,#78ad70,#e3d488,#8faeb6,#599d7a,#55996c);border-radius:50%}.moments:after{content:'';position:absolute;inset:5px;background:white;border-radius:50%}.redbook{background:#dc646b}.redbook:after{content:'书';position:absolute;color:white;font-size:10px;inset:0;text-align:center;line-height:16px}.douyin{background:#39413e}.douyin:after{content:'♪';position:absolute;color:white;font-size:15px;inset:0;text-align:center;line-height:16px}.quantity-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-bottom:16px;border-bottom:1px solid #f0f1ec}.quantity-row>span{font-size:12px}.quantity-row>div{display:flex;gap:8px}.quantity-row button{border:1px solid var(--line);background:#fff;border-radius:8px;min-width:49px;min-height:40px;font-size:12px}.quantity-row button.active{border-color:var(--green);background:var(--soft);color:var(--green);font-weight:650}.copy-toggle{display:flex;position:relative;align-items:center;justify-content:space-between;gap:12px;padding-top:14px;cursor:pointer}.copy-toggle strong{font-size:13px;font-weight:500;display:block}.copy-toggle small{display:block;font-size:10px;margin-top:3px}.copy-toggle input{position:absolute;right:0;opacity:0;width:40px;height:28px;z-index:2;cursor:pointer}.switch{position:relative;width:38px;height:22px;background:#d4dbd0;border-radius:99px;flex-shrink:0}.switch:before{content:'';position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:white;box-shadow:0 1px 3px #0001;transition:transform .18s}.copy-toggle input:checked+.switch{background:var(--green)}.copy-toggle input:checked+.switch:before{transform:translateX(16px)}.copy-toggle input:focus-visible+.switch{outline:2px solid #689174;outline-offset:4px}.extra{margin-top:14px;border-top:1px solid #f0f1ec;padding-top:11px}.extra summary{font-size:11px;color:#7e897c;cursor:pointer;min-height:28px;list-style:none;display:flex;align-items:center;gap:7px}.extra summary:before{content:'＋';font-size:15px}.extra[open] summary:before{content:'−'}.extra summary span{font-size:10px;background:#f3f4ef;padding:1px 5px;border-radius:4px}.extra textarea{margin-top:6px}.history-section{padding:10px 2px}.history-section h2{font-size:15px}.empty-note{text-align:center;color:#96a08f;padding:24px 10px;font-size:12px}.history-list{display:grid;gap:10px}.history-card{display:flex;gap:12px;align-items:center;width:100%;text-align:left;border:1px solid var(--line);background:white;border-radius:12px;padding:11px}.history-cover{height:58px;width:58px;object-fit:cover;border-radius:8px;background:#eef2e9;display:grid;place-items:center;color:#91a289;flex-shrink:0}.history-info{flex:1;min-width:0}.history-info strong{display:block;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-info small{font-size:10px;display:block;margin-top:3px}.history-state{font-size:11px;white-space:nowrap;color:#678264}.history-state.error{color:#aa7250}.button{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid transparent;min-height:46px;padding:10px 17px;border-radius:11px;font-weight:550;font-size:13px;cursor:pointer}.primary{background:var(--green);color:#fff}.secondary{background:white;border-color:var(--line);color:var(--green)}.quiet{background:none;color:var(--muted)}.full{width:100%}.small{padding:8px 12px;min-height:41px;font-size:12px}.more{display:block;margin:12px auto;background:none;border-color:var(--line);font-size:12px;color:var(--muted);min-height:40px}.create-dock{position:fixed;bottom:67px;left:0;right:0;background:#ffffffee;backdrop-filter:blur(16px);border-top:1px solid var(--line);padding:12px 24px 8px;z-index:5}.dock-inner{display:flex;align-items:center;justify-content:space-between;max-width:732px;margin:auto;gap:12px}.dock-inner strong{display:block;font-size:13px;font-weight:550}.dock-inner small{display:block;font-size:10px;margin-top:3px}.generate{min-width:152px}.generate svg{width:18px;height:18px}.inline-status{color:#a15b3d;font-size:12px;overflow-wrap:anywhere}.inline-status:empty{display:none}.create-dock .inline-status{max-width:732px;margin:6px auto 0}.bottom-nav{position:fixed;bottom:0;left:0;right:0;height:67px;padding:5px 0 calc(5px + env(safe-area-inset-bottom));box-sizing:content-box;background:#fff;border-top:1px solid #edf0e7;display:flex;justify-content:center;gap:110px;z-index:6}.bottom-nav button{min-width:70px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:0;background:none;color:#9ca694;font-size:10px}.bottom-nav button.active{color:var(--green)}.bottom-nav button svg{width:21px;height:21px}.products-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:13px}.product-card{border:1px solid var(--line);border-radius:13px;overflow:hidden;background:white;position:relative}.product-card .product-cover{width:100%;aspect-ratio:1;object-fit:cover;background:#e9eee4;display:grid;place-items:center;color:#9fae95;border:0;cursor:pointer}.product-cover svg{width:40px;height:40px}.product-card .product-info{padding:11px}.product-info strong{display:block;font-size:13px;overflow-wrap:anywhere}.product-info small{display:block;font-size:10px;margin-top:4px}.product-card .product-edit{position:absolute;right:7px;top:7px;border:0;border-radius:99px;background:#fffffff0;min-width:44px;height:36px;font-size:13px;padding:0 8px}.product-card .use-product{margin-top:9px;font-size:11px;min-height:35px;padding:5px 10px;width:100%}.products-empty{grid-column:1/-1;border:1px dashed #cbd8c6;border-radius:14px;padding:35px;text-align:center;color:var(--muted)}.products-empty h2{color:var(--ink);margin-bottom:8px}.products-empty .button{margin-top:20px}.loading{padding:50px 0;text-align:center;color:var(--muted)}.auth-empty{padding:65px 0;text-align:center}.empty-art{display:grid;place-items:center;width:80px;height:80px;border-radius:25px;background:#e8eedf;color:#7b9972;margin:0 auto 25px}.empty-art svg{width:38px;height:38px}.auth-empty h1{font-size:25px}.auth-empty p{margin:13px 0 25px;color:var(--muted)}.auth-empty .button{margin:auto 4px;max-width:300px}.sheet{border:0;padding:0;position:fixed;inset:auto 0 0;margin:0 auto;width:min(100%,640px);max-width:100%;max-height:92dvh;border-radius:22px 22px 0 0;color:var(--ink);background:#fafbf7;box-shadow:0 -10px 80px #15241622;overflow-y:auto;overscroll-behavior:contain}.sheet::backdrop,.viewer::backdrop{background:#15281e75;backdrop-filter:blur(3px)}body:has(dialog[open]){overflow:hidden}.sheet-head{position:sticky;top:0;z-index:3;background:#fafbf7f5;backdrop-filter:blur(12px);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 20px;border-bottom:1px solid var(--line)}.sheet-head h2{font-size:17px}.sheet-head small{font-size:10px;display:block;margin-top:3px}.icon-button{display:inline-grid;place-items:center;width:40px;height:40px;flex-shrink:0;border:0;background:#eef1e9;border-radius:50%;color:#6c7e68}.icon-button svg{width:19px;height:19px}.sheet-body{padding:20px 20px calc(22px + env(safe-area-inset-bottom))}.sheet-footer{position:sticky;bottom:0;padding:13px 20px calc(13px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fafbf7f5;z-index:3;backdrop-filter:blur(10px)}.field{display:block;margin-bottom:17px;font-size:13px;font-weight:550}.field>small{display:block;margin:4px 0 10px;font-weight:400;font-size:11px}.field>input,.field>textarea{margin-top:8px}.field .hint{margin-left:7px}.field input,.field textarea,input,textarea{padding:12px;border-radius:9px;border:1px solid #dfe5d8;background:white;min-height:44px;color:var(--ink);width:100%;font-size:16px;max-width:100%}textarea{resize:vertical;min-height:70px}.field textarea{font-size:14px;line-height:1.6}.upload-button{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;border:1px dashed #c0d0b8;background:#f0f4e9;border-radius:12px;padding:20px;cursor:pointer}.upload-button svg{width:24px;height:24px;color:#718f65}.upload-button strong{font-size:12px;font-weight:500}.upload-button small{font-size:10px}.upload-button:focus-within{outline:2px solid #689174}.upload-previews{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:10px}.upload-item{position:relative;aspect-ratio:1;border-radius:10px;background:#e9eee2}.upload-item img{width:100%;height:100%;border-radius:10px;object-fit:cover}.remove-upload{position:absolute;right:-4px;top:-4px;width:30px;height:30px;border-radius:50%;background:#fff;border:1px solid var(--line);font-size:20px;line-height:20px;color:#8e6c5b}.points-field{margin-top:21px}.danger-text{border:0;color:#b26a4e;background:none;padding:10px 0;font-size:12px;min-height:40px;margin-top:9px}.picker-list{display:grid;gap:9px;margin-bottom:15px}.picker-list .product-select{border-style:solid}.result-body{padding-top:14px}.job-progress{padding:11px 13px;border:1px solid #dce5d3;background:#edf3e6;border-radius:10px;color:#607f53;font-size:12px;margin-bottom:11px}.job-progress.running:before{content:'';display:inline-block;width:8px;height:8px;background:#82a36d;border-radius:50%;margin-right:7px;animation:pulse 1.5s infinite}.selection-line{display:flex;align-items:center;gap:12px;font-size:11px;color:var(--muted);margin-bottom:10px}.selection-line #stopJob,.selection-line #resumeJob{margin-left:auto}.results-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:11px}.result-card{border-radius:12px;border:1px solid var(--line);overflow:hidden;background:white;position:relative}.result-image{width:100%;aspect-ratio:3/4;background:#edf0e7;position:relative;display:grid;place-items:center;padding:0;border:0;color:#8a9f7b}.result-image img{width:100%;height:100%;position:absolute;inset:0;object-fit:contain}.frame-placeholder{text-align:center;padding:15px;font-size:12px;overflow-wrap:anywhere}.frame-placeholder small{display:block;margin-top:6px;font-size:10px;color:#a18b76}.frame-placeholder svg{width:30px;height:30px;margin-bottom:8px}.result-select{position:absolute;top:8px;right:8px;width:35px;height:35px;padding:6px;border:1px solid #ccd7c7;background:#fff;border-radius:50%;color:transparent;z-index:1}.result-select.selected{background:var(--green);border-color:white;color:white}.result-select svg{width:21px;height:21px;stroke-width:2.4}.result-bottom{display:flex;justify-content:space-between;align-items:center;padding:4px 9px;gap:8px;font-size:10px;color:var(--muted);min-height:38px}.result-bottom .text-button{font-size:10px;min-height:34px}.copy-card{padding:14px;border:1px solid var(--line);background:#fff;border-radius:12px;margin-top:17px}.copy-card .section-line{margin-bottom:5px}.copy-card textarea{font-size:14px;line-height:1.8;padding:3px 0;border:0;min-height:150px;background:transparent}.result-actions{display:grid;grid-template-columns:1fr 1.7fr;gap:10px}.result-actions svg{width:17px;height:17px}.result-body .inline-status{margin-top:13px}.viewer{position:fixed;border:0;border-radius:16px;background:#17251d;color:white;padding:0;max-width:94vw;width:600px;max-height:94dvh;overflow:auto}.viewer img{display:block;max-width:100%;max-height:73dvh;object-fit:contain;margin:auto;width:100%;min-height:150px}.viewer-close{position:absolute;top:10px;right:10px;z-index:1;background:#ffffffe6}.viewer-actions{display:flex;gap:10px;justify-content:center;padding:14px}.viewer p{font-size:11px;text-align:center;margin-bottom:15px;color:#c0c9b7}.adjust-options{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:15px 0 20px}.adjust-options button.active{border-color:var(--green);background:var(--soft)}.download-links{display:grid;grid-template-columns:1fr 1fr;gap:10px}.download-links a{font-size:12px;min-height:44px;padding:11px;border-radius:9px;background:white;border:1px solid var(--line);text-align:center}.sheet-body>#zipDownload{margin:10px 0 18px}.toast{position:fixed;bottom:190px;left:50%;transform:translateX(-50%) translateY(8px);background:#263d33ed;color:white;padding:11px 18px;border-radius:12px;font-size:12px;z-index:100;opacity:0;pointer-events:none;transition:opacity .15s,transform .15s;max-width:90vw;width:max-content}.toast.visible{opacity:1;transform:translateX(-50%) translateY(0)}@keyframes pulse{50%{opacity:.35}}@media(min-width:900px){.shell{padding-top:32px}.step{padding:20px}.effects-grid .effect-card img{height:130px}.bottom-nav{height:61px;gap:160px}.create-dock{bottom:71px}.sheet{inset:50% 0 auto;transform:translateY(-50%);border-radius:20px;max-height:88dvh}.results-sheet{width:700px}.sheet-body{padding:22px}.viewer{width:650px}}@media(max-width:600px){.topbar{height:55px;padding:0 17px}.brand{font-size:13px;gap:8px}.brandmark{width:29px;height:29px;border-radius:8px;font-size:15px}.brand-divider{margin:0 8px}.brand strong{font-size:12px}.account-link{font-size:11px}.shell{padding:20px 14px calc(180px + env(safe-area-inset-bottom))}.page-intro{margin-bottom:17px}.eyebrow{font-size:10px}.page-intro h1{font-size:21px}.small-pill{display:none}.step{padding:14px;border-radius:14px;margin-bottom:11px}.section-line{margin-bottom:9px}.section-line h2{font-size:14px}.hint{font-size:10px}.product-select{padding:10px}.product-placeholder,.product-select img{width:46px;height:46px}.product-select strong{font-size:13px}.product-select small{font-size:10px}.mode-tabs{margin-bottom:10px}.mode-tabs button{min-height:38px;font-size:12px}.effects-grid{grid-template-columns:repeat(2,1fr);gap:8px}.effect-card{padding-bottom:7px;border-radius:9px}.effect-card img{height:96px}.effect-card strong{font-size:12px;padding:7px 9px 0}.output-step>h2{font-size:14px;margin-bottom:12px}.platform-tabs{gap:7px;margin-bottom:13px}.platform-tabs button{min-height:42px;font-size:11px}.quantity-row{padding-bottom:13px}.quantity-row>div{gap:6px}.quantity-row button{min-width:46px;min-height:39px;font-size:11px}.quantity-row>span{font-size:11px}.copy-toggle{padding-top:12px}.copy-toggle strong{font-size:12px}.create-dock{bottom:calc(65px + env(safe-area-inset-bottom));padding:11px 16px 9px}.dock-inner strong{font-size:12px}.dock-inner small{font-size:10px}.generate{min-width:132px;font-size:12px;min-height:46px;padding:10px 13px}.bottom-nav{height:55px;padding-top:5px;padding-bottom:calc(5px + env(safe-area-inset-bottom));gap:100px}.products-grid{grid-template-columns:repeat(2,1fr);gap:11px}.product-info strong{font-size:12px}.products-empty{padding:30px 15px}.sheet-head{padding:13px 16px}.sheet-body{padding:17px 16px calc(18px + env(safe-area-inset-bottom))}.sheet-footer{padding-left:16px;padding-right:16px}.sheet-head h2{font-size:16px}.result-bottom{padding:4px 7px;font-size:9px}.result-bottom .text-button{font-size:9px}.viewer-actions .button{font-size:12px}.sheet{max-height:94dvh}.auth-empty h1{font-size:23px}.toast{bottom:190px}}@media(prefers-reduced-motion:reduce){*,*:before{animation:none!important;transition:none!important}}@media(max-width:350px){.hint{max-width:120px;text-align:right}.quantity-row>div{gap:4px}.quantity-row button{min-width:39px}.page-intro h1{font-size:19px}.brand>span:last-child{font-size:12px}.brand-divider{margin:0 5px}.generate{min-width:116px;padding:10px}.dock-inner strong{font-size:11px}}
.history-list{grid-template-columns:minmax(0,1fr)}.history-card{min-width:0}.merchant-entry{white-space:nowrap;color:#2d5947;font-weight:600}

.quantity-row>div{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));flex:1}.quantity-row>span{white-space:nowrap}.quantity-row button{min-width:0;padding-left:4px;padding-right:4px}

.result-image-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}

.image-download-status{position:fixed;left:50%;bottom:calc(16px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:99;max-width:calc(100vw - 32px);padding:5px 10px;border-radius:6px;background:#243932;color:#fff;font-size:.75rem;line-height:1.4;pointer-events:none;white-space:nowrap}

.bulk-download-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.45rem .75rem;margin-top:.55rem;padding:.45rem .6rem;border:1px solid #dce4d8;border-radius:.5rem;background:#f1f5ee;font-size:.82rem}
.bulk-download-bar label{display:inline-flex;gap:.35rem;align-items:center;min-height:2rem;color:inherit}
.bulk-download-bar button,.bulk-toggle{font:inherit;font-size:.82rem;font-weight:600;padding:.4rem .7rem;border-radius:.4rem}
.bulk-download-bar button{background:#2a483b;color:#fff;border:1px solid #2a483b}
.bulk-download-bar button:disabled{opacity:.48}
.bulk-download-bar small{flex:1 0 100%;font-size:.73rem;color:#4f5f52}
.bulk-download-bar[hidden],.bulk-choice[hidden],.bulk-toggle[hidden],.bulk-download-bar small[hidden]{display:none!important}
.bulk-download-bar input,.bulk-choice input{width:1rem;height:1rem;margin:0;accent-color:#365e46;cursor:pointer}
.bulk-photo{position:relative;min-width:0}
.bulk-choice{position:absolute;z-index:2;top:.35rem;left:.35rem;display:grid;place-items:center;width:2rem;height:2rem;border:1px solid #dce4d8;border-radius:.4rem;background:#fff;color:#263d33;cursor:pointer}
.bulk-choice:focus-within{outline:2px solid #31543f;outline-offset:1px}

.bulk-toggle{border:1px solid #becdbd;background:#fff;color:#2a483b;white-space:nowrap}


/* Compact home and material library. */
.studio-controls{max-width:740px;margin-inline:auto;display:grid;gap:12px}
.studio-controls .step{margin:0;padding:15px 18px;border-radius:18px}
.studio-controls h2{margin:0 0 10px;font-size:16px}
.studio-pair,.library-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.studio-reference .reference-strip{display:flex;flex-wrap:nowrap;align-items:center;overflow:auto;padding-block:3px;margin-top:10px}
.studio-reference .reference-strip[hidden]{display:none}
.actions-pair .button{min-height:41px;text-align:center;justify-content:center;position:relative}
.file-action,.file-choice{cursor:pointer}
.file-action input,.upload-button input{position:absolute;inset:0;margin:0;padding:0;border:0;opacity:0;width:100%;height:100%;min-height:0;cursor:pointer}
.photo-sources { display: none; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 4px; }
@media (display-mode: standalone), (display-mode: minimal-ui), (pointer: coarse) {
 .photo-sources { display: flex; }
}
.photo-sources .system-file { width: 76px; min-height: 36px; padding: 0; margin: 0; border: 0; background: transparent; font-size: 0; cursor: pointer; }
.system-file::file-selector-button, .paste-photo { min-height: 36px; margin: 0; padding: 0 8px; border: 0; background: transparent; color: var(--green); font: 13px/1.4 system-ui,sans-serif; cursor: pointer; }
.native-main-label.file-action { display: flex; align-items: center; gap: 3px; }
.native-main-label.file-action input, .native-main-label.upload-button input { position: static; width: 70px; height: 30px; min-height: 0; padding: 0; margin: 0; opacity: 1; font-size: 0; background: transparent; }
.native-main-file::file-selector-button { margin: 0; min-height: 30px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--green); font: 12px/1.3 system-ui,sans-serif; cursor: pointer; }
.alternate-source { display: inline-flex; align-items: center; }
.alternate-source.album-source { position: relative; min-height: 36px; padding: 0 8px; color: var(--green); font-size: 13px; cursor: pointer; }
.photo-sources .album-source input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.album-source:focus-within { outline: 2px solid var(--green); outline-offset: 1px; }
.system-file:focus-visible, .paste-photo:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.file-action:focus-within{outline:2px solid #456456;outline-offset:2px}
.studio-count{min-width:0;background:#f4f7f1;border:1px solid #dde6da;border-radius:13px;padding:10px 12px}
.studio-count h2{text-align:center;margin:0 0 6px}
.stepper{display:grid;grid-template-columns:minmax(25px,1fr) minmax(20px,1fr) minmax(25px,1fr);align-items:center;justify-items:center;gap:3px}
.stepper button{width:100%;min-height:35px;border:0;border-radius:8px;background:#e8eee4;color:inherit;font-size:19px;font-weight:700}
.stepper button:disabled{opacity:.4}
.stepper output{font-size:17px;font-weight:700}
.studio-presets .studio-pair>div{min-width:0}
.preset-tile{display:block;width:100%;overflow:hidden;border:1px solid #d8e0d5;border-radius:12px;background:#fafbf7;color:inherit;text-align:left;padding:0}
.preset-tile:focus-visible,.preset-tile[aria-pressed="true"]{outline:2px solid #496851;outline-offset:-2px}
.preset-art{display:grid;place-items:center;aspect-ratio:16/9;overflow:hidden;background:linear-gradient(140deg,#e2ebe0,#eeeadc);color:#546f5c;position:relative}
.preset-art img{display:block;width:100%;height:100%;object-fit:cover;position:absolute;inset:0}
.preset-art svg{width:29px;height:29px}
.preset-name{display:flex;align-items:center;justify-content:space-between;gap:5px;min-height:33px;padding:6px 9px;font-size:13px;font-weight:700}
.preset-name>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.preset-name small{white-space:nowrap;color:#58695d;font-size:10px}
.library-head{margin-bottom:12px}
.library-head h1{font-size:clamp(22px,4vw,30px);margin:0}
.library-tabs{margin-bottom:12px}
.library-grid{max-width:820px;margin-inline:auto;align-items:start}
.library-grid .product-card{position:relative;min-width:0}
.library-grid .product-cover{aspect-ratio:16/10}
.library-grid .product-info{padding:8px 10px}
.library-grid .product-info strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.library-grid .products-empty,.library-grid .empty-note{grid-column:1/-1}
.library-grid .preset-tile{margin:0}
.material-card{position:relative;min-width:0}
.preset-picker-grid{margin-top:10px}
.material-preview{width:min(120px,50%);aspect-ratio:4/3;object-fit:cover;border-radius:8px}
.field select{width:100%;padding:9px 10px;border:1px solid #d8e0d5;border-radius:9px;color:inherit;background:#fbfcf8;font:inherit}
.material-filters{display:flex;gap:6px;max-width:820px;margin:8px auto 10px}
.material-filters[hidden],.material-filters select[hidden]{display:none}
.material-filters select{flex:1;min-width:0;min-height:40px;padding:5px;border:1px solid var(--line);border-radius:8px;background:#fbfcf8;color:var(--ink);font:inherit}
.studio-controls ~ .history-section{max-width:740px;margin-inline:auto}
.history-list img{object-fit:cover}
@media(max-width:420px){
 .studio-controls .step{padding:12px}
 .studio-pair,.library-grid{gap:9px}
 .studio-count{padding:8px}
}

.manage-links{display:flex;align-items:center;gap:8px}
.manage-tabs{grid-template-columns:repeat(auto-fit,minmax(65px,1fr))}
.manage-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.manage-tools label,.manage-row{display:flex;align-items:center;gap:9px}
.manage-tools input,.manage-row input{width:18px;height:18px;min-height:0;accent-color:var(--green);margin:0;flex:none}
.manage-items,.manage-item-buttons{display:grid;gap:8px}
.manage-row{padding:8px 10px;min-height:42px;border:1px solid var(--line);border-radius:8px;background:white;cursor:pointer}
.manage-row strong{font-weight:550;display:block;overflow-wrap:anywhere}
.manage-row small{display:block}
.manage-buttons{display:flex;flex-wrap:wrap;gap:8px}
.manage-buttons button{flex:1 1 auto}
.danger-action{color:#9c543b}

.generating-wave{display:inline-flex;white-space:nowrap}
@media (prefers-reduced-motion:no-preference){
 .generating-wave>span{animation:generating-letter 1.85s ease-in-out infinite}
 .generating-wave>span:nth-child(2){animation-delay:175ms}
 .generating-wave>span:nth-child(3){animation-delay:350ms}
 .generating-wave>span:nth-child(4){animation-delay:525ms}
}
@keyframes generating-letter{0%,34%,100%{transform:translateY(0)}17%{transform:translateY(-2.6px)}}
/* Keep the card and action bar in place while the browser decodes each layer. */
.result-image[data-preview] { overflow: hidden; }
.result-image[data-preview] img { opacity: 0; }
.result-image[data-preview].is-ready img { opacity: 1; }
.result-image[data-preview][aria-busy="true"]::before,
.viewer-stage[aria-busy="true"] .viewer-layers:empty::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 25%, rgba(255,255,255,.32) 48%, transparent 72%);
  background-size: 240% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .result-image[data-preview][aria-busy="true"]::before,
  .viewer-stage[aria-busy="true"] .viewer-layers:empty::before {
    animation: media-shimmer 1.8s ease-in-out infinite;
  }
  @keyframes media-shimmer { from { background-position: 100% 0; } to { background-position: -75% 0; } }
}
.thumb-retry {
  position: absolute; top: 38%; left: 50%; transform: translate(-50%,-50%);
  border: 1px solid #d5ddcf; border-radius: 16px; padding: 6px 10px;
  white-space: nowrap; font: inherit; font-size: 12px; background: #fff; color: #345645;
}
.viewer-stage {
  position: relative; width: 100%; aspect-ratio: 3/4; max-height: 72dvh; overflow: hidden;
  background: #233329; touch-action: pan-y pinch-zoom; user-select: none;
}
.viewer .viewer-layers, .viewer .viewer-layers img { position: absolute; inset: 0; width: 100%; height: 100%; }
.viewer .viewer-layers img { min-height: 0; max-height: none; object-fit: contain; pointer-events: none; }
.viewer-close { z-index: 3; }
.viewer-position, .viewer-hint, .viewer-retry, .viewer-prev, .viewer-next {
  position: absolute; border: 0; border-radius: 18px; color: white; background: rgba(22,33,27,.78); font: inherit;
}
.viewer-position { top: 12px; left: 12px; padding: 4px 9px; font-size: 12px; pointer-events: none; }
.viewer-hint, .viewer-retry { left: 50%; bottom: 14px; transform: translateX(-50%); padding: 7px 13px; font-size: 12px; }
.viewer-prev, .viewer-next { top: 50%; transform: translateY(-50%); width: 36px; height: 44px; font-size: 25px; }
.viewer-prev { left: 8px; }
.viewer-next { right: 8px; }
.viewer-prev:disabled, .viewer-next:disabled { visibility: hidden; }
@media (hover: none) and (pointer: coarse) {
  .viewer-prev:not(:focus-visible), .viewer-next:not(:focus-visible) { opacity: 0; pointer-events: none; }
}

/* The gallery footer stays in reach as the user moves between group and selected-image actions. */
.results-sheet .result-actions {
  display: flex; align-items: center; gap: clamp(6px, 2vw, 12px);
  padding-block: 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: #fafbf7;
}
.result-actions .button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 7px 9px; white-space: nowrap; }
.result-actions #resultMenu { flex: 0 0 44px; }
.result-select-all { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding-right: 6px; font-size: 14px; cursor: pointer; }
.result-select-all input, .results-grid .bulk-choice input { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 0; accent-color: var(--green); cursor: pointer; }
.result-feedback { position: absolute; bottom: 100%; left: 12px; right: 12px; padding: 7px 11px; border-radius: 9px; background: #263d33; color: white; text-align: center; }
.result-body .inline-status:empty { display: none; }
.results-sheet .result-body { padding-top: 9px; }
.results-grid .bulk-choice, .frame-delete {
  position: absolute; z-index: 2; top: 0; width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center; border: 0; background: transparent; cursor: pointer;
}
.results-grid .bulk-choice { left: 0; }
.results-grid .bulk-choice:focus-within { outline: 0; }
.results-grid .bulk-choice input:focus-visible, .frame-delete:focus-visible svg {
  outline: 2px solid var(--green); outline-offset: 2px;
}
.frame-delete { right: 0; color: #a74832; }
.frame-delete svg { width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: #fffdf6f2; stroke-width: 1.8; }
.delete-result-dialog {
  position: fixed; inset: 0; margin: auto; width: min(300px, calc(100vw - 40px));
  border: 1px solid var(--line); border-radius: 16px; background: #fafbf7; color: var(--ink); padding: 22px 17px 16px;
}
.delete-result-dialog::backdrop { background: #18261e73; }
.delete-result-dialog h2 { margin: 0 0 18px; font-size: 17px; text-align: center; }
.delete-result-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.delete-result-actions .button { min-height: 44px; }
#confirmResultDelete { background: #a4483a; color: white; }

/* Match the gallery footer on small screens and keep the working button legible. */
.result-actions .result-save-group { flex: 1 1 0; min-width: 0; display: flex; }
.result-save-group.has-manual [data-result-save] { border-radius: 10px 0 0 10px; }
.manual-download { display: grid; place-items: center; width: 34px; border: 0; border-left: 1px solid #ffffff55; border-radius: 0 10px 10px 0; background: var(--green); color: white; padding: 0; }
.manual-download svg { width: 15px; height: 15px; }
[data-result-save] { position: relative; overflow: hidden; font-variant-numeric: tabular-nums; }
[data-result-save][data-phase="busy"]:disabled { opacity: 1; }
[data-result-save][data-phase="busy"] svg { display: none; }
[data-result-save][data-phase="busy"]::before, [data-guide-wait][aria-busy="true"]::before {
  content: ""; height: 14px; width: 14px; flex: none; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: spin-download .8s linear infinite;
}
[data-result-save][data-phase="busy"]::after, [data-result-save][data-phase="sent"]::after {
  content: ""; position: absolute; inset: auto 0 0; height: 3px; background: #bad9c8;
  transform-origin: left; transform: scaleX(var(--download-progress)); transition: transform .16s;
}
.guided-download {
  position: fixed; inset: 0; margin: auto; padding: 17px; width: min(310px, calc(100vw - 32px));
  background: #fafbf7; color: var(--ink); border: 1px solid var(--line); border-radius: 16px;
}
.guided-download::backdrop { background: #18261e73; }
.guided-download header { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.guided-download .icon-button { width: 44px; height: 44px; }
.guided-download p { margin: 3px 0 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.guided-action .button { width: 100%; min-height: 46px; text-decoration: none; font-variant-numeric: tabular-nums; }
.guided-action [aria-busy="true"] { opacity: 1; }
@keyframes spin-download { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  [data-result-save]::before, .guided-action [data-guide-wait]::before { animation: none; }
  [data-result-save]::after { transition: none; }
}

/* The material library shares a compact toolbar across all three tabs. */
.shell:has(#productsPage:not([hidden])) { max-width: 1060px; }
.library-toolbar { margin-bottom: 14px; padding: 11px 12px; background: #fff; border: 1px solid var(--line); border-radius: 13px; }
.library-tools { display: flex; gap: 8px; align-items: center; }
.library-tools #newProduct { margin-inline-start: auto; }
.library-tools .library-tabs { display: flex; flex: none; margin: 0; padding: 3px; gap: 2px; }
.library-tabs button { min-height: 34px; padding: 0 13px; white-space: nowrap; font-size: 13px; }
.library-tools .button { flex: none; min-width: 0; min-height: 37px; padding: 0 11px; white-space: nowrap; }
.library-toolbar .material-filters { max-width: none; margin: 7px 0 0; }
.scene-filters { display: flex; align-items: center; flex-wrap: nowrap; gap: 7px; min-width: 0; margin-top: 7px; }
.scene-style-scroll { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 3px 2px; user-select: none; }
.scene-style-scroll::-webkit-scrollbar { display: none; }
.scene-filters > .scene-chip { flex: none; }
.scene-chip { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: 0 0 auto; min-height: 34px; padding: 0 10px; white-space: nowrap; border: 1px solid #dce3da; border-radius: 8px; background: #fafcf9; color: #405348; font-size: 13px; }
.scene-chip[aria-pressed="true"] { color: #24553e; background: #e9f2e9; border-color: #a5bbab; font-weight: 650; }
.scene-chip:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.scene-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; max-width: none; }
.scene-card { overflow: hidden; background: white; border: 1px solid #dce3d9; border-radius: 12px; }
.scene-card .preset-tile { border: 0; border-radius: 0; background: transparent; }
.scene-card .preset-art { aspect-ratio: 3 / 4; }
.scene-card .preset-name { align-items: start; flex-direction: column; gap: 2px; padding: 8px 10px; }
.scene-card .preset-name > span { max-width: 100%; }
.scene-card .preset-name small { font-size: 11px; font-weight: 450; }
.scene-heart { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; color: white; }
.scene-heart svg { width: 24px; height: 24px; fill: none; stroke-width: 1.9; filter: drop-shadow(0 1px 2px #192d21) drop-shadow(0 0 1px #192d21); }
.scene-heart[aria-pressed="true"] svg { fill: currentColor; }
.scene-heart:focus-visible { outline: 2px solid #fff; outline-offset: -5px; border-radius: 8px; }
.scene-viewer { position: fixed; inset: 0; margin: auto; padding: 0; width: min(710px,94vw); max-width: 100%; height: min(880px,90dvh); max-height: 100dvh; border: 1px solid #314239; border-radius: 16px; background: #18251e; color: #f4f6ee; overflow: hidden; }
.scene-viewer[open] { display: flex; flex-direction: column; }
.scene-viewer::backdrop { background: #17251dba; }
.scene-viewer header, .scene-viewer footer { display: flex; align-items: center; justify-content: space-between; flex: none; gap: 10px; padding: 11px 16px; }
.scene-viewer h2 { margin: 0 0 2px; font-size: 17px; }
.scene-viewer small, .scene-viewer output { color: #becec1; font-size: 12px; }
.scene-viewer output { font-variant-numeric: tabular-nums; }
.scene-close, .scene-view-prev, .scene-view-next { display: grid; place-items: center; width: 40px; height: 42px; border: 0; border-radius: 8px; background: #22352ce3; color: white; padding: 0; }
.scene-close { background: transparent; }
.scene-view-stage { position: relative; isolation: isolate; min-height: 0; flex: 1; display: grid; place-items: center; overflow: hidden; background: #111b16; touch-action: pan-y pinch-zoom; user-select: none; }
.scene-view-image, .scene-view-image img { display: block; width: 100%; height: 100%; }
.scene-view-image { position: absolute; inset: 0; }
.scene-view-image img { object-fit: contain; pointer-events: none; }
.scene-view-feedback { position: relative; max-width: 75%; display: grid; place-items: center; gap: 8px; padding: 0 8px; text-align: center; color: #dde8dc; font-size: 13px; }
.scene-view-feedback button { padding: 6px 10px; border: 1px solid #8ca294; border-radius: 7px; color: white; background: transparent; }
.scene-view-prev, .scene-view-next { position: absolute; top: 50%; transform: translateY(-50%); font: 26px/1 sans-serif; }
.scene-view-prev { left: 7px; }
.scene-view-next { right: 7px; }
.scene-view-stage button:disabled { visibility: hidden; }
#sceneViewerUse { min-height: 39px; background: #e7eee3; color: #244735; }
@media (max-width: 720px) {
 .scene-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
 .library-toolbar { padding: 8px; margin-bottom: 9px; }
 .library-tools { gap: 5px; }
 .library-tools .library-tabs button { font-size: 12px; padding: 0 8px; }
 .library-tools .button { padding: 0 8px; font-size: 12px; }
 .scene-chip { min-height: 36px; }
 .scene-viewer { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
 .scene-viewer header { padding-top: max(10px,env(safe-area-inset-top)); }
 .scene-viewer footer { padding-bottom: max(11px,env(safe-area-inset-bottom)); }
}
@media (max-width: 370px) {
 .library-tools .library-tabs button, .library-tools .button { padding-inline: 5px; }
}
