:root{font-family:"Microsoft YaHei","PingFang SC",sans-serif;color:#292821;background:#f8f6f1;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button,.upload,.upload-inline{cursor:pointer}button{border:0}button:focus-visible,.upload:focus-within,.upload-inline:focus-within{outline:3px solid #cc713d;outline-offset:3px}.header{height:78px;display:flex;justify-content:space-between;align-items:center;max-width:1440px;margin:auto;padding:0 48px;border-bottom:1px solid #e5e1d9}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:#26251f;font-size:19px;font-weight:750}.brand small{display:block;font-size:11px;font-weight:400;color:#79746c;letter-spacing:.12em;margin-top:3px}.brand-mark{width:34px;display:grid;grid-template-columns:repeat(2,14px);gap:4px;transform:rotate(-8deg)}.brand-mark i{width:14px;height:14px;border-radius:50%;background:#e88954}.brand-mark i:nth-child(2){background:#eebf85}.brand-mark i:nth-child(3){background:#90aaa0}.brand-mark i:nth-child(4){background:#d98070}.privacy{font-size:12px;color:#777369}main{max-width:1440px;margin:auto;padding:35px 48px 60px}.intro{display:flex;justify-content:space-between;align-items:end;margin-bottom:27px}.eyebrow{font-size:12px;letter-spacing:.16em;color:#a45a38;font-weight:700;margin:0 0 8px}h1{font-size:36px;letter-spacing:-.03em;margin:0 0 8px}p{line-height:1.65}.intro p:last-child{color:#77736a;margin:0;font-size:14px}.intro-note{color:#9b8f81;font-size:13px}.workspace{display:grid;grid-template-columns:260px minmax(0,1fr);gap:20px;align-items:start}.sidebar,.editor{background:#fff;border:1px solid #e8e4dd;border-radius:14px}.sidebar{padding:0 22px}.sidebar section{padding:22px 0;border-bottom:1px solid #eeeae4}.sidebar section:last-child{border:0}.sidebar h2,.editor h2{font-size:15px;margin:0 0 14px}.upload,.primary{display:inline-flex;align-items:center;justify-content:center;background:#d87443;color:white;border-radius:9px;padding:11px 17px;font-weight:700;font-size:13px}.upload{width:100%}.primary:hover,.upload:hover{background:#bd5e31}.hint{font-size:12px;color:#79746b;margin:10px 0;line-height:1.7}.subtle,.secondary,.tool{background:#f5f3ef;color:#4b4941;border-radius:8px;padding:9px 12px;font-size:12px}.secondary{width:100%;background:#ebe7df;font-weight:700}.subtle:hover,.secondary:hover,.tool:hover{background:#eae4dc}button:disabled{opacity:.45;cursor:not-allowed}.field{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:#57534b;margin:13px 0}.field input{width:58px;padding:6px;border:1px solid #dedbd3;border-radius:6px;text-align:center}.badge{font-size:10px;background:#fff0df;color:#a35b2f;padding:4px 6px;border-radius:5px}.palette{display:flex;gap:8px;flex-wrap:wrap;margin-top:15px}.swatch{width:29px;height:29px;border-radius:50%;border:2px solid #fff;outline:1px solid #dedbd5}.swatch.active{outline:2px solid #a54e2e;outline-offset:2px}.editor{overflow:hidden}.editor-top{padding:23px 25px;display:flex;justify-content:space-between;gap:20px;align-items:center}.editor-top h2{font-size:18px;margin:0 0 5px}.editor-top p{margin:0;color:#898379;font-size:12px}.actions{display:flex;gap:8px;flex-wrap:wrap}.toolbar{display:flex;align-items:center;gap:6px;padding:10px 24px;border-top:1px solid #eeeae4;border-bottom:1px solid #eeeae4}.toolbar span{flex:1}.tool{background:transparent}.tool.selected{background:#faeadd;color:#a34e28;font-weight:700}.canvas-wrap{min-height:440px;padding:28px;display:flex;align-items:center;justify-content:center;background:#f6f4ef;overflow:auto}.canvas-wrap canvas{max-width:100%;height:auto;background:white;box-shadow:0 4px 22px #44332112;touch-action:none;image-rendering:pixelated}.empty{text-align:center;color:#8b8378}.empty h3{font-size:18px;color:#49453e;margin:14px 0 4px}.empty p{font-size:13px;margin:0 0 20px}.pixel-heart{font-size:48px;color:#dda080}.status{padding:12px 25px;border-bottom:1px solid #eeeae4;color:#77736b;font-size:12px}.materials{padding:20px 25px 25px}.materials h3{font-size:14px;margin:0 0 13px}.materials h3 span{font-size:12px;font-weight:400;color:#8b857b;margin-left:8px}.counts{display:flex;flex-wrap:wrap;gap:10px;color:#918a7f;font-size:12px}.count{display:flex;gap:7px;align-items:center;color:#575249;background:#f8f6f2;padding:6px 9px;border-radius:7px}.count i{width:14px;height:14px;border-radius:50%;border:1px solid #0002}footer{max-width:1440px;margin:auto;padding:0 48px 35px;color:#8e877c;font-size:12px}footer span{padding:0 7px}@media(max-width:760px){.header{padding:0 18px;height:68px}.privacy{font-size:11px}main{padding:28px 16px}.intro h1{font-size:29px}.intro-note{display:none}.workspace{display:flex;flex-direction:column}.sidebar,.editor{width:100%}.sidebar{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.sidebar section:last-child{grid-column:1/-1}.editor-top{align-items:start;flex-direction:column}.canvas-wrap{min-height:330px;padding:14px}.actions{width:100%}.actions .primary{margin-left:auto}footer{padding:0 18px 28px}}
:root{--option-accent:#ba5e36}.option{display:flex;align-items:center;gap:8px;font-size:12px;line-height:1.5;color:#57534b;margin:12px 0}.option input{accent-color:var(--option-accent);width:16px;height:16px;flex:none}
#cropPreview{display:block;width:100%;height:auto;background:#eee;touch-action:none;cursor:crosshair;margin-bottom:10px}#cropPanel[hidden]{display:none}.count[aria-pressed="true"]{outline:2px solid #a54e2e;outline-offset:2px}.toolbar{flex-wrap:wrap}
.settings-details summary,.palette-details summary{cursor:pointer;color:#504b42;font-size:13px;font-weight:700;padding:8px 0}.settings-details summary span{font-size:11px;font-weight:400;color:#827a70}.settings-section .secondary{margin-top:12px}.color-controls{padding:14px 24px;border-bottom:1px solid #eeeae4}.color-heading{display:flex;justify-content:space-between;align-items:center;font-size:13px}.color-heading span{color:#855238;font-size:12px}.used-palette{display:flex;align-items:center;gap:10px;overflow-x:auto;padding:8px 3px 12px;scrollbar-width:thin}.used-palette .swatch{flex:0 0 34px;width:34px;height:34px}.palette-details summary{color:#a34e28}.palette-details .palette{max-height:240px;overflow-y:auto;padding:4px}.palette-search{display:flex;align-items:center;gap:9px;font-size:12px;color:#57534b}.palette-search input{min-width:0;width:120px;padding:8px;border:1px solid #dedbd3;border-radius:7px;background:#fff}.palette-details [hidden]{display:none}
@media(max-width:760px){.header{height:62px}.privacy{max-width:110px;text-align:right;line-height:1.4}.intro{margin-bottom:18px}.intro h1{font-size:25px}.intro p:last-child{font-size:13px}.sidebar{display:block;padding:0 16px}.sidebar section{padding:14px 0}.sidebar h2{margin-bottom:10px}.settings-section .secondary{margin-top:8px}.editor-top{padding:16px;gap:12px}.editor-top h2{font-size:16px}.toolbar{padding:8px 12px;gap:4px}.toolbar .tool,.toolbar .subtle{min-height:44px;padding:10px}.toolbar span{display:none}.color-controls{padding:12px 16px}.used-palette{gap:10px}.used-palette .swatch,.palette .swatch{flex:0 0 42px;width:42px;height:42px}.palette{gap:9px}.palette-details summary{min-height:40px;padding:12px 0}.canvas-wrap{min-height:280px;padding:12px}.materials{padding:16px}.count{min-height:40px}.actions button{min-height:42px}#cropPreview{max-width:100%;max-height:220px;width:auto;height:auto;margin-left:auto;margin-right:auto}}
.mobile-dock,.mobile-panel-head,.mobile-sheet-close,.mobile-files{display:none}.crop-actions{display:flex;flex-wrap:wrap;gap:8px}
@media(max-width:760px){
 html,body{height:100%;overflow:hidden}body{height:100vh;height:100dvh;display:flex;flex-direction:column}
 .header{height:52px;min-height:52px;width:100%;padding:0 16px}.brand{font-size:16px}.brand small{font-size:10px}.brand-mark{transform:scale(.85) rotate(-8deg)}
 main{padding:0;width:100%;flex:1;min-height:0;display:flex}.intro,footer{display:none}.workspace{width:100%;flex:1;min-height:0;display:flex;flex-direction:column;gap:0}
 .editor{flex:1;min-height:0;display:flex;flex-direction:column;border:0;border-radius:0}.editor-top{display:none}
 .toolbar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));flex:0 0 auto;overflow:visible;padding:4px 6px;gap:2px}.toolbar .tool,.toolbar .subtle{width:100%;min-width:0;min-height:42px;padding:7px 4px;font-size:12px}.toolbar .toolbar-spacer,.toolbar #zoomLabel{display:none}
 .canvas-wrap{flex:1;min-height:0;overflow:auto;display:flex;justify-content:flex-start;align-items:flex-start;padding:12px;overscroll-behavior:contain}.canvas-wrap canvas{flex:none;max-width:none;max-height:none;margin:auto;touch-action:none}.canvas-wrap .empty{margin:auto}
 .status{flex:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:7px 12px;font-size:11px}
 .mobile-dock{display:grid;width:100%;grid-template-columns:repeat(6,minmax(0,1fr));flex:none;background:#fff;border-top:1px solid #e4ded5;padding:5px 2px calc(5px + env(safe-area-inset-bottom))}.mobile-dock button{min-height:48px;padding:5px 1px;background:transparent;color:#514b43;font-size:11px}.mobile-dock button[aria-pressed="true"]{color:#a34e28;background:#faeadd;border-radius:8px;font-weight:700}.mobile-dock button:disabled{opacity:.4}.mobile-dock span{display:block;font-size:10px;color:#a34e28;margin-top:2px}
 .sidebar{display:none}.sidebar.mobile-open{display:block;position:fixed;z-index:30;top:52px;bottom:calc(60px + env(safe-area-inset-bottom));left:0;right:0;width:auto;overflow-y:auto;overscroll-behavior:contain;background:#fff;border:0;border-radius:0;padding:0 16px 20px}
 .sidebar.mobile-open .source-section,.sidebar.mobile-open .settings-section,.sidebar.mobile-open .mobile-files{display:none}.sidebar.mobile-open[data-active="image"] .source-section,.sidebar.mobile-open[data-active="settings"] .settings-section,.sidebar.mobile-open[data-active="files"] .mobile-files{display:block}
 .mobile-panel-head{display:flex;position:sticky;top:0;z-index:1;align-items:center;justify-content:space-between;background:#fff;border-bottom:1px solid #eeeae4;padding:12px 0}.mobile-panel-head button,.mobile-sheet-close{display:block;background:#f5f3ef;color:#7e462c;padding:9px 12px;border-radius:8px}.mobile-files button{min-height:44px;margin:4px}
 .sidebar.has-source[data-active="image"] .source-section>h2,.sidebar.has-source[data-active="image"] .source-section>.hint{display:none}.sidebar.has-source[data-active="image"] .source-section>.upload{width:auto;min-height:36px;padding:8px 12px;font-size:12px}
 #cropPreview{max-width:100%;max-height:35vh;max-height:35dvh;width:auto;height:auto;margin:0 auto 12px}.crop-actions{position:sticky;bottom:0;background:#fff;padding:10px 0}.crop-actions button{min-height:44px}.crop-actions .primary{flex:1}
 .color-controls,.materials{display:none}.color-controls.mobile-open,.materials.mobile-open{display:block;position:fixed;z-index:30;left:0;right:0;bottom:calc(60px + env(safe-area-inset-bottom));max-height:60vh;max-height:60dvh;overflow-y:auto;overscroll-behavior:contain;background:#fff;border-top:1px solid #ddd6cc;border-radius:14px 14px 0 0;padding:16px}
 .color-heading{gap:10px}.color-heading strong{flex:1}.mobile-material-head{display:flex;align-items:center;justify-content:space-between}.mobile-material-head h3{margin:0}.used-palette .swatch,.palette .swatch{width:44px;height:44px;flex-basis:44px}
}

/* The bead board is the workspace; warm orange stays on small actions and marks. */
:root{color:#252725;background:#f3f3f0;--option-accent:#9d492c}
.header{max-width:none;height:68px;padding:0 32px;background:#fff;border-color:#e3e3df}
.brand{gap:10px;font-size:17px}.brand h1{font-size:17px;line-height:1.15;letter-spacing:0;margin:0;font-weight:750}.brand small{font-size:11px;letter-spacing:0;color:#61635e}
.brand-mark{transform:none}.privacy{font-size:12px;color:#515750}
main{max-width:1600px;padding:24px 32px 40px}.intro{margin-bottom:18px;align-items:center}.intro h2{font-size:24px;margin:0 0 5px;letter-spacing:-.02em}.intro p:last-child{font-size:13px;color:#595d57}.intro .intro-note{color:#595d57}
.workspace{grid-template-columns:250px minmax(0,1fr);gap:16px;align-items:stretch}.sidebar,.editor{border:0;border-radius:8px}.sidebar{padding:0 20px}.sidebar h2,.editor h2{font-size:15px}.editor-top{padding:16px 20px}.editor-top p{color:#5d625a}.actions{align-items:center}
.upload,.primary{background:#292d2a;color:#fff;border-radius:6px;font-size:13px;min-height:40px}.primary:hover,.upload:hover{background:#424a43}
.subtle,.secondary,.tool{background:#eeefeb;color:#333a34;border-radius:6px;font-size:13px}.secondary{background:#e8e9e4}.subtle:hover,.secondary:hover,.tool:hover{background:#dedfd9}.tool{background:transparent}.tool.selected{background:#f8e9e0;color:#80391f}.toolbar{padding:8px 20px;background:#fff}.toolbar #zoomLabel{flex:0 0 auto;min-width:45px;text-align:center;font-size:12px}.toolbar .toolbar-spacer{flex:1}.color-controls{padding:12px 20px}.palette-details summary{color:#823e27}.hint,.status{color:#565e56}.canvas-wrap{min-height:480px;background:#eeefeb}.canvas-wrap canvas{box-shadow:0 2px 8px #2222}.empty{color:#50574f}.empty h3{font-size:19px;color:#262c27}.empty p{font-size:13px;color:#555e55}.empty-blank{display:block;background:transparent;color:#77391f;text-decoration:underline;text-underline-offset:3px;margin:13px auto 0;padding:8px;font-size:13px}
.bead-motif{width:86px;display:grid;grid-template-columns:repeat(3,22px);gap:7px;margin:auto}.bead-motif i{width:22px;height:22px;background:#c06d4b;border:6px solid #e8a988;border-radius:50%}.bead-motif i:nth-child(2),.bead-motif i:nth-child(4),.bead-motif i:nth-child(8){background:#c6ccc0;border-color:#e0e6d9}.bead-motif i:nth-child(3),.bead-motif i:nth-child(7){background:#b88c56;border-color:#ead1a9}.bead-motif i:nth-child(5){background:#8c4430;border-color:#ca805d}
.materials{padding:16px 20px 20px}.count{background:#f0f1ed;color:#363d36}.count i{border-radius:50%}footer{max-width:1600px;padding:0 32px 24px;color:#5d625a}
@media(min-width:761px) and (max-width:1050px){main{padding:20px}.header{padding:0 20px}.workspace{grid-template-columns:210px minmax(0,1fr)}.editor-top{align-items:flex-start;flex-direction:column;gap:10px}.actions{width:100%}.toolbar{gap:2px;padding:8px 12px}.toolbar .subtle,.toolbar .tool{padding:9px 8px}}
@media(max-width:760px){.header{height:52px;min-height:52px;padding:0 16px}.brand h1{font-size:16px}.brand small{display:none}.brand-mark{transform:scale(.82);transform-origin:left center;margin-right:-4px}.privacy{font-size:11px;max-width:130px;color:#555e55}main{padding:0}.editor{border-radius:0}.toolbar{padding:4px 6px}.toolbar .tool,.toolbar .subtle{font-size:12px}.canvas-wrap{min-height:0;background:#eeefeb}.status{padding:7px 16px;color:#505a51}.mobile-dock{background:#fff}.mobile-dock button{font-size:12px;color:#3d453e}.mobile-dock button[aria-pressed="true"]{background:#f8e9e0;color:#80391f}.mobile-dock span{color:#80391f}.sidebar.mobile-open,.color-controls.mobile-open,.materials.mobile-open{background:#fff}.mobile-panel-head button,.mobile-sheet-close{color:#333a34}.bead-motif{width:68px;grid-template-columns:repeat(3,18px);gap:6px}.bead-motif i{width:18px;height:18px;border-width:5px}.empty h3{font-size:18px}.empty-blank{min-height:44px;margin-top:4px}.crop-actions{background:#fff}}
.counts,.settings-details summary span{color:#555e55}.hint,.status,.settings-details summary,.palette-details summary,.field,.option,.palette-search,.counts{font-size:13px}
@media(max-width:760px){.status{font-size:12px}}

/* Workbench: the image and grid lead; tools stay within thumb reach. */
:root{--ink:#30342e;--muted:#5f695f;--accent:#b84e31;--accent-soft:#f9e8dc;--surface:#fffdfa;--ground:#f2f0eb;--line:#e4e1da;color:var(--ink);background:var(--ground)}
.header{background:var(--surface);border-color:var(--line)}.brand-mark i:first-child,.brand-mark i:nth-child(4){background:#c76342}.brand-mark i:nth-child(2){background:#e9ae6d}.brand-mark i:nth-child(3){background:#83a698}
.header-actions{display:flex;align-items:center;gap:18px}.ai-open{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 12px;background:#f8e9dd;color:#80371f;border-radius:9px;font-size:13px;font-weight:700}.ai-open svg,.ai-head svg,.mobile-dock svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.ai-open svg{fill:currentColor;stroke:none}
.intro h2{font-size:23px}.sidebar,.editor{background:var(--surface)}.upload,.primary{background:#a8442b;color:white}.primary:hover,.upload:hover{background:#87351f}.tool.selected{background:#f8e9df;color:#83381f}.subtle,.secondary{background:#efeee9;color:#343a34}.toolbar{background:var(--surface)}.color-controls{background:var(--surface)}.canvas-wrap{background:#e8e9e3}.canvas-wrap canvas{box-shadow:0 3px 14px #3333}.empty h3{font-size:20px}.empty p{font-size:14px}.empty-blank{color:#873a25}.status{color:#515a51}.mobile-project{display:none}.show-codes{display:flex;align-items:center;gap:8px;color:#414940;font-size:13px;margin:10px 0 14px}.show-codes input{width:17px;height:17px;accent-color:#a8442b}
.ai-panel[hidden]{display:none}.ai-panel{position:fixed;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;padding:20px}.ai-scrim{position:absolute;inset:0;background:#1c2620a8}.ai-sheet{position:relative;width:min(620px,100%);max-height:min(760px,90dvh);overflow:auto;background:#fffdfa;border-radius:18px;padding:26px;box-shadow:0 16px 50px #1b252133}.ai-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.ai-head h2{font-size:24px;line-height:1.3;margin:3px 0 0}.ai-label{font-size:13px;font-weight:700;color:#a8442b;margin:0}.ai-head button{width:40px;height:40px;display:grid;place-items:center;border-radius:9px;background:#f1efeb;color:#343a34;flex:none}.ai-intro{margin:12px 0 20px;color:#596259;font-size:14px}.ai-options{display:grid;gap:8px}.ai-option{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;padding:13px 15px;background:#f3f2ee;border:2px solid transparent;border-radius:10px;color:#303a32}.ai-option.selected{background:#fff2e9;border-color:#bd6041}.ai-option strong{font-size:14px}.ai-option span{font-size:12px;color:#596259}.ai-detail{margin-top:15px;padding:15px;background:#f7f6f1;border-radius:10px}.ai-detail strong{font-size:14px}.ai-detail p{font-size:13px;color:#4d574e;margin:7px 0}.ai-availability{font-weight:700;color:#7d4b2b!important}.ai-footer{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:16px}.ai-footer p{max-width:390px;font-size:12px;line-height:1.6;color:#586057;margin:0}.ai-footer button{flex:none}
@media(max-width:760px){.header{background:var(--surface)}.header-actions{gap:6px}.privacy{display:none}.ai-open{min-height:36px;padding:0 10px;font-size:12px}.ai-open svg{width:16px;height:16px}.mobile-project:not([hidden]){display:flex;align-items:center;justify-content:space-between;flex:none;padding:6px 16px;background:#fffdfa;color:#596259;font-size:12px;font-variant-numeric:tabular-nums}.toolbar{background:#fffdfa}.canvas-wrap{background:#e8e9e3}.status{background:#fffdfa}.mobile-dock{background:#fffdfa;padding:3px 2px calc(3px + env(safe-area-inset-bottom))}.mobile-dock button{display:flex;min-height:52px;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px}.mobile-dock button span{font-size:11px;margin:0;color:inherit}.mobile-dock button b{font-size:10px;font-weight:600}.mobile-dock button[aria-pressed="true"]{background:#fae8de;color:#87371f}.mobile-dock svg{width:19px;height:19px}.sidebar.mobile-open{bottom:calc(60px + env(safe-area-inset-bottom))}.ai-panel{padding:0;align-items:flex-end}.ai-sheet{width:100%;max-height:90dvh;border-radius:18px 18px 0 0;padding:20px 18px calc(18px + env(safe-area-inset-bottom))}.ai-head h2{font-size:21px}.ai-intro{margin:8px 0 14px}.ai-option{padding:10px 12px}.ai-footer{align-items:stretch;flex-direction:column;gap:12px}.ai-footer button{width:100%}}
@media(max-width:760px) and (max-height:640px){.ai-sheet{max-height:96dvh;padding:12px 16px calc(12px + env(safe-area-inset-bottom))}.ai-head h2{font-size:19px}.ai-label{font-size:12px}.ai-head button{width:36px;height:36px}.ai-intro{margin:5px 0 9px;font-size:13px}.ai-options{gap:5px}.ai-option{padding:7px 10px;gap:2px}.ai-detail{margin-top:8px;padding:9px 11px}.ai-detail p{margin:4px 0;font-size:12px}.ai-footer{margin-top:8px;gap:7px}.ai-footer p{font-size:11px;line-height:1.4}.ai-footer button{min-height:36px;padding:8px}}
@media(max-width:760px){.mobile-dock button b{font-size:11px}.mobile-dock button,.mobile-dock button span{font-size:12px}}

/* Desktop and tablet: zoomed art is scrollable instead of being constrained by max-width. */
@media(min-width:761px){.canvas-wrap{height:clamp(360px,55vh,620px);min-height:360px;justify-content:flex-start;align-items:flex-start;overscroll-behavior:contain}.canvas-wrap canvas{flex:none;max-width:none;max-height:none;margin:auto}.canvas-wrap .empty{margin:auto}}

/* Desktop editor: image controls, board, colors and quantities share one viewport. */
.sidebar-credit{display:none}
@media(min-width:761px){
 html,body{height:100%;overflow:hidden}body{height:100vh;height:100dvh;display:flex;flex-direction:column;background:#f2f0eb}
 .header{width:100%;margin:0;height:54px;min-height:54px;padding:0 20px}.brand small{display:none}.brand-mark{transform:scale(.8);transform-origin:left center;margin-right:-4px}
 main{max-width:none;width:100%;padding:8px;flex:1;min-height:0;display:flex}.intro,footer{display:none}.workspace{display:grid;width:100%;height:100%;min-height:0;grid-template-columns:240px minmax(0,1fr);gap:8px;align-items:stretch}
 .sidebar{min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 16px}.sidebar section{padding:15px 0}.sidebar h2{margin-bottom:10px}.sidebar-credit{display:block;font-size:12px;color:#596259}.sidebar-credit a{color:#80371f}
 .editor{display:grid;min-width:0;min-height:0;grid-template-columns:minmax(0,1fr) 220px;grid-template-rows:auto auto minmax(110px,auto) minmax(0,1fr) auto;overflow:hidden}
 .editor-top{grid-column:1 / -1;grid-row:1;display:flex;flex-direction:row;align-items:center;gap:12px;padding:10px 14px}.editor-top h2{font-size:15px}.editor-top p{font-size:12px}.actions{width:auto;justify-content:flex-end;gap:5px}.actions button{white-space:nowrap;min-height:36px;padding:7px 10px}
 .toolbar{grid-column:1 / -1;grid-row:2;min-width:0;flex-wrap:nowrap;padding:6px 12px}.toolbar .tool,.toolbar .subtle{min-height:36px;white-space:nowrap}.toolbar .toolbar-spacer{min-width:0}
 .color-controls{grid-column:2;grid-row:3;min-width:0;max-height:33vh;overflow:auto;padding:12px;background:#fffdfa}.color-heading{gap:8px}.used-palette{flex-wrap:wrap;max-height:86px;overflow:auto;gap:6px}.used-palette .swatch{width:30px;height:30px;flex-basis:30px}.palette-details .palette{max-height:135px}
 .materials{grid-column:2;grid-row:4;min-width:0;min-height:0;overflow:auto;padding:12px;background:#fffdfa}.materials h3{line-height:1.5}.counts{gap:6px}.count{padding:7px 8px}.show-codes{line-height:1.4}
 .canvas-wrap{grid-column:1;grid-row:3 / 5;min-height:0;height:auto;max-height:none;padding:16px;background:#e8e9e3}.status{grid-column:1 / -1;grid-row:5;padding:7px 14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
}
@media(min-width:761px) and (max-width:1050px){.workspace{grid-template-columns:195px minmax(0,1fr)}.editor{grid-template-columns:minmax(0,1fr) 180px}.sidebar{padding:0 12px}.editor-top{flex-direction:row;align-items:center}.editor-top h2{font-size:14px}.actions button{font-size:12px;padding:6px 8px}.toolbar .tool,.toolbar .subtle{padding:7px 8px}.toolbar{gap:2px}.color-controls,.materials{padding:10px}.counts{gap:5px}}

/* A short labeled palette stays beside the board; the full catalog has one scroll area. */
[hidden]{display:none!important}.color-controls .used-palette{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;max-height:none;overflow:visible;padding:10px 0}.color-choice{min-width:0;min-height:42px;display:flex;align-items:center;justify-content:flex-start;gap:6px;padding:5px 6px;background:#f2f1ed;border:1px solid transparent;border-radius:7px;color:#30342e;font-size:12px;font-weight:600}.color-choice i{width:22px;height:22px;flex:none;border-radius:50%;border:1px solid #0003}.color-choice.active{border-color:#a8442b;background:#fae9df}.color-choice:focus-visible,.palette-open:focus-visible,.palette-dialog button:focus-visible,.palette-dialog input:focus-visible{outline:3px solid #a8442b;outline-offset:2px}.palette-open{width:100%;display:flex;justify-content:space-between;align-items:center;min-height:40px;padding:8px 10px;background:#f3f2ed;border-radius:7px;color:#80371f;font-size:13px;font-weight:700}.materials-empty{font-size:13px;color:#596259;line-height:1.5;margin:10px 0}.palette-dialog{border:0;border-radius:14px;padding:0;width:min(640px,calc(100% - 32px));height:min(690px,calc(100% - 48px));max-height:none;color:#30342e;background:#fffdfa;box-shadow:0 12px 40px #171d1938}.palette-dialog::backdrop{background:#1c26209c}.palette-dialog-shell{height:100%;display:flex;flex-direction:column;min-height:0}.palette-dialog-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;padding:20px 20px 10px}.palette-dialog-head h2{font-size:20px;margin:0}.palette-dialog-head p{font-size:12px;color:#596259;margin:5px 0 0}.palette-dialog-head button{min-height:40px;padding:8px 12px;background:#eeefeb;border-radius:7px;color:#30342e}.palette-dialog .palette-search{display:flex;gap:10px;padding:4px 20px 14px;font-size:13px;white-space:nowrap;color:#343b34}.palette-dialog .palette-search input{flex:1;width:auto;min-width:0;padding:10px 12px;border:1px solid #c8cbc4;border-radius:7px}.palette-results{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 20px 20px}.palette-dialog .palette{display:grid;grid-template-columns:repeat(auto-fill,minmax(94px,1fr));gap:7px;margin:0}.palette-dialog .color-choice{min-height:44px}.palette-dialog .color-choice i{width:26px;height:26px}.count[aria-pressed="true"]{outline:2px solid #a8442b;background:#fae9df}.counts .count{min-height:36px;font-size:13px}
@media(min-width:761px){.color-controls .used-palette{grid-template-columns:repeat(2,minmax(0,1fr))}.color-controls{max-height:none!important;overflow:visible!important}.editor{grid-template-rows:auto auto auto minmax(0,1fr) auto}.materials{overflow:auto}.color-heading{font-size:13px}.color-heading span{white-space:nowrap}.color-controls .palette-open{margin-top:2px}}
@media(max-width:760px){.color-controls .used-palette{grid-template-columns:repeat(3,minmax(0,1fr))}.color-controls .color-choice{min-height:44px;font-size:13px}.palette-dialog{width:100%;height:min(86dvh,720px);max-width:none;position:fixed;bottom:0;top:auto;margin:0;border-radius:14px 14px 0 0}.palette-dialog-head{padding:16px 16px 8px}.palette-dialog .palette-search{padding:4px 16px 12px}.palette-results{padding:0 16px calc(16px + env(safe-area-inset-bottom))}.palette-dialog .palette{grid-template-columns:repeat(3,minmax(0,1fr))}.palette-dialog .color-choice{min-height:48px}}

/* Keep the workbench scrollable without browser scrollbar chrome. */
.sidebar,.materials,.color-controls,.palette-results,.ai-sheet,.canvas-wrap{scrollbar-width:none;-ms-overflow-style:none}
.sidebar::-webkit-scrollbar,.materials::-webkit-scrollbar,.color-controls::-webkit-scrollbar,.palette-results::-webkit-scrollbar,.ai-sheet::-webkit-scrollbar,.canvas-wrap::-webkit-scrollbar{display:none;width:0;height:0}

.palette-dialog-head button{flex:none;white-space:nowrap}.palette-results:focus-visible,.sidebar:focus-visible,.materials:focus-visible,.canvas-wrap:focus-visible{outline:2px solid #a8442b;outline-offset:-2px}

.crop-instructions{font-size:13px;line-height:1.55;color:#39433b;margin:10px 0}.generation-feedback{font-size:12px;line-height:1.5;color:#465247;margin:9px 0 0;overflow-wrap:anywhere}#cropStatus{color:#39433b;font-size:12px;line-height:1.5}.crop-actions button{white-space:nowrap}
@media(max-width:760px){.crop-instructions{font-size:12px;margin:6px 0}.generation-feedback{font-size:13px}.crop-actions{gap:6px}.crop-actions button{padding-left:10px;padding-right:10px}}

@media(max-width:760px) and (max-height:600px){#cropPreview{max-height:31dvh}#cropStatus{margin:5px 0}.crop-actions{padding:6px 0}}

.simplify-open{display:block;width:100%;min-height:40px;margin:10px 0;background:#f4e6dc;color:#80371f;border-radius:7px;font-size:13px;font-weight:700}.simplify-dialog{border:0;border-radius:14px;padding:0;width:min(760px,calc(100% - 32px));max-height:min(90dvh,760px);background:#fffdfa;color:#30342e;box-shadow:0 12px 40px #171d1938}.simplify-dialog::backdrop{background:#1c26209c}.simplify-shell{padding:20px;overflow:auto;max-height:min(90dvh,760px);scrollbar-width:none;-ms-overflow-style:none}.simplify-shell::-webkit-scrollbar{display:none}.simplify-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.simplify-head h2{margin:0;font-size:20px}.simplify-head p,.simplify-note,.simplify-hint{color:#4e584e;font-size:13px;line-height:1.5;margin:6px 0}.simplify-head button,.simplify-actions button:not(.primary){background:#eeefeb;color:#30342e;border-radius:7px;min-height:40px;padding:8px 14px;white-space:nowrap}.simplify-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}.simplify-controls label{display:grid;gap:5px;font-size:13px;font-weight:700}.simplify-controls select{width:100%;min-width:0;height:42px;padding:7px;border:1px solid #c8cbc4;border-radius:7px;background:#fff;font:inherit;color:#30342e}.simplify-controls select:disabled{opacity:.5}.simplify-comparison{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}.simplify-comparison figure{min-width:0;margin:0;padding:8px;background:#f1f1ec;border-radius:8px;text-align:center}.simplify-comparison figcaption{text-align:left;font-size:13px;font-weight:700;margin-bottom:6px}.simplify-comparison canvas{display:block;width:auto;height:auto;max-width:100%;max-height:36dvh;margin:auto;background:#fff;image-rendering:auto}.simplify-note{margin-top:10px}.simplify-error{color:#a1261c;font-size:13px}.simplify-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.simplify-actions .primary{min-width:140px}.simplify-dialog button:focus-visible,.simplify-dialog select:focus-visible{outline:3px solid #a8442b;outline-offset:2px}@media(max-width:760px){.simplify-dialog{width:100%;max-width:none;max-height:92dvh;position:fixed;bottom:0;top:auto;margin:0;border-radius:14px 14px 0 0}.simplify-shell{padding:16px 16px calc(16px + env(safe-area-inset-bottom));max-height:92dvh}.simplify-head h2{font-size:18px}.simplify-controls{margin-top:9px}.simplify-comparison canvas{max-height:25dvh}.simplify-actions .primary{flex:1}.simplify-open{margin:7px 0}}

@media(max-width:760px){.sidebar.mobile-open .source-section>.upload,.sidebar.mobile-open .source-section>.simplify-open{display:inline-flex;align-items:center;justify-content:center;width:auto;min-height:38px;padding:8px 10px;vertical-align:middle}.sidebar.mobile-open .source-section>.simplify-open{margin:0 0 0 6px}}

.simplify-background{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:13px;font-weight:700}.simplify-background input{width:17px;height:17px;accent-color:#a8442b}.simplify-background-note{font-size:12px;line-height:1.4;color:#4e584e;margin:4px 0}.simplify-comparison canvas{image-rendering:pixelated;width:100%;height:auto;object-fit:contain}.simplify-shell{scrollbar-width:none}.simplify-shell::-webkit-scrollbar{display:none}

@media(max-width:760px){.simplify-actions{position:sticky;bottom:0;background:#fffdfa;padding:8px 0 0}.simplify-comparison canvas{max-height:20dvh}}

@media(max-width:760px){.simplify-note{display:none}}

/* Keep the extra editing tools accessible without visible browser scrollbars. */
.recovery-state{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(max-width:760px){.toolbar{grid-template-columns:repeat(6,minmax(0,1fr))}.toolbar .tool,.toolbar .subtle{min-height:38px;font-size:12px}.toolbar #zoomOut,.toolbar #zoomIn,.toolbar #undo,.toolbar #redo{grid-column:span 1}}
@media(min-width:761px) and (max-width:1050px){.toolbar .tool,.toolbar .subtle{padding-left:5px;padding-right:5px;font-size:12px}}

.recovery-note{font-size:12px;line-height:1.5;color:#505a51;margin:12px 0 5px}.recovery-clear{padding:5px 0;background:transparent;color:#80371f;font-size:12px;text-decoration:underline;text-underline-offset:3px}

/* Optional subject mask: the image stays on the device. */
.smart-cutout{display:flex;align-items:center;justify-content:space-between;gap:10px}.mask-edit-open{min-height:36px;padding:6px 10px;background:#f4e6dc;color:#80371f;border-radius:6px;font-size:13px;font-weight:700}.mask-dialog{border:0;border-radius:14px;padding:0;width:min(620px,calc(100% - 32px));max-height:92dvh;background:#fffdfa;color:#30342e;box-shadow:0 12px 40px #171d1938}.mask-dialog::backdrop{background:#1c26209c}.mask-shell{display:flex;flex-direction:column;gap:12px;padding:18px;max-height:92dvh}.mask-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.mask-head h2{font-size:19px;margin:0}.mask-head p{font-size:13px;color:#4e584e;margin:4px 0 0}.mask-head button,.mask-tools button{min-height:40px;padding:8px 12px;background:#eeefeb;color:#30342e;border-radius:6px}.mask-tools{display:flex;gap:6px;flex-wrap:wrap}.mask-tools button[aria-pressed="true"]{background:#a8442b;color:#fff}.mask-stage{min-height:0;display:flex;justify-content:center;align-items:center;flex:1;background:#e8e9e3;overflow:hidden}.mask-stage canvas{display:block;max-width:100%;max-height:55dvh;width:auto;height:auto;touch-action:none;cursor:crosshair}.mask-shell>.primary{align-self:flex-end;min-width:120px}.mask-dialog button:focus-visible,.mask-edit-open:focus-visible{outline:3px solid #a8442b;outline-offset:2px}@media(max-width:760px){.mask-dialog{position:fixed;inset:0;width:100%;max-width:none;max-height:100dvh;height:100dvh;margin:0;border-radius:0}.mask-shell{height:100dvh;max-height:none;padding:14px 14px calc(14px + env(safe-area-inset-bottom))}.mask-stage canvas{max-height:100%;max-width:100%}.mask-shell>.primary{align-self:stretch}.smart-cutout .simplify-background{margin-top:6px}.simplify-comparison canvas{max-height:16dvh}}

.mask-brush{display:flex;align-items:center;gap:10px;font-size:13px;color:#39433b}.mask-brush input{flex:1;max-width:220px;accent-color:#a8442b}

.preview-size{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:10px;font-size:13px;color:#39433b}.preview-size label{font-weight:700}.preview-size input{width:62px;padding:6px;border:1px solid #c8cbc4;border-radius:6px;text-align:center}.preview-size output{margin-left:auto;color:#80371f;font-variant-numeric:tabular-nums}@media(max-width:760px){.preview-size{margin-top:6px;gap:5px;font-size:12px}.preview-size input{padding:5px;width:54px}.preview-size output{margin-left:0}}

@media(max-width:760px){#uniformGroup .simplify-background-note,.simplify-hint,.preview-size span{display:none}.simplify-head p{font-size:12px}.simplify-comparison canvas{max-height:20dvh}}

/* The left rail describes what has happened and exposes only useful next actions. */
.source-feedback{font-size:13px;line-height:1.5;color:#3f4c40;margin:8px 0}.source-feedback[data-state="working"]{color:#80371f}.source-feedback[data-state="error"]{color:#9c251c}.crop-title{font-size:13px;margin:16px 0 4px;color:#303b32}.crop-title span{font-size:12px;font-weight:400;color:#596259;margin-left:4px}.source-extras{margin-top:14px;font-size:13px;color:#465247}.source-extras summary{cursor:pointer;min-height:40px;display:flex;align-items:center;gap:6px;font-weight:600}.source-extras summary::before{content:'+';font-size:18px;font-weight:400}.source-extras[open] summary::before{content:'−'}.source-extras .subtle{min-height:40px}.crop-actions:empty{display:none}.crop-actions button[hidden]{display:none}.source-section .upload[aria-busy="true"]{opacity:.7}.generation-feedback{font-size:13px}.sidebar{scrollbar-width:none}.sidebar::-webkit-scrollbar{display:none}@media(max-width:760px){.source-feedback{font-size:13px;margin:7px 0}.crop-title{margin-top:10px}.source-extras{margin-top:8px}.crop-actions{padding:6px 0}.crop-actions:has(button:not([hidden])){display:flex}.crop-actions button{min-height:42px}.sidebar.has-source[data-active="image"] .source-section>h2{display:block}}

@media(max-width:760px) and (max-height:600px){.sidebar.has-source[data-active="image"] .source-section>h2{display:none}#cropPreview{max-height:24dvh;margin-bottom:5px}.crop-title{margin-top:5px}.crop-instructions{line-height:1.35;margin:3px 0}.source-feedback{margin:4px 0}.sidebar.mobile-open .source-section{padding-top:8px}}

/* 小圆子：画板优先，工具和用豆清单围绕作品。 */
:root{--ground:#fff6e9;--surface:#fffaf2;--line:#ecdcca;--accent:#e95d05;--ink:#50301f;--muted:#745d4f;--option-accent:#e95d05;color:var(--ink);background:var(--ground)}
body{background:var(--ground)}.header{background:#fff8ed;border-color:#f0dfce}.brand,.brand h1{color:#58301c}.brand-mark i:first-child,.brand-mark i:nth-child(4){background:#f2730b}.brand-mark i:nth-child(2){background:#ffc64a}.brand-mark i:nth-child(3){background:#6bc6b5}
.upload,.primary{background:#eb6509;color:#fff;border-radius:12px}.primary:hover,.upload:hover{background:#c94d00}.subtle,.secondary{background:#f8eee0;color:#573a29;border-radius:10px}.subtle:hover,.secondary:hover,.tool:hover{background:#f9e2cb}.tool.selected{background:#ed680c;color:#fff}.ai-open,.desktop-settings{background:#c8eee5;color:#12695b}.sidebar,.editor,.toolbar,.color-controls,.materials,.status{background:#fffaf2}.canvas-wrap{background:#f6e8d6}.canvas-wrap canvas{box-shadow:0 2px 12px #83572320}.empty h3{color:#5b321d}.empty p,.status,.hint{color:#705b4e}.empty-blank{color:#9e480d}.color-choice,.palette-open,.count{background:#fbf1e4;color:#563925}.color-choice.active,.count[aria-pressed="true"]{border-color:#ef740d;background:#fff0dd}.palette-open{color:#a3470b}.bead-motif i{background:#e27211;border-color:#ffbc4c}.bead-motif i:nth-child(2),.bead-motif i:nth-child(4),.bead-motif i:nth-child(8){background:#4eaa9d;border-color:#a6ded0}.bead-motif i:nth-child(3),.bead-motif i:nth-child(7){background:#e9a931;border-color:#ffe17d}
.desktop-action{display:none}
@media(min-width:761px){
 .header{height:58px;min-height:58px;padding:0 20px}.header-actions{gap:8px}.privacy{display:none}.desktop-action{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 18px;border-radius:12px;font-weight:700;font-size:14px}.desktop-upload{background:#ed680c;color:white}.desktop-settings{background:#c8eee5;color:#12695b}
 main{padding:10px}.workspace{display:block;position:relative}.sidebar{display:none}.sidebar.mobile-open{display:block;position:fixed;z-index:30;left:10px;top:66px;bottom:10px;width:min(330px,calc(100vw - 20px));height:auto;overflow:auto;background:#fffaf2;border:1px solid #ecdcca;border-radius:14px;box-shadow:0 12px 40px #57341b30;padding:0 18px}.sidebar.mobile-open .mobile-panel-head{display:flex;position:sticky;top:0;z-index:1;justify-content:space-between;align-items:center;padding:12px 0;background:#fffaf2;border-bottom:1px solid #ecdcca}.sidebar.mobile-open .mobile-panel-head button{display:block;background:#f8eee0;color:#573a29;border-radius:8px;padding:9px}
 .editor{height:100%;display:grid;grid-template-columns:120px minmax(0,1fr) 240px;grid-template-rows:auto minmax(0,1fr) auto;gap:0 10px;background:transparent;overflow:hidden}.editor-top{grid-column:1 / -1;grid-row:1;min-width:0;padding:0 0 8px;min-height:48px}.editor-top h2{color:#56301d}.editor-top p{color:#705b4e}.actions{flex-wrap:nowrap}.actions button{min-height:40px}.actions .primary{padding:8px 18px}
 .toolbar{grid-column:1;grid-row:2;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;justify-content:flex-start;gap:5px;padding:10px;background:#fffaf2;border:1px solid #f0e1d0;border-radius:15px;overflow:auto}.toolbar .tool,.toolbar .subtle{min-height:42px;width:100%;padding:7px 5px;font-size:13px;font-weight:700}.toolbar .toolbar-spacer{display:none}.toolbar #zoomLabel{display:block;flex:0 0 auto;padding:3px;text-align:center}.toolbar #zoomOut,.toolbar #zoomIn{min-height:32px}.canvas-wrap{grid-column:2;grid-row:2;min-width:0;min-height:0;padding:12px;border-radius:15px;background:#f7ead9}.color-controls{grid-column:3;grid-row:2;align-self:start;z-index:1;border:1px solid #f0e1d0;border-radius:15px 15px 0 0;padding:12px}.materials{grid-column:3;grid-row:2;align-self:stretch;margin-top:225px;border:1px solid #f0e1d0;border-top:0;border-radius:0 0 15px 15px;overflow:auto;padding:12px}.color-controls .used-palette{grid-template-columns:repeat(2,minmax(0,1fr))}.counts{display:flex;flex-direction:column;gap:4px}.counts .count{width:100%;min-height:34px;text-align:left}.status{grid-column:1 / -1;grid-row:3;padding:6px 12px;background:transparent}
}
@media(min-width:761px) and (max-width:1050px){.editor{grid-template-columns:92px minmax(0,1fr) 190px}.toolbar{padding:7px}.toolbar .tool,.toolbar .subtle{font-size:12px;padding:6px 3px}.color-controls,.materials{padding:9px}.header{padding:0 12px}.desktop-action{padding:0 12px}.actions button{padding:6px}.editor-top h2{font-size:13px}}
@media(max-width:760px){.desktop-action{display:none}.header,.toolbar,.status,.mobile-dock,.mobile-project:not([hidden]){background:#fff9ef}.mobile-dock button[aria-pressed="true"]{background:#ffe5c6;color:#a34300}.mobile-dock button,.mobile-dock span{color:#604435}.canvas-wrap{background:#f6e8d6}.sidebar.mobile-open,.color-controls.mobile-open,.materials.mobile-open{background:#fffaf2}.mobile-panel-head,.crop-actions{background:#fffaf2}.toolbar .tool.selected{background:#ed680c;color:#fff}.upload,.primary{border-radius:12px}.mobile-dock{border-color:#efdcc6}.status{color:#705b4e}}
/* Artwork-led design: compact tools frame a generous, usable board. */
:root{--surface:#fff9ef;--ground:#fff4e5;--ink:#56301e;--line:#f0dfce;--accent:#fa7200;color:var(--ink);background:var(--ground)}
.header{height:68px;min-height:68px;padding:0 22px;border-color:#f0decb;background:#fff7ec}.brand h1{font-size:20px;font-weight:800}.brand{gap:12px}.brand-mark{transform:scale(1);margin:0}.header-actions{gap:10px}.desktop-action,.ai-open,.primary,.upload{border-radius:15px;font-size:14px;font-weight:750}.desktop-upload,.primary,.upload{background:#ff7400}.desktop-settings,.ai-open{background:#c8eee4;color:#075e50}.editor,.sidebar,.toolbar,.color-controls,.materials{background:#fff9ef}.editor{border-radius:0}.editor-top h2{font-size:15px}.editor-top p{color:#765d4e}.actions button{border-radius:12px}.actions .primary{background:#ff7400}.canvas-wrap{background:#f6e8d6;border-radius:18px}.canvas-wrap canvas{box-shadow:0 3px 12px #6742261c}.status{color:#705847}.tool-icon{width:22px;height:22px;display:block;flex:none}.tool.selected .tool-icon{filter:brightness(0) invert(1)}.zoom-bar{display:flex;align-items:center;justify-content:center;gap:0;align-self:center;justify-self:center;background:#fff9ef;border:1px solid #eedbc7;border-radius:15px;overflow:hidden;height:42px}.zoom-bar button{min-width:46px;height:40px;background:transparent;display:grid;place-items:center}.zoom-bar button .tool-icon{width:21px;height:21px}.zoom-bar button{font-size:0}.zoom-bar #zoomLabel{min-width:62px;text-align:center;font-size:14px;font-weight:700}.zoom-bar button:disabled{opacity:.42}.mascot-cat{display:block;width:min(220px,53vw);height:auto;margin:12px auto}.empty h3{font-size:30px;line-height:1.25;color:#61341d;margin:0;font-weight:800}.empty h3 span{color:#ef6700}.empty p{margin:8px 0 16px}.empty-secondary{display:flex;gap:10px;justify-content:center;margin-top:12px}.empty-blank,.example-start{min-height:44px;min-width:112px;margin:0;padding:10px 18px;text-decoration:none;border-radius:14px;font-size:14px;font-weight:700}.example-start{background:#bcebe1;color:#075c50}.empty-blank{background:#ffe091;color:#69420a}.color-choice i,.count i{border-radius:50%;box-shadow:inset 0 0 0 4px #ffffff38}.count{min-height:43px!important;font-size:14px!important;background:transparent;border-bottom:1px solid #efe2d3;border-radius:0}.count i{width:24px;height:24px}.palette-open{background:#e0f4ee;color:#087263}.mobile-result-actions{display:none}
@media(min-width:761px){
 .header{height:68px;min-height:68px}.workspace{height:100%}.editor{grid-template-columns:104px minmax(0,1fr) 250px;grid-template-rows:48px 50px minmax(0,1fr) 25px;gap:0 12px}.editor-top{grid-column:1/-1;grid-row:1}.toolbar{grid-column:1;grid-row:2/4;gap:6px;padding:10px;border-radius:18px;align-items:stretch}.toolbar .tool,.toolbar #undo,.toolbar #redo{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;min-height:54px;border-radius:13px;font-size:12px}.toolbar .tool:nth-of-type(n+4),.toolbar #redo{min-height:36px;flex-direction:row}.toolbar .tool:nth-of-type(n+4) .tool-icon,.toolbar #redo .tool-icon{width:17px;height:17px}.toolbar #undo .tool-icon{width:21px}.zoom-bar{grid-column:2;grid-row:2;z-index:1}.canvas-wrap{grid-column:2;grid-row:3;padding:10px}.color-controls{grid-column:3;grid-row:2/4;align-self:start;z-index:1;height:210px;border-radius:18px 18px 0 0;padding:12px}.materials{grid-column:3;grid-row:2/4;margin-top:210px;border-radius:0 0 18px 18px;padding:12px}.color-heading strong,.materials h3{font-size:15px}.color-controls .used-palette{gap:5px;padding:8px 0}.color-choice{min-height:38px}.color-choice i{width:25px;height:25px}.materials .hint{font-size:12px}.show-codes{font-size:12px;margin:5px 0}.status{grid-row:4;grid-column:1/-1}.empty .upload-inline{min-width:190px;min-height:48px;font-size:16px}.empty .mascot-cat{width:160px}.empty h3{font-size:26px}
}
@media(min-width:761px) and (max-width:1050px){.editor{grid-template-columns:88px minmax(0,1fr) 210px;gap:0 8px}.toolbar{padding:7px}.toolbar .tool,.toolbar #undo{min-height:49px}.toolbar .tool:nth-of-type(n+4){min-height:34px}.header{padding:0 12px}.brand h1{font-size:18px}.desktop-action{padding:0 13px}.color-controls,.materials{padding:10px}}
@media(max-width:760px){
 .header{height:58px;min-height:58px;padding:0 16px}.brand h1{font-size:18px}.brand-mark{transform:scale(.9);margin-right:0}.ai-open{border-radius:12px}.workspace,.editor{background:#fff7ec}.toolbar{gap:4px;padding:5px 8px}.toolbar .tool,.toolbar #undo,.toolbar #redo{min-height:50px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;font-size:11px;border-radius:10px}.toolbar .tool-icon{width:18px;height:18px}.toolbar #undo .tool-icon,.toolbar #redo .tool-icon{width:18px;height:18px}.zoom-bar{height:36px;margin:5px auto;flex:none}.zoom-bar button{height:34px;min-width:42px}.zoom-bar #zoomLabel{font-size:12px}.canvas-wrap{border-radius:0;background:#f8ecdd}.status{background:#fff7ec}.mobile-result-actions{display:none}.mobile-dock{background:#fff9ef}.empty{width:100%;padding:12px 15px}.empty h3{font-size:31px;line-height:1.24}.empty .mascot-cat{width:min(230px,55vw);margin:15px auto}.empty .upload-inline{width:min(100%,330px);min-height:56px;font-size:18px;border-radius:18px}.empty p{font-size:14px}.empty-secondary button{flex:1;max-width:160px}.empty .empty-blank{margin:0}.mobile-project:not([hidden]){background:#fff9ef}
 body:not(.has-pattern) .toolbar,body:not(.has-pattern) .mobile-dock,body:not(.has-pattern) .zoom-bar,body:not(.has-pattern) .status{display:none}.has-pattern:not(.mobile-editing) .toolbar{display:none}.has-pattern:not(.mobile-editing) .zoom-bar{display:none}.has-pattern:not(.mobile-editing) .mobile-result-actions{display:flex;gap:10px;padding:8px 14px;background:#fff9ef}.mobile-result-actions button{flex:1;min-height:46px;border-radius:13px;font-weight:700;font-size:14px}.mobile-result-actions button:first-child{background:#bcebe1;color:#075c50}.mobile-result-actions button:last-child{background:#ffe091;color:#69420a}.has-pattern.mobile-editing .mobile-result-actions{display:flex;padding:5px 14px}.has-pattern.mobile-editing .mobile-result-actions #mobileAdjust{display:none}.has-pattern.mobile-editing .mobile-result-actions #mobileEdit{min-height:36px}.has-pattern .canvas-wrap{flex:1;min-height:0}.has-pattern .mobile-dock{flex:none}
}
@media(max-width:760px) and (max-height:650px){.empty h3{font-size:24px}.empty .mascot-cat{width:min(165px,40vw);margin:5px auto}.empty p{margin:5px 0}.empty .upload-inline{min-height:46px}.empty-secondary{margin-top:7px}.toolbar .tool,.toolbar #undo,.toolbar #redo{min-height:38px}.toolbar .tool-icon{width:15px;height:15px}}
@media(min-width:761px){.header-actions #export{min-width:126px;min-height:42px}.desktop-file-menu{position:relative}.desktop-file-menu>summary{display:grid;place-items:center;list-style:none;min-height:42px;padding:0 13px;border-radius:12px;background:#f8eee0;font-size:14px;font-weight:700;cursor:pointer}.desktop-file-menu>summary::-webkit-details-marker{display:none}.desktop-file-menu .actions{position:absolute;z-index:50;right:0;top:48px;display:flex;flex-direction:column;align-items:stretch;min-width:130px;padding:7px;background:#fffaf2;border:1px solid #ecdcca;border-radius:12px;box-shadow:0 8px 24px #563a2529}.desktop-file-menu .actions button{text-align:left}.editor{grid-template-rows:50px minmax(0,1fr) 25px}.editor-top{display:none}.toolbar{grid-row:1/3}.zoom-bar{grid-row:1}.canvas-wrap{grid-row:2}.color-controls,.materials{grid-row:1/3}.status{grid-row:3}}
@media(max-width:760px){.header-actions #export,.desktop-file-menu{display:none}.mobile-result-actions{flex-wrap:wrap}.mobile-result-actions #mobileSavePattern{flex-basis:100%;background:#ff7400;color:white;font-size:16px;min-height:48px}.has-pattern.mobile-editing .mobile-result-actions #mobileSavePattern{display:none}.has-pattern:not(.mobile-editing) .mobile-result-actions{padding-top:6px;padding-bottom:6px}.mobile-result-actions button:not(#mobileSavePattern){min-height:40px}}

@media(max-width:760px){.mobile-result-actions #mobileAdjust{background:#bcebe1;color:#075c50}}
.save-dialog{width:min(430px,calc(100% - 28px));border:0;border-radius:22px;padding:0;background:#fff9ef;color:#58311e;box-shadow:0 18px 60px #58311e42}.save-dialog::backdrop{background:#31261d88}.save-sheet{padding:20px}.save-sheet header{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.save-sheet h2{margin:0;font-size:20px}.save-sheet header button{min-height:40px;padding:8px 12px;border-radius:10px;background:#f4eadf;color:#593c2a}.save-sheet>button{display:flex;width:100%;min-height:67px;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;margin-top:9px;padding:10px 16px;border-radius:15px;text-align:left;color:#58311e;background:#ffead7}.save-sheet>button:nth-of-type(2){background:#def3ed}.save-sheet>button:nth-of-type(3){background:#fff0c8}.save-sheet>button strong{font-size:15px}.save-sheet>button span{font-size:12px;color:#725b4d}@media(min-width:761px){.header-actions #desktopSavePattern{min-width:126px;min-height:42px}}@media(max-width:760px){.header-actions #desktopSavePattern{display:none}.save-dialog{position:fixed;inset:auto 0 0;width:100%;max-width:none;margin:0;border-radius:22px 22px 0 0}.save-sheet{padding:18px 16px calc(18px + env(safe-area-inset-bottom))}}
.workspace-stats{padding:8px 6px 11px;margin-bottom:9px;border-bottom:1px solid #ecdcca;color:#684431;font-size:13px;font-weight:700;white-space:nowrap}.upload-inline::before,.desktop-upload::before,.example-start::before,.empty-blank::before{content:'';display:inline-block;width:20px;height:20px;margin-right:8px;vertical-align:middle;background:currentColor;mask:center/contain no-repeat url('./icons/image-plus.svg')}.example-start::before{mask-image:url('./icons/grid-2x2.svg')}.empty-blank::before{mask-image:url('./icons/pencil.svg')}.empty-blank,.example-start{display:inline-flex;justify-content:center;align-items:center}.desktop-upload::before{width:17px;height:17px}
@media(min-width:761px){.header{height:76px;min-height:76px}.editor{grid-template-columns:112px minmax(0,1fr) 250px}.toolbar .tool,.toolbar #undo{min-height:61px;font-size:13px}.toolbar .tool-icon{width:25px;height:25px}.toolbar .tool:nth-of-type(n+4),.toolbar #redo{min-height:35px}.color-controls{height:245px}.materials{margin-top:245px}.header-actions #desktopSavePattern{font-size:15px;min-width:145px}.desktop-action{font-size:15px}.status{font-size:12px}}
@media(min-width:761px) and (max-width:1050px){.editor{grid-template-columns:100px minmax(0,1fr) 225px}.header-actions #desktopSavePattern{min-width:116px}.header-actions{gap:6px}.desktop-action{font-size:13px}}
@media(max-width:760px){.workspace-stats{display:none}.empty h3{font-size:34px}.empty .mascot-cat{width:min(245px,58vw)}.empty .upload-inline::before{width:25px;height:25px}.example-start::before,.empty-blank::before{width:19px;height:19px}}
@media(max-width:760px) and (max-height:650px){.empty h3{font-size:24px}.empty .mascot-cat{width:min(165px,40vw)}}
.workspace-stats{white-space:normal;line-height:1.5}.tool-icon{width:24px;height:24px}@media(min-width:761px){.editor{grid-template-columns:124px minmax(0,1fr) 290px}.toolbar .tool,.toolbar #undo{min-height:67px;font-size:14px}.toolbar .tool-icon{width:27px;height:27px}.count{font-size:14px!important}.color-controls{height:245px}.materials{margin-top:245px}}@media(min-width:761px) and (max-width:1050px){.editor{grid-template-columns:110px minmax(0,1fr) clamp(230px,28vw,280px)}.toolbar .tool,.toolbar #undo{min-height:58px}.toolbar .tool:nth-of-type(n+4),.toolbar #redo{min-height:32px}.header-actions #desktopSavePattern{min-width:112px}}
.canvas-wrap{touch-action:none}.has-pattern:not(.mobile-editing) .zoom-bar{display:flex}#canvasWrap:focus-visible{outline:2px solid #e86a00;outline-offset:-2px}
.next-mascot{display:block;margin:-4px auto 0;padding:6px 12px;border:1px solid #edd8c0;border-radius:999px;background:#fff9ef;color:#86502f;font-size:12px}.next-mascot:hover{background:#ffead7}@media(max-width:760px) and (max-height:650px){.next-mascot{padding:3px 10px;font-size:11px}}

/* Homepage: bead-flower identity and the approved colorful craft composition. */
.brand-mark{display:block;width:48px;height:48px;object-fit:contain;flex:none;transform:none!important;margin:0!important}.brand{gap:5px}.brand h1{font-size:20px;letter-spacing:.01em;font-weight:800}.header{background-color:#fff8ee}.empty h3{color:#60331d;letter-spacing:-.035em}.empty h3 span{color:#ed6800}.next-mascot{position:relative;z-index:1;background:#fff9efde;border-color:#ecd1b6}.empty .upload-inline{font-weight:800}.empty-secondary button{font-weight:750}.canvas-wrap:has(.empty:not([hidden])){background-color:#fff8ee;background-image:url('./bead-footer.png');background-position:center bottom;background-size:auto 210px;background-repeat:no-repeat}.empty .mascot-cat{object-fit:contain}.desktop-upload::before{width:20px;height:20px}.desktop-settings::before,.header-actions #desktopSavePattern::before{content:'';display:inline-block;width:20px;height:20px;margin-right:7px;vertical-align:middle;background:currentColor;mask:center/contain no-repeat url('./icons/sliders-horizontal.svg')}.header-actions #desktopSavePattern::before{mask-image:url('./icons/download.svg')}
@media(min-width:761px){.header{background-image:url('./bead-footer.png');background-size:auto 110px;background-position:center bottom;background-repeat:no-repeat}.header-actions{position:relative;z-index:1}.canvas-wrap:has(.empty:not([hidden])){background-size:auto 200px}.empty .mascot-cat{width:200px;height:180px}.empty h3{font-size:27px}.toolbar .tool,.toolbar #undo{border:1px solid #eddfd1}.toolbar .tool.selected{border-color:#ff7800}.toolbar .tool:nth-of-type(n+4){border-color:transparent}}
@media(max-width:760px){.header{height:64px;min-height:64px;padding:0 15px;border:0}.brand h1{font-size:19px}.brand-mark{width:44px;height:44px}.canvas-wrap:has(.empty:not([hidden])){background-size:auto 250px}.canvas-wrap .empty{margin:0 auto;align-self:stretch}.empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:clamp(22px,7vh,65px) 17px 70px}.empty h3{font-size:clamp(27px,8.5vw,35px);line-height:1.18;margin:0}.empty .mascot-cat{width:min(66vw,270px);height:min(27vh,235px);margin:clamp(8px,2vh,20px) auto 0}.empty .next-mascot{flex:none;margin:0 auto 8px;min-height:30px}.empty p{display:none}.empty .upload-inline{width:100%;max-width:360px;min-height:64px;margin-top:8px;border-radius:23px;font-size:20px}.empty .upload-inline::before{width:27px;height:27px}.empty-secondary{width:100%;max-width:360px;margin-top:20px;gap:12px}.empty-secondary button{max-width:none;min-height:54px;border-radius:20px;font-size:15px}.example-start::before,.empty-blank::before{width:22px;height:22px}}
@media(max-width:760px) and (max-height:700px){.header{height:56px;min-height:56px}.brand-mark{width:38px;height:38px}.empty{padding-top:clamp(10px,3vh,22px);padding-bottom:44px}.empty h3{font-size:25px}.empty .mascot-cat{height:min(24vh,145px);margin:5px auto 0}.empty .next-mascot{margin-bottom:2px;min-height:26px}.empty .upload-inline{min-height:48px;margin-top:5px;font-size:16px}.empty-secondary{margin-top:9px;gap:8px}.empty-secondary button{min-height:44px;font-size:13px}.canvas-wrap:has(.empty:not([hidden])){background-size:auto 180px}}
@media(min-width:761px){.header{background-size:100% auto}}
@media(max-width:760px){.brand h1{font-size:21px}.brand-mark{width:50px;height:50px}.canvas-wrap:has(.empty:not([hidden])){background-size:auto 300px}}
@media(max-width:760px) and (min-height:701px){.empty{padding-top:clamp(30px,4.5vh,45px)}.empty h3{font-size:clamp(34px,10.5vw,42px)}.empty .mascot-cat{height:min(29vh,245px);margin-top:12px}.empty .upload-inline{min-height:74px;margin-top:18px;font-size:22px}.empty-secondary button{min-height:58px;font-size:16px}}
@media(min-width:761px){.header{background-size:auto 70px;background-repeat:repeat-x}}
/* The canvas handles pinch; prevent page pinch while retaining ordinary scrolling. */
html,body{touch-action:pan-x pan-y}
@media(any-pointer:coarse){input,select,textarea{font-size:16px!important}}
#rightRail{display:contents}
@media(min-width:761px){
 #rightRail{display:flex;grid-column:3;grid-row:1/3;min-width:0;min-height:0;flex-direction:column;overflow:auto;overscroll-behavior:contain;border:1px solid #f0e1d0;border-radius:18px;background:#fff9ef;scrollbar-width:none;-ms-overflow-style:none}
 #rightRail::-webkit-scrollbar{display:none;width:0;height:0}
 #rightRail:focus-visible{outline:2px solid #e86a00;outline-offset:-2px}
 #rightRail .color-controls{display:block;position:static;flex:none;width:100%;height:auto!important;max-height:none!important;overflow:visible!important;border:0;border-radius:0;padding:12px}
 #rightRail .materials{display:block;position:static;flex:1 0 auto;width:100%;min-height:0;margin:0!important;overflow:visible!important;border:0;border-top:1px solid #f0e1d0;border-radius:0;padding:12px}
 #rightRail .workspace-stats{display:flex;flex-wrap:wrap;gap:4px 10px;line-height:1.45}
 #rightRail .workspace-stats span{white-space:nowrap}
}
.desktop-panel-tabs{display:none}.rail-hint{display:none}
@media(min-width:761px){.sidebar.mobile-open .desktop-panel-tabs{display:flex;gap:6px;padding:12px 0 2px}.desktop-panel-tabs button{flex:1;min-height:42px;padding:7px 5px;border-radius:9px;background:#f6eee3;color:#5e4432;font-size:13px}.desktop-panel-tabs button[aria-pressed="true"]{background:#ffe4cc;color:#9b3d00;font-weight:700}.sidebar.mobile-open[data-active="settings"] .source-section{display:none}.sidebar.mobile-open[data-active="image"] .settings-section{display:none}.rail-hint:not([hidden]){display:block;margin:8px 0 0;color:#735c49;font-size:12px;line-height:1.4}}
/* Short landscape: keep the preview and confirmation visible together. */
@media(max-height:500px) and (orientation:landscape){
 .simplify-dialog{position:fixed;inset:3dvh 12px;margin:auto;height:min(94dvh,440px);max-height:94dvh;width:min(860px,calc(100% - 24px))}
 .simplify-shell{height:100%;max-height:none;overflow:auto;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto auto auto auto minmax(0,1fr) auto;gap:4px 14px;padding:12px 16px}
 .simplify-head{grid-column:1/-1;grid-row:1}.simplify-head h2{font-size:17px}.simplify-head p{font-size:12px;margin:2px 0}.simplify-head button{min-height:34px;padding:5px 10px}
 .simplify-controls{grid-column:1;grid-row:2;margin:0;gap:6px}.simplify-controls label{gap:2px;font-size:12px}.simplify-controls select{height:36px}
 .preview-size{grid-column:1;grid-row:3;margin:0;gap:5px}.preview-size input{padding:4px}.preview-size span{display:none}.preview-size output{margin-left:0}
 .smart-cutout{grid-column:1;grid-row:4}.smart-cutout .simplify-background{margin:0}.smart-cutout .mask-edit-open{min-height:32px}
 #smartStatus{grid-column:1;grid-row:5;margin:0;font-size:11px}#uniformGroup{grid-column:1;grid-row:6}#uniformGroup .simplify-background{margin:2px 0}#uniformGroup .simplify-background-note{font-size:11px}
 .simplify-hint,.simplify-note{display:none}.simplify-comparison{grid-column:2;grid-row:2/7;margin:0;align-self:stretch;min-height:0}.simplify-comparison figure{display:flex;flex-direction:column;min-height:0;padding:5px}.simplify-comparison figcaption{margin:0 0 3px;font-size:12px}.simplify-comparison canvas{width:100%;max-height:calc(94dvh - 110px);height:100%;object-fit:contain}
 .simplify-error{grid-column:1/-1;margin:0}.simplify-actions{grid-column:1/-1;grid-row:7;position:sticky;bottom:0;background:#fffdfa;margin:0;padding:4px 0 0}.simplify-actions button,.simplify-actions .primary{min-height:38px}
}
.simplify-actions{position:sticky;bottom:0;z-index:2;background:#fffdfa;padding:8px 0 0}
.header{position:relative;z-index:40}
@media(min-width:761px){.sidebar.mobile-open{top:84px}}
@media(max-width:760px){.sidebar.mobile-open{top:64px}}
@media(max-width:760px) and (max-height:700px){.sidebar.mobile-open{top:56px}}
/* A phone held sideways needs room for the artwork, not stacked controls. */
@media(max-width:760px) and (max-height:500px) and (orientation:landscape){
 .header{height:44px;min-height:44px;padding:0 12px}.brand-mark{width:34px;height:34px}.brand h1{font-size:17px}.ai-open{min-height:32px}
 .mobile-project:not([hidden]){padding:3px 12px;font-size:11px}.toolbar{grid-template-columns:repeat(8,minmax(0,1fr));gap:3px;padding:3px 6px}.toolbar .tool,.toolbar #undo,.toolbar #redo{min-height:38px;display:flex;flex-direction:row;gap:3px;font-size:11px;padding:3px}.toolbar .tool-icon,.toolbar #undo .tool-icon,.toolbar #redo .tool-icon{width:15px;height:15px}
 .zoom-bar{height:31px;margin:3px auto}.zoom-bar button{height:29px;min-width:36px}.zoom-bar .tool-icon{width:17px;height:17px}.zoom-bar #zoomLabel{min-width:50px}
 .mobile-result-actions,.has-pattern:not(.mobile-editing) .mobile-result-actions,.has-pattern.mobile-editing .mobile-result-actions{flex-wrap:nowrap;gap:6px;padding:3px 8px}.mobile-result-actions #mobileSavePattern{flex-basis:auto;min-height:36px;font-size:13px}.mobile-result-actions button:not(#mobileSavePattern),.has-pattern.mobile-editing .mobile-result-actions #mobileEdit{min-height:36px;font-size:12px}
 .status{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}.mobile-dock{padding:2px 3px calc(2px + env(safe-area-inset-bottom))}.mobile-dock button{min-height:39px;flex-direction:row;gap:4px}.mobile-dock svg{width:16px;height:16px}.sidebar.mobile-open{top:44px;bottom:calc(45px + env(safe-area-inset-bottom))}.color-controls.mobile-open,.materials.mobile-open{bottom:calc(45px + env(safe-area-inset-bottom));max-height:75dvh}
}

/* Board choice stays inside the existing settings and materials panels. */
.board-settings{display:grid;gap:8px;margin:12px 0;padding:12px;border:1px solid #efd9c8;border-radius:14px;background:#fffaf3}.board-label{font-weight:700}.board-settings select{width:100%;min-height:42px;border:1px solid #e7cdbb;border-radius:10px;background:#fff;padding:7px 10px;color:#533729}.custom-board{display:flex;gap:10px;flex-wrap:wrap}.custom-board[hidden]{display:none}.custom-board label{display:flex;align-items:center;gap:5px}.custom-board input{width:65px;min-height:38px}.board-help,.board-result{font-size:12px;line-height:1.5;color:#795e4f;margin:2px 0}.board-result{padding:8px 10px;border-radius:9px;background:#fff0db;color:#704320}.board-fit-active{opacity:.6}

#widthField[hidden],#fitBoardOption[hidden],#previewSize[hidden],#previewSizeSuffix[hidden]{display:none}

.home-button{display:none;min-height:40px;padding:0 14px;border-radius:12px;background:#fff0dc;color:#754326;font-weight:700}.has-pattern .home-button{display:inline-flex;align-items:center;justify-content:center}.continue-work{margin:8px auto 0;min-height:36px;padding:6px 15px;background:transparent;color:#96501f;text-decoration:underline;text-underline-offset:3px;font-weight:700}.continue-work[hidden]{display:none}@media(max-width:760px){.home-button{min-height:36px;padding:0 10px;font-size:13px}.empty:has(.continue-work:not([hidden])) .mascot-cat{height:min(21vh,190px)}.empty:has(.continue-work:not([hidden])) .empty-secondary{margin-top:8px}}@media(max-width:760px) and (max-height:700px){.empty:has(.continue-work:not([hidden])){padding-top:6px}.empty:has(.continue-work:not([hidden])) .mascot-cat{height:min(18vh,105px)}.empty:has(.continue-work:not([hidden])) .continue-work{min-height:30px;margin-top:3px}.empty:has(.continue-work:not([hidden])) .empty-secondary{margin-top:4px}}
/* Keep tablet zoom controls with the tools and give the saved row to the artwork. */
@media(min-width:761px){.editor{grid-template-rows:minmax(0,1fr) 25px}.toolbar{grid-row:1;min-height:0;padding-bottom:60px;scrollbar-width:none}.toolbar::-webkit-scrollbar{display:none}.canvas-wrap{grid-row:1}.status{grid-row:2}#rightRail{grid-row:1}#zoomBar{grid-column:1;grid-row:1;align-self:end;justify-self:stretch;margin:0 6px 8px;height:42px;z-index:2}#zoomBar button{min-width:0;width:32%;height:40px}#zoomBar #zoomLabel{min-width:0;flex:1;font-size:12px}body:not(.has-pattern) #zoomBar{display:none}}
@media(max-width:760px){.zoom-bar{position:relative;z-index:3;align-self:flex-start;margin:0 0 -36px 12px}}
@media(max-width:760px) and (max-height:500px) and (orientation:landscape){.zoom-bar{margin-bottom:-31px}}
@media(min-width:761px){.toolbar{height:calc(100% - 52px);align-self:start;padding-bottom:8px}#zoomBar #zoomOut,#zoomBar #zoomIn{min-width:0;width:30%;padding:0}#zoomBar .tool-icon{width:17px;height:17px}#zoomBar #zoomLabel{padding:0;font-size:11px}}
/* Keep the materials list visible; color selection opens from the chosen tool. */
@media(min-width:761px){#rightRail .color-controls{display:none!important}#rightRail .materials{border-top:0}.sidebar.mobile-open{left:auto;right:10px}.toolbar{height:calc(100% - 146px)}#zoomBar{height:136px;display:flex;flex-direction:column;justify-content:center;gap:2px;margin:0 6px 6px;padding:4px;border-radius:14px}#zoomBar #zoomOut,#zoomBar #zoomIn{width:100%;min-height:42px;display:flex;align-items:center;justify-content:center;gap:6px;font-size:12px;font-weight:700;border-radius:9px}#zoomBar #zoomOut::after{content:'缩小'}#zoomBar #zoomIn::after{content:'放大'}#zoomBar #zoomLabel{flex:none;line-height:25px;font-size:12px}#zoomBar .tool-icon{width:18px;height:18px}}
.board-rulers{display:none;position:fixed;z-index:2;pointer-events:none}
.has-pattern .canvas-wrap{padding:22px 10px 10px 26px}

.brand-field{display:grid;gap:7px;margin:14px 0}.brand-field label{font-weight:700;color:#563925}.brand-field select{width:100%;min-height:44px;padding:7px 10px;border:1px solid #e7cdbb;border-radius:10px;background:#fff;color:#533729}.brand-field p{font-size:12px;line-height:1.5;color:#795e4f;margin:0}.beading-overview{display:grid;gap:3px;margin:10px 0;padding:10px 11px;background:#fff0db;border-radius:10px;font-size:12px;line-height:1.5;color:#704320}.beading-overview[hidden]{display:none}.beading-overview strong{font-size:13px}.beading-overview small{font-size:11px;color:#785d4c}.count-row{display:flex;align-items:center;gap:4px;width:100%;border-bottom:1px solid #efe2d3}.counts .count-row .count{min-width:0;flex:1;border:0;margin:0;padding:6px 3px}.count-row .mark-action{flex:none;min-width:44px;min-height:40px;border-radius:9px;padding:4px 5px;background:#f7ede1;color:#6f4c39;font-size:11px;line-height:1.2}.count-row .mark-action[aria-pressed="true"]{background:#d6eee4;color:#17644f;font-weight:700}.count-row .missing-action[aria-pressed="true"]{background:#ffe0cc;color:#9d3b10}.counts{gap:0!important}@media(max-width:760px){.count-row .mark-action{min-width:50px;font-size:12px}.beading-overview{margin:8px 0}}
.count-row .count{overflow-wrap:anywhere;line-height:1.3}.brand-field a{color:#97501d}
@media(max-width:760px){#mobileSelectedColor{display:inline-block;max-width:45px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}}
@media(max-width:380px){.header{gap:6px}.brand{gap:2px;min-width:0;white-space:nowrap}.brand-mark{width:35px;height:35px}.brand h1{font-size:16px;white-space:nowrap}.header-actions{gap:5px}.home-button{padding:0 7px;white-space:nowrap}.ai-open{padding:7px 8px;font-size:12px;white-space:nowrap}#mobileSelectedColor{display:none}}
.sidebar.mobile-open{overflow-anchor:none}
.generation-feedback{min-height:5em}
.board-align{width:100%;min-height:42px;padding:8px 10px;border-radius:10px;background:#dff2eb;color:#075f50;font-weight:700;font-size:13px;line-height:1.4}.board-align[hidden]{display:none}
/* Compact working summary: the list and its actions stay in view. */
.rail-top{display:flex;align-items:center;justify-content:space-between;gap:6px}.rail-top .workspace-stats{display:flex;flex-wrap:wrap;gap:2px 8px;min-width:0;margin:0;padding:0;border:0;font-size:12px;line-height:1.3}.rail-settings{flex:none;min-width:50px;min-height:40px;padding:7px 10px;border-radius:10px;background:#def2eb;color:#075f50;font-size:13px;font-weight:700}.rail-settings:focus-visible,.tool-color:focus-visible,.materials-help summary:focus-visible{outline:3px solid #cc713d;outline-offset:2px}
.materials .mobile-material-head{margin:8px 0 2px}.materials .mobile-material-head h3{margin:0}.materials .rail-hint:not([hidden]){margin:2px 0;color:#785d4c;font-size:11px;line-height:1.3}.materials #boardResult:not([hidden]){margin:6px 0 3px;padding:0;background:none;color:#765442;font-size:12px;line-height:1.35}.materials .beading-overview:not([hidden]){display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 8px;margin:5px 0;padding:0;background:none;font-size:11px;line-height:1.35}.materials .beading-overview strong{font-size:12px}.materials .beading-overview span{color:#765b4a}.materials-help{margin:4px 0;font-size:12px;color:#765b4a}.materials-help summary{width:max-content;cursor:pointer;color:#96501f}.materials-help p{margin:5px 0;line-height:1.45;font-size:12px}.materials .show-codes{margin:6px 0;font-size:12px}
.tool-color{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:100%;min-height:58px;padding:5px;border:1px solid #eddfd1;border-radius:13px;background:#fff9ef;color:#563925;font-size:12px;font-weight:700}.tool-color i{display:block;width:24px;height:24px;border:1px solid #a7826b;border-radius:50%;box-shadow:inset 0 0 0 3px #ffffff70}.tool-color small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;line-height:1;color:#765b4a}.tool-color:hover{background:#f9e2cb}
@media(max-width:760px){.rail-top,.tool-color{display:none}.materials .mobile-material-head{margin:0 0 5px}.materials .beading-overview:not([hidden]){font-size:12px}.materials .beading-overview strong{font-size:13px}.materials-help summary{min-height:36px;display:flex;align-items:center}.materials-help p{font-size:13px}}
@media(min-width:761px) and (max-height:500px){.toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:3px;height:calc(100% - 104px);padding:4px}.toolbar .tool,.toolbar #undo,.toolbar #redo,.toolbar .tool-color{min-height:44px;padding:3px;display:flex;flex-direction:column;gap:1px;font-size:10px}.toolbar .tool .tool-icon,.toolbar #undo .tool-icon,.toolbar #redo .tool-icon{width:15px;height:15px}.toolbar .tool-color i{width:18px;height:18px}.toolbar .tool-color small{display:none}#zoomBar{height:96px}#zoomBar #zoomOut,#zoomBar #zoomIn{min-height:30px}#zoomBar #zoomLabel{line-height:20px}}
/* Preserve the approved orange while keeping labels readable on it. */
.primary,.upload,.desktop-upload,.mobile-result-actions #mobileSavePattern{background:#ff7400;color:#4b2003}.primary:hover,.upload:hover,.desktop-upload:hover{background:#f47716;color:#4b2003}.toolbar .tool.selected{background:#ff7400;color:#4b2003}.toolbar .tool.selected .tool-icon{filter:none}.materials .rail-hint:not([hidden]),.materials .beading-overview:not([hidden]),.count-row .mark-action,.tool-color small{font-size:12px}
@media(min-width:761px) and (max-height:500px){.toolbar .tool,.toolbar #undo,.toolbar #redo,.toolbar .tool-color{font-size:12px}}

/* Mobile focus modes keep the same canvas and the current crop selection. */
.mobile-focus{display:none}
@media(max-width:760px){
 .mobile-focus{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 12px;border-radius:10px;background:#f8eee0;color:#563925;font-weight:700;white-space:nowrap}
 .mobile-focus:focus-visible{outline:2px solid #a54e2e;outline-offset:2px}
 .crop-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
 .has-pattern #zoomBar{margin:0 0 0 12px;height:44px}
 #zoomBar button{min-width:44px;min-height:44px}
 .has-pattern.board-focus .header,.has-pattern.board-focus:not(.mobile-editing) .mobile-dock,
 .has-pattern.board-focus:not(.mobile-editing) .mobile-result-actions{display:none}
 .board-focus .mobile-project:not([hidden]){padding-top:env(safe-area-inset-top);gap:8px}
 .board-focus .editor{padding-bottom:env(safe-area-inset-bottom)}
 .board-focus.mobile-editing .editor{padding-bottom:0}
 .board-focus .sidebar.mobile-open{top:env(safe-area-inset-top)}
 .board-focus .status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);padding:0}
 .crop-focus .header,.crop-focus .mobile-dock,.crop-focus .editor,.crop-focus .board-rulers{visibility:hidden}
 .crop-focus .sidebar.mobile-open[data-active="image"]{inset:0;z-index:50;width:100%;height:100%;max-height:none;padding:0;border:0;border-radius:0;overflow:hidden}
 .crop-focus #cropPanel:not([hidden]){position:absolute;inset:0;display:flex;flex-direction:column;gap:6px;padding:calc(8px + env(safe-area-inset-top)) 12px calc(8px + env(safe-area-inset-bottom));background:#fffaf2}
 .crop-focus .sidebar .source-section{padding:0}
 .crop-focus .sidebar .source-section > :not(#cropPanel),.crop-focus .sidebar .mobile-panel-head{display:none}
 .crop-focus #cropPanel .crop-title span{display:none}
 .crop-focus #cropPreview{flex:0 1 auto;min-height:0;max-height:none;max-width:100%;margin:auto;object-fit:contain}
 .crop-focus .crop-instructions,.crop-focus #cropStatus{margin:0}
 .crop-focus .crop-actions{position:static;padding:0}
 .crop-focus .crop-actions button{padding-inline:10px}
 .count-row .mark-action,.counts .count-row .count{min-height:44px}
}

@media(max-width:760px){
 .sidebar.mobile-open[data-active="settings"]{display:flex;flex-direction:column;overflow:hidden}
 .sidebar.mobile-open[data-active="settings"] .settings-section{display:flex;flex:1;min-height:0;padding-bottom:0}
 .sidebar[data-active="settings"] .settings-details{position:relative;width:100%;min-height:0}
 .sidebar[data-active="settings"] .settings-details > summary{min-height:36px}
 .sidebar[data-active="settings"] .settings-content{position:absolute;inset:36px 0 0;display:flex;flex-direction:column}
 .sidebar[data-active="settings"] .settings-fields{flex:1;min-height:0;overflow:auto;scrollbar-width:none}
 .sidebar[data-active="settings"] .settings-apply{flex:none;padding:8px 0;border-top:1px solid #efdcc6;background:#fffaf2}
 .sidebar[data-active="settings"] #generationFeedback{min-height:0;margin:0 0 4px}
 .sidebar[data-active="settings"] #convert{min-height:44px;margin:0}
}

.crop-zoom,.align-help{display:none}
@media(max-width:760px){
 .crop-focus .crop-zoom{display:flex;align-items:center;gap:6px;flex:none}
 .crop-zoom button{min-width:44px;min-height:44px;padding:0 10px;border-radius:8px;background:#f8eee0;color:#563925}
 .crop-zoom button[aria-pressed="true"]{background:#ff7400;color:#4b2003}
 .crop-zoom output{min-width:48px;text-align:center;font-weight:700}
 #cropPan{margin-left:auto}
 .crop-focus #cropStage{display:flex;flex:1;min-height:0;overflow:auto;scrollbar-width:none;overscroll-behavior:contain}
 .crop-focus #cropPreview{flex:none;max-width:none;max-height:none;margin:auto}
 .crop-focus #cropStage.crop-moving #cropPreview{touch-action:pan-x pan-y;cursor:grab}
 .sidebar[data-active="settings"] #convert:not(:disabled){background:#ff7400;color:#4b2003;font-weight:750}
 .sidebar[data-active="settings"] .board-settings:has(#alignBoards:not([hidden])) .align-help{display:block;margin:0;font-size:12px;line-height:1.5;color:#704320}
}

/* Mobile navigation separates making a pattern from managing its files. */
.setting-group h3{margin:16px 0 8px;font-size:15px;color:#563925}
@media(max-width:760px){
 .mobile-dock{grid-template-columns:repeat(5,minmax(0,1fr));gap:2px;padding-inline:5px}
 .mobile-dock button{min-height:50px;gap:4px;padding-inline:2px}
 .mobile-dock button span{font-size:12px;line-height:1.2;white-space:nowrap}
 .mobile-dock button[aria-pressed="true"] span{font-weight:750;color:#73340f}
 .mobile-dock button[aria-pressed="true"] svg{stroke-width:2.4}
 .mobile-panel-head h2{margin:0;font-size:1.125rem;line-height:1.25;color:#4b3021}
 .sidebar.mobile-open .mobile-panel-head button,.mobile-sheet-close,.home-button,.ai-open{min-height:44px}
 .sidebar[data-active="settings"] .settings-details > summary{display:none}
 .sidebar[data-active="settings"] .settings-content{inset:0}
 .sidebar[data-active="settings"] .settings-fields{padding-bottom:10px}
 .setting-group{margin-top:16px;padding-top:12px;border-top:1px solid #ecdcca}
 .setting-group h3{margin:0 0 8px;font-size:1rem}
 .settings-fields .board-help,.settings-fields .hint,.settings-fields .brand-field p,.settings-apply #generationFeedback{font-size:.875rem;line-height:1.5;color:#654c3e}
 .settings-fields .field,.settings-fields .option{font-size:.9375rem;line-height:1.4;min-height:44px}
 .settings-fields .option{display:flex;align-items:center;gap:10px;margin:0;padding:5px 2px}
 .settings-fields input[type="checkbox"]{flex:none;width:18px;height:18px;margin:0}
 .settings-fields input[type="number"],.settings-fields select,.palette-search input{min-height:44px;font-size:1rem}
 .settings-apply #convert{width:100%;font-size:.9375rem}
 .mobile-files button{display:block;width:100%;min-height:48px;margin:0;font-size:1rem}
 .mobile-files .hint{font-size:.875rem;line-height:1.5;margin:6px 0 18px;color:#654c3e}
 .mobile-dock button:focus-visible,.mobile-panel-head button:focus-visible,.settings-fields :is(input,select,button):focus-visible,.mobile-files button:focus-visible{outline:2px solid #a54e2e;outline-offset:-2px}
}
@media(max-width:760px) and (max-height:500px) and (orientation:landscape){
 .mobile-dock button{min-height:44px}
}
