/* Dedicated bead editor: tools, canvas and color choices stay in view. */
body.bead-editor-open{overflow:hidden}
#bead-editor{position:fixed;inset:0;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:#f4f6f7;color:#293c34;box-shadow:none;overflow:hidden}
#bead-editor:not([open]){display:none}#bead-editor[open]{display:grid;grid-template-rows:64px minmax(0,1fr)}
#bead-editor::backdrop{background:#fff;backdrop-filter:none}
#bead-editor [hidden]{display:none!important}
#bead-editor button{cursor:pointer;touch-action:manipulation}#bead-editor button:disabled{cursor:not-allowed;opacity:.35}
#bead-editor button:focus-visible,#bead-editor input:focus-visible,#bead-editor select:focus-visible{outline:2px solid #5b9a7e;outline-offset:2px}
.editor-header{padding:10px 20px 10px 14px;display:flex;align-items:center;gap:18px;background:#fff;border-bottom:1px solid #e0e7e3;min-width:0}
.editor-back{display:flex;align-items:center;gap:6px;font-size:13px;background:#fff;border:1px solid #dbe5df;border-radius:8px;min-height:39px;padding:0 13px;white-space:nowrap;color:#476a57}
.editor-document{min-width:0;flex:1;line-height:1.4}.editor-document #editor-document-title{padding:0!important;margin:0;border:0;background:none;font-size:15px;font-weight:650;color:#2c4a37;width:100%;max-width:440px;border-radius:0}.editor-document small{display:block;font-size:11px;color:#7c8d82;margin-top:4px}
.editor-history{display:flex;align-items:center;gap:6px}.editor-history button{display:grid;place-items:center;width:36px;height:36px;border:1px solid #e2e9e5;border-radius:7px;color:#587764}.editor-history button:hover{background:#edf5f0}.editor-history .icon{width:17px;height:17px}
.editor-how{font-size:12px;white-space:nowrap;color:#63816e;padding:6px}.editor-primary,.editor-secondary{display:flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:0 16px;border-radius:8px;font-size:13px;font-weight:500;white-space:nowrap}.editor-primary{background:#28765e;color:#fff}.editor-primary:hover{background:#1e614c}.editor-secondary{background:#fff;border:1px solid #dce7e0;color:#4a7059}.editor-primary .icon,.editor-secondary .icon{width:16px;height:16px}
.editor-layout{display:grid;grid-template-columns:76px minmax(0,1fr) 292px;min-height:0;min-width:0}
.editor-tool-rail{background:#fff;border-right:1px solid #e0e7e3;padding:10px 8px;display:flex;flex-direction:column;gap:5px;overflow-y:auto;scrollbar-width:thin}
.editor-tool-rail button{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3px;min-height:51px;flex-shrink:0;border:1px solid transparent;border-radius:8px;color:#6b7f72;font-size:11px;padding:5px 2px;line-height:1.4}.editor-tool-rail .icon{width:20px;height:20px;stroke-width:1.6}.editor-tool-rail kbd{position:absolute;top:2px;right:4px;font:9px system-ui,sans-serif;color:#9aaba0}.editor-tool-rail button:hover{background:#f2f7f4}.editor-tool-rail button.selected{background:#e9f5ee;color:#246a4a;border-color:#95baa3;box-shadow:inset 3px 0 #28765e}.editor-tool-rail button.selected kbd{color:#619475}
#bead-editor .editor-main{display:flex;flex-direction:column;max-width:none;width:100%;margin:0;padding:0;min-width:0;min-height:0;overflow:hidden}
.editor-context{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;background:#fff;border-bottom:1px solid #e1e8e4;flex-shrink:0;min-height:56px;flex-wrap:wrap}
.editor-view-toggle{display:flex;gap:3px;background:#f1f5f3;padding:3px;border-radius:7px;flex-shrink:0}.editor-view-toggle button{font-size:12px;padding:5px 10px;min-height:29px;border-radius:5px;color:#768b7c}.editor-view-toggle button.selected{background:white;box-shadow:0 1px 4px #2947370a;color:#2b6b4c}
.editor-brush-controls{display:flex;align-items:center;gap:14px;margin-left:auto}.editor-brush-controls label{display:flex;align-items:center;gap:7px;font-size:12px;color:#758b7a;white-space:nowrap}.editor-brush-controls #brush-size{width:46px;min-height:32px;padding:4px 5px;margin:0;border:1px solid #dce7df;background:#fff;border-radius:6px;font-size:13px;text-align:center}.editor-brush-controls #brush-symmetry{width:64px;margin:0;padding:4px 5px;font-size:12px;min-height:32px;border-color:#dce7df;color:#54745e}
.editor-zoom{display:flex;align-items:center;gap:2px;margin-left:auto}.editor-zoom button{min-height:30px;min-width:29px;font-size:17px;color:#6b8371;border-radius:5px}.editor-zoom button:hover{background:#edf5f0}.editor-zoom #editor-fit{font-size:11px;min-width:43px}
.editor-tool-guidance{display:flex;align-items:center;gap:10px;min-height:39px;padding:8px 18px;color:#779082;font-size:12px;border-bottom:1px solid #e3ebe6;flex-shrink:0;background:#f6f9f7;line-height:1.5}.editor-tool-guidance strong{font-size:12px;color:#3e7254;white-space:nowrap}.editor-selection-actions{display:flex;flex-wrap:wrap;gap:6px;background:#f5f9f6;padding:8px 14px;border-bottom:1px solid #e1ebe4;flex-shrink:0}.editor-selection-actions button{font-size:11px;padding:6px 10px;background:#fff;border:1px solid #dfe9e2;border-radius:6px;color:#57795f;min-height:30px}
.editor-canvas-host{min-width:0;min-height:0;flex:1;display:flex;overflow:hidden}
#bead-editor #canvas-stage{flex:1;min-height:0;max-height:none;margin:0;padding:24px;overflow:auto;resize:none;border:0;border-radius:0;background-color:#edf1f3;background-image:radial-gradient(#d8e1dc 1px,transparent 1px);background-size:16px 16px;scrollbar-width:thin;align-content:center;box-shadow:none}
#bead-editor #pattern-canvas{margin:16px auto;display:block;max-width:none;background:#fff;box-shadow:0 1px 10px #223a2c12;outline:1px solid #c7d6cc;outline-offset:0;image-rendering:pixelated}
#bead-editor #pattern-canvas:focus-visible{outline:2px solid #6e9b80;outline-offset:0}
.editor-status{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 16px;min-height:34px;flex-shrink:0;background:#fff;border-top:1px solid #dfe7e2;color:#85978b;font-size:10px;line-height:1.5}.editor-status #editor-position{color:#6a8a74}
.editor-inspector{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;background:#fff;border-left:1px solid #e0e7e3}
.editor-inspector-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:9px 10px 0;border-bottom:1px solid #e0e9e3;min-height:48px;flex-shrink:0}.editor-inspector-tabs button{font-size:12px;padding:9px 3px;color:#7c9082;border-bottom:2px solid transparent;white-space:nowrap}.editor-inspector-tabs button.selected{border-color:#28765e;color:#2f7050;font-weight:600}
.editor-panel{display:flex;flex-direction:column;min-height:0;flex:1;overflow:hidden}.editor-current-color{display:flex;align-items:center;gap:12px;margin:15px 14px 13px;padding:13px 12px;border:1px solid #e2ebe5;background:#fbfdfb;border-radius:9px;flex-shrink:0;min-width:0}.editor-current-color>i{height:42px;width:42px;border-radius:9px;border:1px solid #00000014;flex-shrink:0}.editor-current-color>div{min-width:0;line-height:1.5}.editor-current-color>div>span{font-size:10px;color:#87998b}.editor-current-color strong{display:flex;gap:6px;align-items:center;font-size:12px;color:#3c634a;min-width:0}.editor-current-color strong b{font-size:13px;flex-shrink:0}.editor-current-color strong span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;font-weight:400}.editor-current-color small{font-size:10px;color:#7e9585}
.editor-palette-scroll{overflow:auto;min-height:0;flex:1;padding:0 14px 16px;scrollbar-width:thin}.editor-used-heading,.editor-all-heading{display:flex;align-items:center;justify-content:space-between;color:#566f5e;font-size:12px;margin-bottom:9px}.editor-used-heading span,.editor-all-heading span{font-size:10px;color:#92a296}.editor-used-colors{display:flex;flex-wrap:wrap;gap:5px;margin-bottom:20px;max-height:96px;overflow:auto;padding:2px}.editor-used-colors button{min-width:31px;height:30px;font-size:9px;padding:0 5px;border:1px solid #0001;border-radius:5px;position:relative}.editor-used-colors button.selected{outline:2px solid #3e8b60;outline-offset:1px}.editor-used-colors>span{font-size:11px;color:#8fa394}.editor-all-heading{margin-bottom:5px}.editor-brand-label{font-size:10px;color:#899e90;display:block;line-height:1.6;overflow-wrap:anywhere;margin-bottom:9px}
.editor-search{display:flex;gap:6px;position:sticky;top:0;background:#fff;z-index:1;padding:0 0 10px}.editor-search #editor-color-search{font-size:12px;margin:0;padding:9px 10px;min-width:0;min-height:37px;border-color:#dfe8e2}.editor-search #editor-color-scope{font-size:11px;width:58px;min-width:58px;padding:7px 3px;margin:0;min-height:37px;border-color:#dfe8e2;color:#61806c}
#bead-editor #editor-palette{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;max-height:none;overflow:visible;margin:0;padding:3px 2px;align-content:start}
#bead-editor #editor-palette button{position:relative;width:100%;height:auto;aspect-ratio:1;min-height:32px;border:1px solid #00000012;border-radius:6px;padding:3px 1px;font-size:10px;font-weight:600;line-height:1.1;word-break:break-word;outline-offset:1px}
#bead-editor #editor-palette button.selected{outline:2px solid #28765e;box-shadow:inset 0 0 0 2px #fff9;border-color:#28765e}
#bead-editor #editor-palette button.selected:after{content:'✓';position:absolute;top:0;right:2px;font-size:10px}
.editor-inspector-footer{display:grid;grid-template-columns:1fr 1fr;gap:8px;flex-shrink:0;padding:12px 14px;border-top:1px solid #e1e9e4;box-shadow:0 -4px 14px #27473004}.editor-inspector-footer button{font-size:12px;padding:0 8px}
.editor-scroll-panel{display:block;padding:18px 16px;overflow:auto;scrollbar-width:thin}.editor-scroll-panel h3{font-size:14px;color:#466d52;margin:0 0 9px}.editor-scroll-panel p{font-size:12px;color:#8a9e8e;line-height:1.9;margin-bottom:15px}.editor-scroll-panel>button,.editor-more-actions button{border:1px solid #dce8df;border-radius:7px;font-size:12px;min-height:39px;padding:7px 10px;color:#53795e;background:#fff}.editor-more-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:16px 0 24px}.editor-check{display:flex;align-items:center;gap:8px;font-size:12px;color:#64826c;margin:15px 0}.editor-check input{margin:0}
#editor-usage-list>div{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid #edf2ee;font-size:12px;color:#52755b}#editor-usage-list i{width:25px;height:25px;border-radius:6px;border:1px solid #0001}#editor-usage-list small{display:block;font-size:10px;color:#8fa395}#editor-usage-list strong{margin-left:auto;font-size:12px}#editor-usage-list{margin-bottom:18px}.editor-empty{font-size:11px;color:#8c9f90;grid-column:1/-1;padding:15px 0;line-height:1.8}.editor-tutorial{padding-left:24px;margin:0 0 22px}.editor-tutorial li{padding:4px 0 9px 5px;color:#487458}.editor-tutorial strong{font-size:14px}.editor-tutorial p{margin-top:5px}
@media(min-width:1600px){.editor-layout{grid-template-columns:84px minmax(0,1fr) 320px}.editor-tool-rail button{min-height:58px}.editor-current-color{margin:18px}.editor-palette-scroll{padding-left:18px;padding-right:18px}#bead-editor #editor-palette{grid-template-columns:repeat(7,minmax(0,1fr))}}
@media(min-width:761px) and (max-width:1060px){.editor-layout{grid-template-columns:66px minmax(0,1fr) 246px}.editor-context{gap:7px;padding:8px 10px}.editor-brush-controls{gap:8px}.editor-context .editor-symmetry{display:none}.editor-view-toggle button{padding:5px 7px}.editor-header{gap:10px}.editor-how{display:none}#bead-editor #editor-palette{grid-template-columns:repeat(5,minmax(0,1fr))}.editor-tool-guidance{font-size:11px}}
@media(max-width:760px){
 #bead-editor[open]{grid-template-rows:56px minmax(0,1fr)}.editor-header{padding:7px 10px;gap:8px}.editor-back{padding:0 8px;min-height:36px;font-size:12px}.editor-back span{display:none}.editor-document #editor-document-title{font-size:12px;max-width:none}.editor-document small{font-size:9px;margin-top:3px;white-space:nowrap}.editor-history{gap:3px}.editor-history button{width:30px;height:33px;border:0;background:#f4f8f5}.editor-history .icon{width:16px;height:16px}.editor-how{display:none}.editor-header>.editor-primary{padding:0 9px;font-size:11px;min-height:34px}.editor-header>.editor-primary .icon{display:none}
 .editor-layout{grid-template-columns:1fr;grid-template-rows:58px minmax(0,1fr) 216px;min-height:0}.editor-tool-rail{flex-direction:row;padding:4px 8px;gap:4px;border-right:0;border-bottom:1px solid #e1e9e4;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;align-items:center}.editor-tool-rail button{flex:0 0 45px;width:45px;min-height:45px;height:45px;gap:3px;font-size:10px;padding:4px 1px;white-space:nowrap}.editor-tool-rail .icon{height:18px;width:18px}.editor-tool-rail kbd{display:none}.editor-tool-rail button.selected{box-shadow:none;border-color:#9cbea8}
 .editor-context{padding:5px 9px;gap:6px;min-height:41px;flex-wrap:nowrap}.editor-view-toggle{padding:2px;gap:1px}.editor-view-toggle button{min-height:28px;font-size:10px;padding:4px 7px}.editor-brush-controls{margin-left:0;gap:0}.editor-brush-controls label{font-size:10px;gap:4px}.editor-brush-controls #brush-size{width:37px;min-height:28px;font-size:11px;padding:2px 4px}.editor-context .editor-symmetry{display:none}.editor-zoom{gap:0}.editor-zoom button{min-width:22px;font-size:15px;min-height:29px}.editor-zoom #editor-fit{min-width:33px;font-size:10px}.editor-tool-guidance{font-size:10px;padding:6px 10px;min-height:31px;gap:7px}.editor-tool-guidance strong{font-size:10px}.editor-tool-guidance span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.editor-selection-actions{padding:5px 8px;gap:5px;overflow:auto;flex-wrap:nowrap}.editor-selection-actions button{flex-shrink:0;font-size:10px;min-height:28px;padding:4px 7px}
 #bead-editor #canvas-stage{padding:12px;background-size:14px 14px}#bead-editor #pattern-canvas{margin:12px auto}.editor-status{padding:5px 10px;min-height:25px;font-size:9px;gap:8px}.editor-status>span:last-child{max-width:45%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
 .editor-inspector{border-left:0;border-top:1px solid #dbe7df}.editor-inspector-tabs{min-height:33px;height:33px;padding:0 10px;grid-template-columns:repeat(3,1fr);position:relative}.editor-inspector-tabs button{font-size:11px;padding:6px 3px}.editor-inspector-footer{display:none}#editor-panel-palette{display:grid;grid-template-columns:104px minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:10px;padding:8px 10px 8px}.editor-current-color{margin:0;border-radius:7px;padding:8px 7px;display:flex;flex-direction:column;gap:5px;justify-content:flex-start;border:0;background:#f3f8f4}.editor-current-color>i{height:35px;width:35px;border-radius:7px}.editor-current-color>div{text-align:center;width:100%}.editor-current-color>div>span{font-size:9px}.editor-current-color strong{display:block;line-height:1.3}.editor-current-color strong b{font-size:12px;display:block}.editor-current-color strong span{display:none}.editor-current-color small{font-size:9px;line-height:1.6;display:block}.editor-current-color small>#editor-current-hex{display:none}
 .editor-palette-scroll{padding:0 2px 8px;min-width:0}.editor-used-heading,.editor-used-colors,.editor-all-heading,.editor-brand-label{display:none}.editor-search{gap:4px;padding:0 0 7px}.editor-search #editor-color-search{font-size:11px;min-height:31px;padding:6px 7px}.editor-search #editor-color-scope{font-size:10px;min-width:46px;width:46px;min-height:31px;padding:3px}#bead-editor #editor-palette{grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;padding:2px}#bead-editor #editor-palette button{font-size:8px;min-height:26px;border-radius:5px}
 .editor-scroll-panel{padding:10px 14px}.editor-scroll-panel h3{font-size:12px}.editor-scroll-panel p{font-size:11px;margin-bottom:8px}.editor-more-actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:9px 0}.editor-more-actions button{font-size:10px;min-height:36px;padding:5px}.editor-check{display:inline-flex;margin:6px 15px 6px 0;font-size:11px}.editor-empty{font-size:10px;padding-top:5px}#editor-usage-list{margin-bottom:8px}#editor-usage-list>div{padding:6px 0}#editor-usage-list>div small{display:none}.editor-tutorial p{font-size:12px}
}
@media(max-width:370px){.editor-header{gap:5px;padding-left:7px;padding-right:7px}.editor-header>.editor-primary{padding:0 7px;font-size:10px}.editor-document small{font-size:8px}.editor-history button{width:27px}.editor-context{gap:3px;padding-left:7px;padding-right:7px}.editor-view-toggle button{padding:4px 6px}.editor-brush-controls #brush-size{width:31px}.editor-brush-controls label{gap:3px}.editor-zoom button{min-width:20px}.editor-layout{grid-template-rows:56px minmax(0,1fr) 200px}#editor-panel-palette{grid-template-columns:86px minmax(0,1fr);gap:8px}.editor-search #editor-color-scope{min-width:42px;width:42px}#bead-editor #editor-palette{grid-template-columns:repeat(5,minmax(0,1fr))}}
@media(max-width:760px){#bead-editor #editor-palette button{font-size:10px}}
@media(max-width:760px) and (max-height:650px){.editor-layout{grid-template-rows:50px minmax(0,1fr) 162px}.editor-tool-rail button{min-height:40px;height:40px}.editor-tool-guidance{display:none}.editor-current-color>div>span{display:none}}
@media(max-width:1000px) and (orientation:landscape) and (max-height:550px){#bead-editor[open]{grid-template-rows:48px minmax(0,1fr)}.editor-layout{grid-template-columns:59px minmax(0,1fr) 220px;grid-template-rows:minmax(0,1fr)}.editor-tool-rail{flex-direction:column;overflow-y:auto;overflow-x:hidden;border-right:1px solid #dfe8e1}.editor-tool-rail button{min-height:43px;width:43px;flex:0 0 43px}.editor-inspector{border-left:1px solid #dfe8e1;border-top:0}#editor-panel-palette{display:flex;padding:0}.editor-current-color{display:none}.editor-palette-scroll{padding:10px}.editor-tool-guidance{display:none}#bead-editor #editor-palette{grid-template-columns:repeat(5,minmax(0,1fr))}}
.editor-tool-rail button>span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.editor-document small{max-width:100%;overflow:hidden;text-overflow:ellipsis}.editor-tool-guidance{background:#fcfdff;color:#8494a8;border-color:#eaf0f6}.editor-context,.editor-header,.editor-tool-rail,.editor-inspector,.editor-inspector-tabs,.editor-status{border-color:#e7edf4}.editor-current-color{background:#fff;border-color:#e5ecf4}.editor-current-color strong{color:#425d73}.editor-current-color>div>span,.editor-current-color small{color:#91a2b4}.editor-used-heading,.editor-all-heading{color:#607991}.editor-brand-label{color:#97a8ba}.editor-search #editor-color-search,.editor-search #editor-color-scope{border-color:#e3ebf4;color:#728ca1}.editor-status{color:#94a4b7}.editor-tool-rail button{color:#7b8c9f}#bead-editor #canvas-stage{background:#f4f7fd;background-image:none}#bead-editor #pattern-canvas{outline-color:#d6e1ed;box-shadow:0 3px 20px #233d5b0c}.editor-inspector-footer{border-color:#e5ecf5;box-shadow:none}.editor-primary{background:#147d63}
.editor-more-symmetry-label{display:flex;align-items:center;gap:12px;margin:10px 0;color:#6a859b;font-size:12px}.editor-more-symmetry-label #editor-more-symmetry{margin:0;width:110px;min-height:34px;font-size:12px;border-color:#e3ebf4}
@media(max-width:760px){html:not([lang="zh-CN"]) #bead-editor .editor-context{flex-wrap:wrap}.editor-current-color{background:#fbfdff}.editor-header>.editor-primary{max-width:126px;white-space:normal;line-height:1.3}}
