@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap');
:root{--bg:#f6f5f0;--paper:#fffef9;--ink:#303a32;--muted:#8b8e82;--line:#e5e6dd;--green:#65795b;--accent:#e7ecde}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:'Noto Sans SC',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-size:13px}button,input,textarea,select{font:inherit}button,a,label,input{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:0;background:transparent;color:inherit;display:inline-flex;align-items:center;justify-content:center;gap:8px}button:disabled{opacity:.3;cursor:not-allowed}button:hover:not(:disabled){background:#e9ece2}button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,label:focus-within{outline:2px solid #71886a;outline-offset:3px}svg{width:18px;height:18px;flex-shrink:0;stroke:currentColor;fill:none;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.topbar{height:80px;border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 28px;gap:22px;background:#fbfaf7}.brand{text-decoration:none;color:inherit;display:flex;align-items:center;gap:10px;font-size:21px;font-weight:600;letter-spacing:2px}.brand-symbol{font-size:34px;color:#687b5e;line-height:1}.brand small{font-size:9px;letter-spacing:3px;font-weight:500;display:block;margin-top:1px}.header-divider{height:24px;width:1px;background:var(--line)}.page-name{font-size:14px}.save-state{font-size:11px;color:var(--muted);margin-left:2px}.header-actions{display:flex;gap:8px;margin-left:auto}.quiet{padding:10px 12px;border-radius:7px;font-size:12px}.primary{background:var(--ink);color:#fff;padding:11px 17px;border-radius:7px;font-size:12px}.primary:hover:not(:disabled){background:#4c5a48}.workspace{height:calc(100dvh - 80px);min-height:560px;display:grid;grid-template-columns:76px minmax(300px,1fr) 296px}.tools{border-right:1px solid var(--line);padding:25px 12px 18px;display:flex;align-items:center;flex-direction:column;gap:8px;background:#faf9f5}.tool-heading{font-size:10px;letter-spacing:2px;color:var(--muted);margin-bottom:12px}#brushes{display:flex;flex-direction:column;gap:10px}.tool{width:44px;height:44px;border-radius:10px;position:relative}.tool svg{width:21px;height:21px}.tool[aria-pressed=true]{background:var(--accent);color:#465b3d}.tool[aria-pressed=true]:before{content:'';width:3px;height:19px;background:#6c835f;position:absolute;left:-12px;border-radius:0 2px 2px 0}.tool-divider{height:1px;width:25px;background:var(--line);margin:12px 0}.tool-spacer{flex:1}.studio{min-width:0;display:flex;flex-direction:column;background-color:#eeeee8;background-image:radial-gradient(#d9dcd2 .65px,transparent .65px);background-size:16px 16px}.studio-heading{padding:25px 30px 18px;display:flex;align-items:center;justify-content:space-between;gap:10px}.title-row{display:flex;align-items:center;gap:12px;min-width:0}#title{width:170px;max-width:100%;font-size:14px;font-weight:500;border:0;background:transparent;color:var(--ink);padding:5px 0}.draft-label{font-size:9px;background:#e4e7dc;border:1px solid #dce0d2;padding:3px 7px;color:#7e8874;border-radius:4px;white-space:nowrap}#dimensions{font-size:10px;letter-spacing:1px;color:#979a8e;white-space:nowrap}.stage{flex:1;overflow:auto;min-height:100px;display:grid;padding:28px;align-items:center;justify-items:center}.paper{position:relative;flex-shrink:0;box-shadow:0 8px 28px #404d3210,0 1px 3px #404d3210;background:var(--paper);line-height:0}.paper canvas{display:block;touch-action:none;cursor:crosshair;width:100%;height:100%}.empty{position:absolute;inset:0;pointer-events:none;display:flex;align-items:center;justify-content:center;flex-direction:column;line-height:normal}.empty-art{font-size:58px;color:#c6cebb;font-family:Georgia,serif;margin-bottom:13px}.empty h1{font-family:Georgia,'Songti SC',serif;font-size:30px;font-weight:400;letter-spacing:5px;margin:0 0 14px}.empty p{font-size:12px;color:#999d90;margin:0}.empty-hint{font-size:10px;color:#adb0a5;border:1px solid #e9ebe2;border-radius:99px;padding:7px 15px;margin-top:28px}.studio-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:20px 27px;color:#929887;font-size:10px}.status-dot{display:inline-block;width:5px;height:5px;border-radius:50%;background:#9ba98a;margin-right:7px}.zoom-controls{display:flex;align-items:center;gap:7px;padding:3px 7px;background:#fafaf6;border:1px solid #e1e4d9;border-radius:7px;box-shadow:0 2px 4px #00000003}.zoom-controls button{width:28px;height:26px;border-radius:4px}.zoom-controls svg{width:15px;height:15px}.zoom-controls span{min-width:38px;text-align:center;font-size:11px;color:#626c59}.zoom-controls .mini-divider{height:15px;width:1px;min-width:1px;background:var(--line);margin:0 2px}.properties{background:#fbfaf7;border-left:1px solid var(--line);padding:27px 22px 16px;overflow:auto}.panel-heading{display:flex;align-items:center;justify-content:space-between;font-size:13px;font-weight:500;margin-bottom:26px}.edition{font-size:9px;letter-spacing:2px;color:#a5aa9a}.property-section{border-bottom:1px solid var(--line);padding-bottom:20px;margin-bottom:21px}.section-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.section-title h2{font-size:11px;letter-spacing:1px;font-weight:500;margin:0}.section-title>span{font-size:10px;color:#929989}.brush-preview{background:#f0f1e9;border-radius:7px;height:49px;overflow:hidden;margin-bottom:16px}.brush-preview canvas{width:100%;height:100%}.control-label{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:#909584;margin-top:12px}.control-label output{font-size:10px;color:#626e59}input[type=range]{width:100%;height:3px;margin:15px 0 3px;accent-color:#6b805f;cursor:pointer}input[type=range]::-webkit-slider-thumb{cursor:ew-resize}.custom-color{display:flex;align-items:center;gap:6px;cursor:pointer;font-size:9px;color:#899180}.custom-color input{width:17px;height:17px;padding:0;border:0;background:none;cursor:pointer}.custom-color input::-webkit-color-swatch-wrapper{padding:0}.custom-color input::-webkit-color-swatch{border:0;border-radius:4px}.palette{display:grid;grid-template-columns:repeat(6,1fr);gap:13px 12px}.swatch{height:24px;width:24px;border-radius:50%;padding:0;position:relative;background:var(--swatch)!important;box-shadow:inset 0 0 0 1px #0000000d}.swatch[aria-pressed=true]:after{content:'';position:absolute;inset:-4px;border:1px solid #7f8c71;border-radius:50%}.ratios{display:flex;gap:7px}.ratios button{font-size:9px;flex:1;flex-direction:column;gap:8px;padding:12px 3px 9px;border:1px solid var(--line);border-radius:6px;color:#959b8c}.ratios button[aria-pressed=true]{background:#eef1e5;border-color:#bfcbb1;color:#627555}.ratio-shape{display:block;border:1px solid currentColor;width:23px;height:17px;border-radius:1px}.ratio-shape.square{width:18px;height:18px}.ratio-shape.portrait{width:14px;height:18px}.paper-colors{display:flex;gap:9px}.paper-colors .swatch{height:17px;width:17px}.paper-colors .swatch[aria-pressed=true]:after{inset:-3px}.idea-section textarea{width:100%;min-height:107px;resize:vertical;border:1px solid #e3e6d9;background:#f7f8f1;border-radius:8px;padding:13px;font-size:11px;line-height:1.9;color:var(--ink)}textarea::placeholder{color:#a1a796}.idea-foot{display:flex;justify-content:space-between;font-size:9px;color:#a0a594;margin-top:7px}.ai-note{margin-top:20px;padding:14px 10px;border:1px dashed #d7dfca;display:flex;align-items:center;gap:8px;border-radius:7px}.ai-note>svg{width:18px;color:#9ca98b}.ai-note strong{font-size:10px;font-weight:500;color:#6f7b63}.ai-note p{font-size:9px;line-height:1.7;color:#9fa78f;margin:4px 0 0}.soon{font-size:8px;white-space:nowrap;background:#edf0e4;color:#8e9b7c;border-radius:4px;padding:4px}.local-note{font-size:9px;line-height:1.8;color:#aaaE9e;margin-top:25px;display:flex;gap:6px;align-items:start}.local-note svg{width:12px;height:16px}dialog{border:1px solid var(--line);border-radius:14px;background:#fbfaf7;color:var(--ink);padding:28px;width:min(680px,calc(100vw - 32px));max-height:85dvh;box-shadow:0 30px 100px #202b2525}dialog::backdrop{background:#2433284d;backdrop-filter:blur(3px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center;gap:15px}.dialog-heading h2{font-size:21px;font-weight:500;margin:5px 0 0}.eyebrow{font-size:9px;letter-spacing:2px;color:#929e81}.icon-btn{width:34px;height:34px;border-radius:6px}.dialog-subtitle,dialog p{color:#929887;font-size:12px;line-height:1.8}.draft-list{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;margin:24px 0;max-height:48vh;overflow:auto;padding:4px}.draft-card{display:flex;flex-direction:column;align-items:stretch;text-align:left;padding:8px;border:1px solid var(--line);border-radius:8px;gap:8px}.draft-card.current{border-color:#899b75;background:#eef2e7}.draft-card img{width:100%;height:112px;object-fit:contain;background:#eaece3;border-radius:4px}.draft-card strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.draft-card time{font-size:9px;color:#939c87}.dialog-footer{display:flex;justify-content:space-between;border-top:1px solid var(--line);padding-top:15px}.import-label{display:inline-flex;align-items:center;gap:7px;cursor:pointer}.confirm-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:24px}#confirm-dialog{width:min(420px,calc(100vw - 32px))}dl{font-size:12px;line-height:1.8}dt{margin-top:15px;font-weight:500}dd{margin:3px 0;color:#818b76}.toast{position:fixed;bottom:28px;left:50%;transform:translate(-50%,20px);opacity:0;transition:.2s;pointer-events:none;background:#303a32;color:#fff;padding:12px 20px;border-radius:8px;font-size:12px;max-width:90vw;z-index:10}.toast.visible{opacity:1;transform:translate(-50%,0)}[hidden]{display:none!important}@media(min-width:1500px){.workspace{grid-template-columns:84px minmax(300px,1fr) 320px}.properties{padding:32px 26px}.stage{padding:45px}}@media(max-width:1050px){.topbar{padding:0 18px;gap:14px}.workspace{grid-template-columns:64px minmax(250px,1fr) 256px}.properties{padding:25px 17px}.studio-heading{padding:20px 20px 10px}.draft-label,.footer-hint,.header-divider,.page-name{display:none}.studio-footer{padding:16px}.stage{padding:20px}.ai-note{flex-wrap:wrap}#title{width:145px}.save-state{font-size:10px}.tool[aria-pressed=true]:before{left:-6px}}@media(max-width:760px){.topbar{height:70px;padding:0 12px;gap:8px}.brand{font-size:18px;gap:6px}.brand small{font-size:7px}.brand-symbol{font-size:28px}.save-state{display:none}.header-actions{gap:0}.header-actions .quiet{padding:9px 7px;font-size:10px}.header-actions .primary{padding:9px;font-size:10px}.header-actions svg{width:14px}.workspace{height:auto;min-height:calc(100dvh - 70px);grid-template-columns:54px minmax(0,1fr)}.tools{padding:18px 5px;grid-row:1;gap:5px}.tool{width:40px;height:40px}.tools .tool-heading{font-size:9px}.tool[aria-pressed=true]:before{left:-6px}.studio{height:calc(100dvh - 70px);min-height:530px}.studio-heading{padding:15px 13px;display:block}.title-row{margin-bottom:4px}#title{width:100%}#dimensions{font-size:9px}.stage{padding:15px}.studio-footer{padding:15px 10px;flex-wrap:wrap;justify-content:center}.studio-footer>span{display:none}.properties{grid-column:1/-1;border-top:1px solid var(--line);border-left:0;display:grid;grid-template-columns:1fr 1fr;gap:20px;padding:22px}.panel-heading,.idea-section,.local-note{grid-column:1/-1}.panel-heading{margin:0}.property-section{margin:0;padding-bottom:18px}.palette{gap:16px}.ratios{max-width:280px}.property-section:has(.ratios){grid-column:1/-1}.local-note{margin:0}.draft-list{grid-template-columns:repeat(2,1fr)}.empty h1{font-size:21px;letter-spacing:2px}.empty p{font-size:9px;text-align:center;padding:0 12px}.empty-art{font-size:36px}.empty-hint{font-size:8px;margin-top:18px}dialog{padding:20px}}

/* Sketch-to-art controls */
.style-presets{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}.style-presets button{border:1px solid var(--line,#ddd);border-radius:20px;background:transparent;padding:5px 12px;font-size:12px;color:#526248}.style-presets button:hover{background:#e8eddf}.generate-btn{width:100%;justify-content:center;min-height:44px}.generate-btn:disabled{opacity:.55;cursor:wait}.generation-status{font-size:12px;line-height:1.8;color:#516146;margin:10px 0;overflow-wrap:anywhere}.ai-caption{font-size:11px;line-height:1.7;color:#808477}.artwork-history{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}.artwork-thumb{padding:0;overflow:hidden;border:1px solid #ddd;border-radius:8px;background:#fff;text-align:left}.artwork-thumb img{width:100%;height:84px;object-fit:cover;display:block}.artwork-thumb span{display:block;padding:6px;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.artwork-dialog{width:min(900px,94vw);max-width:94vw}.artwork-tabs{display:flex;gap:8px;margin:14px 0}.artwork-tabs button{border:1px solid #d8ddcf;background:#fff;padding:8px 14px;border-radius:20px;font-size:12px}.artwork-tabs button[aria-pressed=true]{background:#536649;color:#fff;border-color:#536649}.artwork-frame{display:grid;place-items:center;min-height:180px;background:#e9e8e2;border-radius:8px;overflow:hidden}.artwork-frame img{max-width:100%;max-height:58vh;object-fit:contain}.artwork-dialog p{font-size:13px;line-height:1.7;color:#66705e;overflow-wrap:anywhere}.artwork-dialog .dialog-footer{gap:12px;flex-wrap:wrap}.artwork-dialog .dialog-footer span{font-size:12px;color:#7b8174}
/* Layered editor */
.tools{overflow-y:auto;min-height:0;padding-top:16px}.tools>*{flex-shrink:0}#brushes{gap:5px}.tools .tool-divider{margin:5px 0}.tools .tool-heading{margin-bottom:2px}.tools .tool{flex-shrink:0}.paper #selection-overlay{position:absolute;inset:0;pointer-events:none;z-index:1}.selection-bar{display:flex;align-items:center;flex-wrap:wrap;gap:7px;padding:6px 18px;background:#f8faf1;border-block:1px solid #dfe5d6;min-height:43px;font-size:10px}.selection-bar label{display:flex;align-items:center;gap:4px}.selection-bar input{width:58px;padding:5px;border:1px solid #d4ddc9;border-radius:4px;background:#fff;color:var(--ink);font-size:11px}.selection-bar .quiet{padding:6px}.selection-bar svg{width:14px;height:14px}.layers-section .section-title{margin-bottom:10px}.small-btn{font-size:10px;border:1px solid var(--line);border-radius:5px;padding:5px 7px;gap:3px}.small-btn svg{width:13px;height:13px}#layer-list{max-height:220px;overflow-y:auto;display:flex;flex-direction:column;gap:5px;padding:2px}.layer-row{display:flex;align-items:center;gap:3px;border:1px solid var(--line);border-radius:6px;padding:4px;background:#fff}.layer-row.active{border-color:#94a982;background:#eef2e6}.layer-choose{flex:1;min-width:0;display:flex;flex-direction:column;align-items:start;gap:4px;padding:5px;text-align:left}.layer-choose span{font-size:11px;max-width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.layer-choose small{font-size:9px;color:#8c9580}.layer-icon{width:27px;height:30px;padding:5px;border-radius:4px}.layer-icon svg{width:15px;height:15px}.layer-settings{margin-top:13px}.layer-settings>label{display:block;font-size:10px;color:#8b9380;margin-bottom:5px}.layer-settings>input[type=text],#layer-name{width:100%;border:1px solid var(--line);border-radius:5px;background:#f9faf5;padding:8px;font-size:11px;color:var(--ink)}.layer-actions{display:flex;gap:5px;margin-top:13px}.layer-actions>*{flex:1}.panel-note{font-size:10px;line-height:1.8;color:#909783;margin:11px 0 0}#export-dialog{width:min(740px,calc(100vw - 28px))}.export-layout{display:grid;grid-template-columns:minmax(0,1fr) 230px;gap:24px;margin:22px 0}.export-preview{display:grid;place-items:center;min-height:200px;border:1px solid var(--line);border-radius:9px;background-color:#fff;background-image:conic-gradient(#e1e4dc 25%,transparent 0 50%,#e1e4dc 0 75%,transparent 0);background-size:20px 20px;padding:10px}.export-preview img{display:block;max-width:100%;max-height:350px;object-fit:contain}.export-options>label{display:block;font-size:11px;margin:10px 0 7px}.export-options>label:first-child{margin-top:0}.export-options select,.export-options input[type=number]{display:block;width:100%;border:1px solid #d7dfce;border-radius:6px;padding:9px;background:#fff;color:var(--ink)}.export-options input:disabled{background:#edf0e6}.export-options .checkbox-label{display:flex;align-items:center;gap:6px}.export-options input[type=checkbox]{accent-color:#667e55}#export-background-note,#export-size-label{font-size:10px;line-height:1.7}#export-error{color:#a24d3c;min-height:16px}#export-dialog .dialog-footer{gap:12px;align-items:center}#export-dialog .panel-note{margin:0}.export-options output{float:right}@media(max-width:760px){.layers-section{grid-column:1/-1}.tools{max-height:calc(100dvh - 70px);min-height:530px}.tools .tool{height:36px}.tools #brushes{gap:3px}.selection-bar{padding:7px 9px;gap:5px}.selection-bar>span{width:100%}.selection-bar input{width:48px}.export-layout{grid-template-columns:1fr;gap:16px}.export-preview{min-height:130px}.export-preview img{max-height:180px}.export-options{display:block}#export-dialog .dialog-footer{flex-wrap:wrap}.layers-section #layer-list{max-height:230px}}

.tools{overflow-x:hidden}
.cloud-strip{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:7px 22px;border-bottom:1px solid var(--line);font-size:10px;color:#758269;background:#f9faf5}.cloud-strip .small-btn{white-space:nowrap;background:#edf2e6;color:#405735}#cloud-state{line-height:1.6}#drafts-dialog{width:min(900px,calc(100vw - 28px))}.project-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:18px 0 12px}.project-tabs{display:flex;gap:8px}.project-tabs button{font-size:12px;padding:9px 12px;border-radius:6px}.project-tabs button[aria-pressed=true]{background:#e8eedf;color:#405735}#project-search,#project-name{width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--ink);font:inherit;font-size:13px}#project-message{min-height:20px;margin:10px 0 18px}#project-signin{display:block;font-size:12px;margin:12px 0;color:#516b40}.project-card{min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:#fff;padding:10px;text-align:left}.project-card.current{border-color:#849973;box-shadow:0 0 0 1px #849973}.project-thumb{height:132px;border-radius:6px;background:#f3f3eb;display:flex;align-items:center;justify-content:center;color:#a3ae96;font-size:38px;overflow:hidden}.project-thumb img{width:100%;height:100%;object-fit:contain}.project-card>strong{display:block;font-size:13px;margin:12px 2px 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.project-status{display:block;margin:0 2px 7px;font-size:10px;color:#6c815b}.project-card time{display:block;font-size:10px;color:#93998d;margin:0 2px 12px}.project-actions{display:flex;flex-wrap:wrap;gap:6px}.project-actions .small-btn{font-size:11px;padding:7px 9px}.project-open{background:#e8eedf;border-color:#d4dfc9}.project-empty{grid-column:1/-1;padding:40px 10px;text-align:center;color:#858e7b;font-size:13px}#rename-dialog{width:min(420px,calc(100vw - 28px))}#rename-dialog label{display:block;margin:20px 0 8px;font-size:12px}#rename-error{color:#a24d3c;font-size:12px;line-height:1.7}#project-signin[hidden]{display:none}@media(max-width:760px){.cloud-strip{padding:7px 12px}.project-toolbar{align-items:flex-start}.project-tabs{gap:2px}.project-tabs button{padding:8px;font-size:11px}.project-card{padding:8px}.project-thumb{height:100px}.project-actions{gap:4px}.project-actions .small-btn{padding:6px;font-size:10px}}
.cloud-actions{display:flex;align-items:center;gap:10px;flex-shrink:0}.cloud-actions a{font-size:11px;color:#526b43}.cloud-actions a[hidden]{display:none}#cloud-state{display:flex;align-items:center;gap:7px}#cloud-state::before{content:'';width:6px;height:6px;flex-shrink:0;border-radius:50%;background:#98a38c}#cloud-state[data-state=synced]::before{background:#66864d}#cloud-state[data-state=waiting]::before,#cloud-state[data-state=saving]::before{background:#c59b49}#cloud-state[data-state=conflict],#cloud-state[data-state=error],#cloud-state[data-state=auth],#cloud-state[data-state=invalid]{color:#a15d40}#cloud-state[data-state=offline]{color:#8a7960}.project-status{line-height:1.7;min-height:17px}@media(prefers-reduced-motion:no-preference){#cloud-state[data-state=saving]::before{animation:sync-pulse 1s ease-in-out infinite}}@keyframes sync-pulse{50%{opacity:.35}}

/* Phone workspace: a full-width canvas with compact, grouped controls. */
.mobile-panels,.mobile-tool-hint{display:none}
@media(max-width:760px),(max-width:1000px) and (max-height:500px){
 html{scroll-padding-top:76px}
 .save-state,.header-divider,.page-name,.draft-label,.footer-hint{display:none}
 body{overflow-x:clip}
 .topbar{height:64px;padding:0 12px;position:sticky;top:0;z-index:10;gap:8px}
 .brand{flex-shrink:0;font-size:18px;letter-spacing:1px}.brand small{letter-spacing:2px}
 .header-actions{gap:3px;min-width:0}.header-actions button{min-height:42px;font-size:11px!important;padding:8px!important;gap:4px;white-space:nowrap}
 .header-actions svg{width:15px;height:15px}
 .workspace{display:flex;flex-direction:column;height:auto;min-height:0;width:100%;min-width:0}
 .tools{width:100%;height:58px;min-height:0;max-height:none;padding:7px 12px;flex-direction:row;align-items:center;justify-content:flex-start;gap:5px;overflow-x:auto;overflow-y:hidden;border-right:0;border-bottom:1px solid var(--line);scrollbar-width:thin;overscroll-behavior-x:contain}
 .tools #brushes{display:flex;flex-direction:row;gap:5px;order:0}.tools .tool{height:42px;width:42px;border-radius:9px;order:2}
 .tools #undo,.tools #redo{order:1}
 .tools .tool-heading,.tools .tool-divider,.tools .tool-spacer{display:none}
 .tools .tool[aria-pressed=true]:before{left:10px;right:10px;width:auto;height:2px;top:auto;bottom:2px;border-radius:2px}
 .mobile-tool-hint{display:block;padding:7px 12px;font-size:10px;color:#858e7a;background:#faf9f5;border-bottom:1px solid var(--line);text-align:center}
 .studio{height:auto;min-height:0;width:100%;flex-shrink:0}
 .studio-heading{padding:10px 14px;display:flex;align-items:center;gap:8px;min-height:47px}
 .title-row{flex:1;margin:0;min-width:0}#title{font-size:16px;min-width:0;width:100%;text-overflow:ellipsis;padding:4px 0}#dimensions{font-size:9px;letter-spacing:0}
 .cloud-strip{padding:6px 14px;gap:8px;min-height:38px}#cloud-state{flex:1;min-width:0;overflow-wrap:anywhere;font-size:10px}.cloud-actions{flex-shrink:0}.cloud-strip .small-btn{min-height:32px;padding:5px 8px}
 .stage{flex:none;height:clamp(250px,36svh,380px);min-height:0;padding:12px;overflow:auto}
 .studio-footer{padding:6px 12px 10px;min-height:50px;justify-content:space-between}.studio-footer>span:first-child{display:block;font-size:9px}.studio-footer .zoom-controls{gap:1px;padding:3px}.zoom-controls button{min-width:32px;height:32px}
 .empty h1{font-size:23px;letter-spacing:2px}.empty p{font-size:11px;line-height:1.7}.empty-art{font-size:34px;margin-bottom:8px}.empty-hint{display:none}
 .selection-bar{padding:8px 12px}.selection-bar input{font-size:16px;width:60px}
 .properties{width:100%;min-width:0;display:flex;flex-direction:column;gap:18px;padding:0 16px 22px;overflow:visible;border-top:1px solid var(--line)}
 .mobile-panels{display:flex;gap:4px;padding:9px 0 0;width:100%;border-bottom:1px solid var(--line)}
 .mobile-panels button{min-width:0;flex:1;min-height:44px;padding:8px 3px;font-size:12px;border-radius:8px 8px 0 0;white-space:nowrap;border-bottom:2px solid transparent}
 .mobile-panels button[aria-pressed=true]{background:#eaf0e2;color:#405735;border-bottom-color:#65795b;font-weight:600}
 .properties .panel-heading{display:none}
 .properties [data-mobile-section]{display:none;margin:0;min-width:0;width:100%}
 .properties[data-mobile-panel=brush] [data-mobile-section=brush],.properties[data-mobile-panel=paper] [data-mobile-section=paper],.properties[data-mobile-panel=layers] [data-mobile-section=layers],.properties[data-mobile-panel=ai] [data-mobile-section=ai]{display:block}
 .section-title{margin-bottom:12px}.section-title h2{font-size:13px}.control-label,.layer-settings>label{font-size:12px}
 .properties input:not([type=range]):not([type=color]),.properties textarea{font-size:16px}
 .idea-section textarea{min-height:108px;padding:12px;font-size:16px;line-height:1.7}
 .idea-foot{font-size:10px}.style-presets{gap:8px;margin:12px 0}.style-presets button{min-height:38px;flex:1;padding:6px 10px}.generate-btn{min-height:48px;font-size:15px}
 .palette{grid-template-columns:repeat(6,minmax(0,1fr));justify-items:center;gap:16px}.palette .swatch{width:32px;height:32px}.custom-color input{width:28px;height:28px}
 .ratios{max-width:none}.ratios button{font-size:12px;min-height:74px}.paper-colors .swatch{width:28px;height:28px}
 .properties input[type=range]{height:24px;margin:8px 0;touch-action:pan-x}.brush-preview{margin-bottom:10px}
 .layers-section #layer-list{max-height:260px}.layer-icon{width:40px;height:40px}.layer-choose{min-height:44px}.layer-actions{flex-wrap:wrap}.layer-actions button{min-height:40px;min-width:64px;font-size:12px}.small-btn{min-height:36px}.layer-choose span{font-size:13px}
 .local-note{font-size:10px;margin:0;line-height:1.8}.artwork-history{grid-template-columns:repeat(2,minmax(0,1fr))}.artwork-thumb{flex-direction:column;align-items:stretch}.artwork-thumb img{height:110px}
 dialog{width:calc(100vw - 24px);max-width:calc(100vw - 24px);max-height:calc(100dvh - 32px);padding:16px;border-radius:12px}.dialog-heading h2{font-size:20px}.icon-btn{width:42px;height:42px;flex-shrink:0}
 .dialog-footer{gap:10px;flex-wrap:wrap}.dialog-footer button,.dialog-footer label{min-height:44px}.dialog-footer .primary{width:100%}
 .project-toolbar{align-items:center;gap:4px}.project-tabs button{min-height:40px;padding:7px;font-size:12px}.project-toolbar>.quiet{font-size:11px;padding:7px}.draft-list{grid-template-columns:minmax(0,1fr);max-height:48dvh;margin:16px 0}.project-thumb{height:150px}.project-actions .small-btn{min-height:40px;font-size:12px;padding:8px 10px}.project-card>strong{white-space:normal;overflow-wrap:anywhere}
 #project-search,#project-name,.export-options select,.export-options input[type=number]{font-size:16px}.export-options select,.export-options input[type=number]{min-height:44px}
 .artwork-dialog{width:calc(100vw - 24px);max-width:calc(100vw - 24px)}.artwork-frame img{max-height:48dvh}.artwork-tabs button{min-height:42px;padding:8px 12px}.toast{bottom:max(16px,env(safe-area-inset-bottom));font-size:12px}
}
@media(max-width:360px){.topbar{padding:0 8px}.brand{font-size:16px;gap:4px}.brand-symbol{font-size:24px}.header-actions button{font-size:10px!important;padding:7px 5px!important;gap:3px}.header-actions svg{width:13px}.studio-footer>span:first-child{display:none}.studio-footer{justify-content:center}.properties{padding-inline:12px}}

/* Keep generation within thumb reach, independent of the selected phone panel. */
.mobile-generate-bar{display:none}
@media(max-width:760px),(max-width:1000px) and (max-height:500px){
 body{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))}
 .mobile-generate-bar{display:block;position:fixed;left:0;right:0;bottom:0;z-index:20;padding:12px 16px calc(12px + env(safe-area-inset-bottom,0px));background:#fbfaf7;border-top:1px solid var(--line);box-shadow:0 -4px 20px #303a320a}
 .mobile-generate-bar .generate-btn{margin:0;min-height:48px;font-size:15px}
 .idea-section #generate-btn{display:none}
 .toast{bottom:calc(92px + env(safe-area-inset-bottom,0px));z-index:21}
 body:has(dialog[open]) .mobile-generate-bar{visibility:hidden}
}

/* Keep the editor inside the viewport; only settings and zoomed paper scroll. */
html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
body{height:100dvh;display:flex;flex-direction:column;padding-bottom:0}
.topbar{height:64px;flex:0 0 64px}
.workspace{flex:1;height:auto;min-height:0;grid-template-rows:minmax(0,1fr);overflow:hidden}
.tools,.studio,.properties{min-height:0;max-height:100%;height:auto}
.studio{overflow:hidden}
.studio-heading,.cloud-strip,.selection-bar,.studio-footer{flex-shrink:0}
.stage{flex:1;min-height:0;align-items:safe center;justify-items:safe center;overscroll-behavior:contain}
.studio-heading{padding:14px 22px 10px}
.studio-footer{padding:10px 18px}
.properties{display:block;padding:0 18px 16px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.properties .panel-heading,.properties .local-note{display:none}
.mobile-panels{display:flex;position:sticky;top:0;z-index:3;gap:3px;width:calc(100% + 36px);margin:0 -18px 16px;padding:10px 10px 0;background:#fbfaf7;border-bottom:1px solid var(--line)}
.mobile-panels button{flex:1;min-width:0;min-height:42px;padding:7px 2px;font-size:11px;white-space:nowrap;border-radius:7px 7px 0 0;border-bottom:2px solid transparent}
.mobile-panels button[aria-pressed=true]{background:#eaf0e2;color:#405735;border-bottom-color:#65795b;font-weight:600}
.properties [data-mobile-section]{display:none;width:100%;min-width:0;margin:0 0 18px}
.properties[data-mobile-panel=brush] [data-mobile-section=brush],.properties[data-mobile-panel=paper] [data-mobile-section=paper],.properties[data-mobile-panel=layers] [data-mobile-section=layers],.properties[data-mobile-panel=ai] [data-mobile-section=ai]{display:block}
.idea-section textarea{resize:none;min-height:100px;max-height:160px}
.style-presets{gap:5px}.style-presets button{padding:5px 9px}
@media(max-width:760px),(max-width:1000px) and (max-height:500px){
 html{scroll-padding-top:0}
 body{padding-bottom:0}
 .topbar{position:relative;top:auto;height:56px;flex-basis:56px}
 .workspace{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:48px minmax(0,1fr) clamp(170px,30dvh,250px);min-height:0}
 .tools{grid-column:1;grid-row:1;height:48px;min-height:0;max-height:100%;padding:3px 10px}
 .mobile-tool-hint{display:none}
 .studio{grid-column:1;grid-row:2;min-height:0;height:auto}
 .studio-heading{min-height:34px;padding:4px 12px}
 .cloud-strip{min-height:30px;padding:2px 12px}
 .cloud-strip .small-btn{min-height:28px;padding:3px 7px}
 .stage{flex:1;height:auto;min-height:0;padding:8px}
 .studio-footer{min-height:40px;padding:3px 12px}
 .zoom-controls button{height:30px;min-width:30px}
 .studio-footer>span{display:none!important}
 .studio-footer{justify-content:center}
 .properties{grid-column:1;grid-row:3;display:block;padding:0 14px 12px;overflow:auto;min-height:0;max-height:100%;scrollbar-gutter:auto}
 .mobile-panels{width:calc(100% + 28px);margin:0 -14px 12px;padding:0 8px;background:#fbfaf7}
 .mobile-panels button{min-height:42px;font-size:12px}
 .properties [data-mobile-section]{margin-bottom:14px}
 .section-title{margin-bottom:8px}
 .idea-section textarea{min-height:82px;height:82px;line-height:1.5;padding:9px 11px}
 .style-presets{margin:8px 0}.style-presets button{min-height:34px}
 .generation-status{margin:8px 0;font-size:11px}
 .mobile-generate-bar{position:relative;left:auto;right:auto;bottom:auto;flex:0 0 auto;padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));z-index:4}
 .mobile-generate-bar .generate-btn{min-height:48px}
 .selection-bar{max-height:80px;overflow:auto;padding:4px 8px}
 .selection-bar>span{width:auto}
 .selection-bar input{width:48px;padding:3px}
}
@media(min-width:600px) and (max-width:1000px) and (max-height:500px){
 .topbar{height:48px;flex-basis:48px}
 .workspace{grid-template-columns:84px minmax(0,1fr) 270px;grid-template-rows:minmax(0,1fr)}
 .tools{grid-column:1;grid-row:1;display:grid;grid-template-columns:repeat(2,36px);align-content:start;justify-content:center;gap:3px;height:auto;overflow-x:hidden;overflow-y:auto;padding:6px 3px;border-right:1px solid var(--line);border-bottom:0}
 .tools #brushes{display:contents}.tools .tool{width:36px;height:36px}
 .studio{grid-column:2;grid-row:1}
 .properties{grid-column:3;grid-row:1;border-top:0;border-left:1px solid var(--line)}
 .mobile-panels button{font-size:11px}
 .mobile-generate-bar{padding-top:6px;padding-bottom:calc(6px + env(safe-area-inset-bottom,0px))}
 .mobile-generate-bar .generate-btn{min-height:42px}
}

@media(max-width:760px),(max-width:1000px) and (max-height:500px){
 .mobile-panels button[aria-pressed=true]::after{content:'⌄';font-size:12px;margin-left:2px}
 .workspace:has(.properties[data-collapsed=true]){grid-template-rows:48px minmax(0,1fr) 43px}
 .properties[data-collapsed=true] [data-mobile-section]{display:none}
 .properties[data-collapsed=true]{padding-bottom:0;overflow:hidden}
 .properties[data-collapsed=true] .mobile-panels{margin-bottom:0}
}
@media(min-width:600px) and (max-width:1000px) and (max-height:500px){
 .workspace:has(.properties[data-collapsed=true]){grid-template-columns:84px minmax(0,1fr) 84px;grid-template-rows:minmax(0,1fr)}
 .properties[data-collapsed=true]{padding-inline:4px}
 .properties[data-collapsed=true] .mobile-panels{width:100%;margin:0;padding:0;flex-direction:column;border:0}
 .properties[data-collapsed=true] .mobile-panels button{flex:none;min-height:44px}
}
