:root{font-family:Arial,"PingFang SC","Microsoft YaHei",sans-serif;color:#28291f;background:#dcdcc6;color-scheme:light;--cream:#fffdeb;--muted:#86836d;--orange:#ffb181;--yellow:#ffdc6a;--line:#e8e5cd}
*{box-sizing:border-box}html,body{margin:0;height:100%;overflow:hidden}button,input{font:inherit;color:inherit}button{border:0;background:none;cursor:pointer}button:disabled{opacity:.35;cursor:default}button,input,a,summary{-webkit-tap-highlight-color:transparent}button:focus,input:focus,a:focus,summary:focus{outline:none}[hidden]{display:none!important}h1,h2,p{margin:0}a{color:inherit;text-decoration:none}canvas{display:block}button,summary{touch-action:manipulation}.app-shell{width:100%;max-width:480px;height:100vh;margin:auto;background:var(--cream);display:flex;flex-direction:column;overflow:hidden;position:relative}.topbar{padding:18px 20px 0;display:flex;align-items:center;justify-content:space-between;flex:none}.brand{display:flex;align-items:center;grid-gap:9px;gap:9px}.brand-mark{width:32px;height:32px}.brand strong{font-size:23px;letter-spacing:-1px}.module-tag{font-size:11px;padding:7px 12px;border-radius:12px;background:#fff1af;color:#7a755b}.brand-description{font-size:11px;line-height:1.5;color:#77745d;margin:8px 20px 13px}.progress{display:flex;align-items:center;grid-gap:8px;gap:8px;padding:0 20px 14px;border-bottom:1px solid var(--line);flex:none}.progress span{display:flex;align-items:center;grid-gap:5px;gap:5px;font-size:10px;color:#99947c;white-space:nowrap}.progress b{display:grid;place-items:center;width:21px;height:21px;border-radius:50%;background:#eeecd5;font-size:11px;font-weight:400}.progress .active{color:#28291f;font-weight:700}.progress .active b{color:var(--cream);background:#292a22}.progress .done b{background:var(--yellow);color:#292a22}.progress i{flex:1;height:1px;background:var(--line)}main{flex:1;min-height:0;display:flex}.page{flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;padding:16px 18px 16px;grid-gap:12px;gap:12px;position:relative}.page-heading{display:flex;align-items:center;justify-content:space-between;grid-gap:8px;gap:8px;flex:none;min-height:30px}.page-heading h1{font-size:21px;letter-spacing:-.7px;line-height:1.3}.eyebrow{display:none}.text-button{font-size:12px;color:#78745d;padding:8px 0;white-space:nowrap}.welcome{display:flex;flex:1;min-height:0;flex-direction:column;grid-gap:15px;gap:15px}.welcome-heading h1{font-size:34px;line-height:1.25;letter-spacing:-1.2px}.sample-spread{position:relative;display:grid;grid-template-columns:1fr 1fr;grid-gap:12px;gap:12px;flex:1;min-height:70px;max-height:340px;overflow:hidden}.sample-paper{height:100%;width:100%;min-width:0;min-height:0;border-radius:20px;object-fit:contain}.sample-label,.sample-caption{position:absolute;bottom:10px;border-radius:14px;background:#fff8d8e8;font-size:10px;padding:6px 9px;color:#786e50;pointer-events:none}.sample-label{left:8px}.sample-caption{right:8px}.upload-card{flex:none;background:var(--orange);border-radius:20px}.upload-button{width:100%;display:flex;grid-gap:12px;gap:12px;align-items:center;text-align:left;padding:17px 15px}.add-photo{background:#fff4cc;border-radius:50%;display:grid;place-items:center;width:42px;height:42px;font-size:27px;flex:none}.upload-button strong{font-size:16px;display:block}.upload-button small{font-size:10px;color:#805e40;display:block;margin-top:6px}.upload-arrow{margin-left:auto;font-size:23px}.demo-button{align-self:center;border-radius:22px;background:#fff1b1;padding:11px 23px;font-size:12px}.privacy{font-size:10px;color:#918c74;text-align:center;margin-top:auto;line-height:1.5}
#portraitEditor{flex:1;min-height:0;display:flex;flex-direction:column;grid-gap:11px;gap:11px}.editor-stage{position:relative;flex:1;min-height:60px;overflow:hidden;border-radius:20px;background:#efefdf}.editor-stage canvas{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:var(--editor-size,100%);height:var(--editor-size,100%);touch-action:none}.checker{background-image:conic-gradient(#e6e7d7 25%,transparent 0 50%,#e6e7d7 0 75%,transparent 0);background-size:18px 18px}.canvas-tag{position:absolute;left:10px;top:10px;font-size:10px;border-radius:14px;padding:6px 8px;background:#fffdebdc;color:#86806b;pointer-events:none}.brush-cursor{position:absolute;outline:1px solid #222;border:1px solid white;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none}.stage-caption{display:flex;align-items:center;justify-content:space-between;grid-gap:5px;gap:5px;font-size:10px;color:var(--muted);flex:none}.zoom-buttons{display:flex;align-items:center;grid-gap:7px;gap:7px}.zoom-buttons button{width:31px;height:31px;background:#eeeccf;border-radius:50%;font-size:19px}.zoom-buttons span{font-size:10px;min-width:31px;text-align:center}.tools{display:flex;grid-gap:5px;gap:5px;background:#efedd5;border-radius:13px;padding:4px;flex:none}.tools button{flex:1;font-size:13px;min-height:37px;border-radius:10px;display:flex;justify-content:center;align-items:center;grid-gap:8px;gap:8px;color:#8c866d}.tools button.selected{background:var(--yellow);color:#302c20}.tools button span{font-size:19px}.editor-settings{border-radius:16px;background:#f4f0d9;padding:12px 13px;flex:none}.slider-control{display:flex;align-items:center;grid-gap:12px;gap:12px;min-height:31px}.slider-control label{font-size:12px;white-space:nowrap}.slider-control input{flex:1;min-width:0}.slider-control output{font-size:11px;color:#827a5c;width:34px;text-align:right}input[type=range]{accent-color:#d7864e;height:24px;margin:0;cursor:pointer}.edit-actions{display:flex;align-items:center;justify-content:flex-end;min-height:30px;margin-top:4px}.edit-actions .text-button{padding:5px 0;font-size:11px}.history{display:flex;grid-gap:10px;gap:10px;margin-right:auto}.history button{font-size:11px;padding:6px 0}.refine{font-size:11px;color:var(--muted);flex:none}.refine summary{cursor:pointer;padding:3px 0}.refine-panel{position:absolute;left:18px;right:18px;bottom:80px;padding:18px;background:var(--cream);border-radius:18px;box-shadow:0 0 0 100vmax #24251f55;z-index:12}.inline-controls{display:flex;align-items:center;grid-gap:12px;gap:12px;font-size:12px}.chip-row{display:flex;grid-gap:6px;gap:6px}.chip{background:#eeead2;border-radius:9px;padding:9px;font-size:12px}.chip.selected{background:var(--orange)}.action-row{display:flex;grid-gap:18px;gap:18px;margin:10px 0}.button{border:0;border-radius:15px;width:100%;min-height:46px;background:#eeecd6;font-size:14px;display:flex;align-items:center;justify-content:center;grid-gap:13px;gap:13px;font-weight:700}.button-primary{background:#28291f;color:var(--cream)}.button span{font-size:21px}.bottom-action{flex:none;margin-top:auto}.notice{position:absolute;bottom:73px;left:18px;right:18px;padding:9px 12px;font-size:11px;line-height:1.5;background:#ffefc7;border-radius:12px;z-index:7;pointer-events:none;box-shadow:0 3px 15px #74632a15}.notice:empty{display:none}.notice.error{background:#ffdfd3}
.preview-column{background:#ffd0a0;border-radius:20px;padding:12px;display:flex;grid-gap:18px;gap:18px;align-items:center;flex:none}.preview-stage{width:120px;height:120px;width:clamp(88px,17vh,160px);height:clamp(88px,17vh,160px);border-radius:15px;overflow:hidden;position:relative;flex:none}.preview-stage canvas{width:100%;height:100%}.preview-toolbar{display:flex;flex-direction:column;grid-gap:14px;gap:14px;min-width:0}.preview-toolbar strong{font-size:14px;line-height:1.5}.compact{display:flex;background:#fff0c6;border-radius:20px;padding:3px;align-self:flex-start}.compact button{font-size:11px;padding:8px 11px;border-radius:18px}.compact button.selected{background:var(--yellow)}.focus-button{position:absolute;right:6px;bottom:6px;background:#fffbedeb;border-radius:15px;font-size:10px;padding:8px 10px}.design-controls{flex:1;min-height:0;display:flex;flex-direction:column;grid-gap:10px;gap:10px}.section-head{display:flex;align-items:center;justify-content:space-between;flex:none}.section-head h2{font-size:13px}.section-head>span{font-size:10px;color:#989079}.template-cards{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));grid-gap:8px;gap:8px;flex:none}.template-card{padding:0;min-width:0;position:relative}.template-thumb{display:block;width:100%;height:60px;aspect-ratio:1;border:2px solid transparent;border-radius:13px;overflow:hidden}.template-thumb canvas{width:100%;height:100%;object-fit:cover}.template-card strong{font-size:10px;font-weight:400;display:block;margin-top:7px;white-space:nowrap;color:#868069}.template-card.selected .template-thumb{border-color:#e78e59}.template-card.selected strong{color:#322d1c;font-weight:700}.template-card.selected:after{content:'✓';position:absolute;top:4px;right:4px;border-radius:50%;background:#ffbc8f;width:16px;height:16px;line-height:16px;font-size:10px}.adjustments{flex:1;min-height:0;display:flex;flex-direction:column;border-radius:18px;background:#f3efd7;padding:10px 13px}.parameter-tabs{display:flex;grid-gap:3px;gap:3px;flex:none;padding-bottom:9px;border-bottom:1px solid #e4dec1}.parameter-tabs button{flex:1;font-size:12px;color:#91846b;padding:9px 5px;border-radius:11px}.parameter-tabs button.selected{background:#fffced;color:#28291f;font-weight:700}.param-controls{flex:1;min-height:0;display:grid;grid-template-columns:1fr 1fr;grid-gap:8px 14px;gap:8px 14px;align-content:center;padding:9px 0}.param-row{min-width:0}.param-row-head{display:flex;justify-content:space-between;align-items:center;grid-gap:5px;gap:5px;font-size:12px;margin-bottom:9px}.param-value{font-size:10px;color:#948365}.range-wrap{display:flex;align-items:center;grid-gap:7px;gap:7px;font-size:10px;color:#91846b}.range-wrap input{min-width:0;width:100%}.option-row{display:flex;flex-wrap:wrap;grid-gap:5px;gap:5px}.option{background:#fffced;border-radius:9px;padding:8px 9px;font-size:11px;min-height:32px}.option.selected{background:var(--orange);color:#2b291f}.param-row.has-swatches,.param-row.has-text-input,.arrangement-row{grid-column:1/-1}.swatches{display:flex;align-items:center;grid-gap:9px;gap:9px;flex-wrap:wrap}.swatch{width:29px;height:29px;border:3px solid #f3efd7;outline:1px solid #d1c9aa;border-radius:50%}.swatch.selected{outline:2px solid #dd8854}.custom-color-label{display:flex;align-items:center;grid-gap:5px;gap:5px;font-size:11px;background:#fffced;border-radius:10px;padding:4px;cursor:pointer}.custom-color{width:28px;height:28px;border:1px dashed #b3a98a;background:none;padding:4px;border-radius:6px;cursor:pointer}.custom-color-label span{white-space:nowrap}.text-input{width:100%;font-size:14px;padding:12px;border:0;border-radius:11px;background:#fffced}.param-hint{display:block;font-size:10px;color:#948870;margin-top:7px}.arrangement-row .option-row{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:8px;gap:8px}.arrangement-row .option{min-height:38px}.preview-drag-hint{position:absolute;top:10px;left:10px;font-size:11px;background:#fffdecdd;border-radius:12px;padding:8px 10px;pointer-events:none}.focus-view .topbar,.focus-view .brand-description,.focus-view .progress,.focus-view .page-heading,.focus-view .design-controls,.focus-view .design-action{display:none}.focus-view .design-page{justify-content:center}.focus-view .preview-column{background:none;padding:0;flex-direction:column;grid-gap:18px;gap:18px}.focus-view .preview-stage{width:100%;height:calc(100vw - 36px);aspect-ratio:1;max-height:calc(100vh - 110px)}.focus-view .preview-toolbar{width:100%;flex-direction:row;align-items:center;justify-content:space-between}.focus-view #previewCanvas{touch-action:none;cursor:grab}.focus-view #previewCanvas:active{cursor:grabbing}
@media(min-width:600px){.app-shell{height:calc(100vh - 24px);max-height:900px;margin:12px auto;border-radius:28px;box-shadow:0 15px 50px #77785e15}}
@media(max-height:700px){.topbar{padding-top:10px}.brand strong{font-size:20px}.brand-mark{width:27px;height:27px}.brand-description{margin-top:5px;margin-bottom:8px;font-size:10px}.progress{padding-bottom:9px}.page{padding-top:10px;padding-bottom:10px;grid-gap:9px;gap:9px}.page-heading h1{font-size:19px}.welcome{grid-gap:10px;gap:10px}.welcome-heading h1{font-size:27px}.upload-button{padding:11px}.demo-button{padding:8px 18px}.preview-stage{width:85px;height:85px}.preview-column{padding:9px;grid-gap:13px;gap:13px}.design-controls{grid-gap:7px;gap:7px}.adjustments{padding:7px 10px}.parameter-tabs{padding-bottom:6px}.parameter-tabs button{padding:7px 4px;font-size:11px}.param-row-head{font-size:11px;margin-bottom:6px}.param-controls{padding:6px 0;grid-gap:7px 10px;gap:7px 10px}.option{padding:6px;min-height:28px;font-size:10px}.arrangement-row .option{min-height:31px}.button{min-height:42px}.tools button{min-height:32px}#portraitEditor{grid-gap:8px;gap:8px}.editor-settings{padding:8px 11px}.slider-control label{font-size:11px}.template-card strong{font-size:9px;margin-top:5px}.swatches{grid-gap:7px;gap:7px}.swatch{width:25px;height:25px}.custom-color-label{font-size:10px;padding:2px}.custom-color{width:25px;height:25px}}
@media(max-height:600px){.page{grid-gap:7px;gap:7px}.preview-stage{width:64px;height:64px}.preview-toolbar{grid-gap:5px;gap:5px}.preview-toolbar strong{font-size:12px}.template-thumb{aspect-ratio:auto;height:43px}.template-cards{grid-gap:5px;gap:5px}.adjustments{padding:5px 9px}.parameter-tabs{padding-bottom:4px}.parameter-tabs button{padding:6px 3px}.param-controls{grid-gap:6px;gap:6px}.param-row-head{font-size:10px}.arrangement-row .option-row{grid-gap:5px;gap:5px}.arrangement-row .option{min-height:28px}.section-head>span{display:none}.swatches{grid-gap:5px;gap:5px}.param-row.has-swatches{display:flex;grid-gap:6px;gap:6px;align-items:center}.param-row.has-swatches .param-row-head{width:52px;flex:none;margin:0}.custom-color-label span{font-size:9px}.stage-caption{font-size:9px}.slider-control{grid-gap:8px;gap:8px}}
@media(max-width:359px){.page{padding-left:14px;padding-right:14px}.topbar{padding-left:14px;padding-right:14px}.brand-description{margin-left:14px;margin-right:14px}.progress{padding-left:14px;padding-right:14px;grid-gap:5px;gap:5px}.upload-button strong{font-size:14px}.upload-button{grid-gap:9px;gap:9px}.template-card strong{font-size:9px}.param-row-head{font-size:10px}}
/* Size controls read as two usable rows, rather than two tiny columns in empty space. */
.adjustments{flex:none}.param-controls{flex:none;align-content:start;padding:13px 0 4px;grid-gap:15px 14px;gap:15px 14px}.param-row.has-range-wrap,.param-row[data-key="density"]{grid-column:1/-1}.param-row[data-key="density"] .option-row{display:grid;grid-template-columns:repeat(3,1fr)}.param-row[data-key="density"] .option{min-height:34px}.param-row-head{margin-bottom:9px}.design-controls{grid-gap:12px;gap:12px}.template-thumb{aspect-ratio:4/5}.sample-spread{max-height:360px}.privacy{margin-top:0}.welcome{justify-content:space-between}.design-page .bottom-action{margin-top:auto}
@media(max-height:700px){.param-controls{padding:8px 0 2px;grid-gap:8px 10px;gap:8px 10px}.param-row-head{margin-bottom:6px}.template-thumb{aspect-ratio:1}.design-controls{grid-gap:7px;gap:7px}.param-row[data-key="density"] .option{min-height:28px}.param-row.has-range-wrap,.param-row[data-key="density"]{grid-column:auto}}
@media(max-height:600px){.template-thumb{aspect-ratio:auto;height:43px}.param-controls{grid-gap:6px;gap:6px}.param-row-head{margin-bottom:5px}}
.param-controls.has-template-options .param-row.has-range-wrap,.param-controls.has-template-options .param-row[data-key="density"]{grid-column:auto}.param-controls.has-template-options .param-row[data-key="density"] .option-row{display:flex}
.text-place-button{margin-top:12px;padding:11px 14px;border-radius:11px;background:#ffd3a7;font-size:12px;width:100%}.text-edit-controls{background:#f3efd7;border-radius:16px;padding:12px;display:grid;grid-gap:10px;gap:10px;flex:none}.text-edit-top{display:flex;align-items:center;grid-gap:8px;gap:8px;font-size:11px}.text-edit-top select{font:inherit;background:#fffdec;border:0;border-radius:8px;padding:7px;min-width:0}.text-edit-top button{margin-left:auto;font-size:11px}.text-slider{display:flex;align-items:center;grid-gap:10px;gap:10px;font-size:12px}.text-slider input{flex:1;min-width:0}.text-slider output{min-width:35px;text-align:right;font-size:10px}.text-editing .preview-toolbar{display:none}.text-editing .preview-stage{width:min(100%,calc(100vh - 220px));align-self:center}.text-editing .design-page{justify-content:center}.param-row[data-group=pattern] input{width:100%}.param-controls.show-pattern{grid-gap:10px;gap:10px}.parameter-tabs button{font-size:11px}
@media(max-height:700px){.text-place-button{margin-top:8px;padding:8px;font-size:11px}.param-controls.show-color{grid-gap:7px;gap:7px}.text-edit-controls{padding:9px;grid-gap:6px;gap:6px}.text-editing .preview-stage{width:min(100%,calc(100vh - 190px))}}
.swap-colors{font-size:10px;padding:4px 7px;min-height:23px;white-space:nowrap}.param-row-head.has-swap-colors{flex-wrap:wrap}
.upload-examples{font-size:12px;line-height:1.65;color:#85785f;margin-top:10px}@media(max-height:700px){.upload-examples{font-size:10px;line-height:1.5;margin-top:6px}}
/* Reserve the host's status and navigation overlay independently of our header. */
:root{--host-top-space:25px}.app-shell{padding-top:var(--host-top-space)}.topbar{justify-content:center;padding-top:7px}.brand-description{text-align:center;margin-top:5px;margin-bottom:10px}.text-batch-row{display:flex;align-items:center;grid-gap:10px;gap:10px;font-size:11px}.text-batch-row label,.text-edit-top label.with-input{display:flex;align-items:center;grid-gap:4px;gap:4px;white-space:nowrap}.text-batch-row button{background:#fffdec;border-radius:8px;padding:6px 10px;font-size:11px}.text-batch-row span{margin-left:auto;color:#8a7d61}.text-content-row{display:flex;grid-gap:9px;gap:9px;align-items:center;font-size:11px}.text-content-row input{min-width:0;flex:1;background:#fffdec;border:0;border-radius:8px;padding:8px;font-size:12px}.text-edit-top{grid-gap:5px;gap:5px}.text-edit-top button{font-size:10px}.text-editing .preview-stage{width:min(100%,calc(100vh - var(--host-top-space) - 330px))}.focus-view .preview-stage{max-height:calc(100vh - var(--host-top-space) - 100px)}.text-editing .design-page{grid-gap:10px;gap:10px}.text-editing .preview-column{grid-gap:0;gap:0}.text-editing .text-edit-controls{grid-gap:7px;gap:7px}
@media(max-height:850px){.page{grid-gap:9px;gap:9px;padding-top:10px;padding-bottom:10px}.preview-stage{width:96px;height:96px}.preview-column{padding:9px}.template-thumb{aspect-ratio:auto;height:52px}.design-controls{grid-gap:7px;gap:7px}.param-controls{grid-gap:8px;gap:8px;padding:8px 0 2px}.param-row.has-range-wrap,.param-row[data-key=density]{grid-column:auto}.param-row-head{margin-bottom:6px}.option{padding:7px;min-height:29px}.parameter-tabs{padding-bottom:6px}.parameter-tabs button{padding:7px 3px}.adjustments{padding:7px 10px}.welcome{grid-gap:10px;gap:10px}.sample-spread{max-height:300px}.welcome-heading h1{font-size:29px}.upload-examples{font-size:11px;margin-top:7px}.focus-view .preview-stage{width:100%;height:auto}.text-editing .preview-stage{width:min(100%,calc(100vh - var(--host-top-space) - 300px))}}
@media(max-height:700px){.progress{padding-bottom:7px}.page{grid-gap:6px;gap:6px;padding-top:7px;padding-bottom:8px}.page-heading{min-height:24px}.preview-stage{width:60px;height:60px}.preview-column{padding:7px}.template-thumb{height:36px}.template-card strong{margin-top:3px}.section-head{min-height:15px}.section-head>span{display:none}.design-controls{grid-gap:5px;gap:5px}.adjustments{padding:5px 8px}.param-controls{grid-gap:5px;gap:5px;padding:5px 0 0}.param-row-head{font-size:10px;margin-bottom:4px}.parameter-tabs button{font-size:10px;padding:5px 2px}.parameter-tabs{padding-bottom:4px}.option{min-height:25px;padding:5px;font-size:10px}.param-row[data-key=density] .option{min-height:25px}.text-place-button{padding:6px;margin-top:5px}.param-hint{font-size:9px;margin-top:3px}.param-row.has-swatches{display:flex;align-items:center;grid-gap:5px;gap:5px}.param-row.has-swatches .param-row-head{width:55px;flex:none;margin:0}.swatches{grid-gap:4px;gap:4px}.swatch{width:22px;height:22px}.custom-color-label{font-size:9px;padding:1px}.custom-color{width:22px;height:22px}.button{min-height:36px}.welcome-heading h1{font-size:24px}.welcome{grid-gap:8px;gap:8px}.upload-examples{font-size:10px;margin-top:5px}.upload-button{padding:9px}.demo-button{padding:7px 16px}.privacy{font-size:9px}#portraitEditor{grid-gap:5px;gap:5px}.editor-settings{padding:5px 9px}.edit-actions{min-height:23px;margin-top:0}.tools button{min-height:29px}.stage-caption{font-size:9px}.slider-control{min-height:26px}.text-editing .preview-stage{width:min(100%,calc(100vh - var(--host-top-space) - 270px))}.text-edit-controls{padding:8px}.text-editing .text-edit-controls{grid-gap:5px;gap:5px}}
@media(max-height:620px){.design-page .section-head{display:none}.page-heading .text-button{padding:4px 0}.preview-stage{width:52px;height:52px}.preview-toolbar{grid-gap:4px;gap:4px}.compact button{padding:6px 9px}.template-thumb{height:32px}.param-hint{line-height:1.3}.focus-view .preview-stage{width:100%;height:auto}.text-editing .preview-stage{width:min(100%,calc(100vh - var(--host-top-space) - 270px))}}
@media(min-width:600px){.preview-stage{width:120px;height:120px}.template-thumb{aspect-ratio:auto;height:65px}.param-row.has-range-wrap,.param-row[data-key=density]{grid-column:auto}.param-controls{grid-gap:10px;gap:10px;padding-top:9px}.focus-view .preview-stage{width:100%;height:auto}.text-editing .preview-stage{width:min(100%,calc(min(900px,100vh - 24px) - var(--host-top-space) - 310px))}}
.subject-place-button{display:block;width:100%;margin-top:10px;border-radius:10px;padding:11px;background:#ffcf9e;font-size:12px}.subject-edit-controls{display:flex;flex-wrap:wrap;grid-gap:9px;gap:9px;align-items:center;padding:13px;background:#f3efd7;border-radius:16px;font-size:11px;flex:none}.subject-edit-controls select{font:inherit;padding:7px;background:#fffdec;border:0;border-radius:8px}.subject-edit-controls button{font-size:11px;padding:7px;background:#fffdec;border-radius:8px}.subject-edit-controls p{width:100%;font-size:10px;line-height:1.5;color:#85795e}.subject-editing .preview-toolbar{display:none}.subject-editing .preview-stage{width:min(100%,calc(100vh - var(--host-top-space) - 185px));align-self:center}.subject-editing .preview-column{grid-gap:0;gap:0}.subject-editing .design-page{grid-gap:12px;gap:12px}.param-controls.show-arrangement{grid-gap:0;gap:0}
@media(max-height:700px){.subject-place-button{padding:7px;margin-top:6px;font-size:11px}.arrangement-row .option{min-height:25px;padding:5px}.subject-edit-controls{grid-gap:6px;gap:6px;padding:10px}}

/* Five actual template samples, two above and three below. */
.sample-spread{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:minmax(0,1fr) minmax(0,1fr) 18px;grid-gap:8px;gap:8px}.sample-card{position:relative;margin:0;min-width:0;min-height:0;overflow:hidden;border-radius:14px;grid-column:span 2}.sample-card:nth-child(-n+2){grid-column:span 3}.sample-card .sample-paper{border-radius:0}.sample-card figcaption{position:absolute;bottom:6px;left:6px;background:#fffceded;border-radius:8px;padding:3px 6px;font-size:9px;color:#665e49}.sample-spread>.sample-label,.sample-spread>.sample-caption{position:static;background:none;padding:0;line-height:18px;font-size:9px}.sample-spread>.sample-label{grid-column:1/5}.sample-spread>.sample-caption{grid-column:5/7;text-align:right}@media(max-height:700px){.sample-spread{grid-gap:5px;gap:5px;grid-template-rows:minmax(0,1fr) minmax(0,1fr) 14px}.sample-card{border-radius:10px}.sample-card figcaption{bottom:3px;left:3px;font-size:8px;padding:2px 4px}.sample-spread>.sample-label,.sample-spread>.sample-caption{font-size:8px;line-height:14px}}
/* Let the preview use available height; distribute the remaining gaps evenly. */
.app-shell:not(.focus-view) .design-page{justify-content:space-between;grid-gap:14px;gap:14px}
.app-shell:not(.focus-view) .design-controls{flex:none;grid-gap:12px;gap:12px}
.app-shell:not(.focus-view) .design-action{margin-top:0}
.app-shell:not(.focus-view) .preview-column{flex:1;min-height:100px;max-height:260px;container-type:size;padding:14px;grid-gap:16px;gap:16px}
.app-shell:not(.focus-view) .preview-stage{width:min(58cqw,100cqh);height:min(58cqw,100cqh)}
.app-shell:not(.focus-view) .preview-toolbar{flex:1;grid-gap:15px;gap:15px}
@media(max-height:700px){.app-shell:not(.focus-view) .design-page{grid-gap:8px;gap:8px}.app-shell:not(.focus-view) .design-controls{grid-gap:7px;gap:7px}.app-shell:not(.focus-view) .preview-column{min-height:70px;max-height:175px;padding:8px;grid-gap:10px;gap:10px}.app-shell:not(.focus-view) .preview-toolbar{grid-gap:7px;gap:7px}}

/* Center the save action independently of the side labels. */
.design-page .section-head{display:grid;grid-template-columns:1fr 40px 1fr;align-items:center;grid-gap:4px;gap:4px;min-height:36px}.section-head>span{text-align:right;font-size:9px}.save-image-button{width:36px;height:36px;justify-self:center;border-radius:50%;background:var(--yellow);font-size:23px;line-height:1}@media(max-height:700px){.design-page .section-head{min-height:30px}.save-image-button{height:30px;width:30px;font-size:21px}}

.save-image-button{display:grid;place-items:center;padding:0;transform:translateY(-4px)}.save-image-button svg{display:block}
.save-image-button{transform:translateY(-8px)}.background-actions{display:flex;align-items:center;flex-wrap:wrap;grid-gap:5px;gap:5px}.background-actions button{display:flex;align-items:center;justify-content:center;grid-gap:5px;gap:5px;border-radius:12px;background:#fff1c6;padding:8px;font-size:11px}.background-actions #removeBackgroundButton{background:transparent;color:#765b44;font-size:10px;padding:5px}.preview-toolbar{min-width:0}@media(max-height:700px){.background-actions button{padding:5px;font-size:10px}.background-actions svg{width:16px;height:16px}.background-actions{grid-gap:2px;gap:2px}}
.element-slider{display:flex;align-items:center;grid-gap:9px;gap:9px;width:100%;font-size:11px}.element-slider input{flex:1;min-width:0}.element-slider output{width:36px;text-align:right}.subject-editing .preview-stage{width:min(100%,calc(100vh - var(--host-top-space) - 280px))}
.export-dialog{width:min(92vw,430px);max-height:90vh;border:0;border-radius:20px;background:var(--cream);padding:18px}.export-dialog::backdrop{background:#28291f88}.export-dialog>div{display:flex;justify-content:space-between;align-items:center}.export-dialog button{font-size:26px}.export-dialog p{font-size:12px;margin:12px 0;color:#817359}.export-dialog img{display:block;width:100%;max-height:60vh;object-fit:contain;-webkit-touch-callout:default}.export-dialog a{display:block;text-align:center;background:var(--yellow);padding:10px;border-radius:12px;margin-top:12px;font-size:13px}

@supports (aspect-ratio:1){.template-thumb{height:auto}.focus-view .preview-stage{height:auto}}
@supports not (width:min(100%,1px)){.text-editing .preview-stage,.subject-editing .preview-stage{width:100%}}
.no-flex-gap .brand>*+*,.no-flex-gap .progress>*+*,.no-flex-gap .tools>*+*,.no-flex-gap .parameter-tabs>*+*,.no-flex-gap .background-actions>*+*{margin-left:5px}.no-flex-gap .page>*+*:not(.bottom-action),.no-flex-gap .welcome>*+*,.no-flex-gap .preview-column>*+*,.no-flex-gap .preview-toolbar>*+*,.no-flex-gap .design-controls>*+*{margin-top:8px}

.app-shell{padding-top:var(--host-top-space);padding-top:calc(var(--host-top-space) + var(--safe-area-inset-top, env(safe-area-inset-top, 0px)));padding-bottom:0;padding-bottom:var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px))}

/* Explicit save action and linked editor selection. */
.design-page .section-head{grid-template-columns:1fr 64px 1fr}.save-image-button{width:64px;height:32px;border-radius:12px;display:flex;align-items:center;justify-content:center;gap:4px;font-size:11px;line-height:18px}.save-image-button svg{width:16px;height:16px;flex:none}.save-image-button[aria-busy=true] svg{display:none}.subject-edit-controls select,.text-edit-top select{background:#e3ebfb;color:#355d9c;outline:1px solid #9db4dc}.subject-edit-controls input[type=range],.text-edit-controls input[type=range]{accent-color:#4c78bd}.subject-editing .preview-drag-hint,.text-editing .preview-drag-hint{background:#e3ebfb;color:#355d9c}
