:root{font-family:Inter,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:#253f52;background:#f3f7fa;font-synthesis:none;--blue:#368fc3;--line:#e5edf2;--muted:#8ba0ae;--ink:#253f52}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit;color:inherit}button{cursor:pointer;border:0;background:none;-webkit-tap-highlight-color:transparent}button:disabled{opacity:.38;cursor:default}a{text-decoration:none;color:inherit}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,[tabindex]:focus-visible{outline:3px solid #8ccce9;outline-offset:3px}svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.svg-defs{position:absolute;width:0;height:0;overflow:hidden}[hidden]{display:none!important}.header{height:83px;display:flex;align-items:center;padding:0 35px;background:#fff;border-bottom:1px solid var(--line);gap:48px}.brand{display:flex;align-items:center;gap:12px}.brand-mark{width:31px;height:31px;display:grid;grid-template-columns:1fr 1fr;gap:3px;transform:rotate(-4deg)}.brand-mark i{background:#6bb6dd;border-radius:3px}.brand-mark i:nth-child(2){background:#bce3f4}.brand-mark i:nth-child(3){background:#3d9acc}.brand-mark i:nth-child(4){background:#90ceea}.brand>span:last-child{font-weight:750;font-size:18px;letter-spacing:2px;display:flex;align-items:center;gap:13px}.brand small{font-size:12px;font-weight:500;letter-spacing:3px;color:#7490a0}.main-nav{display:flex;align-self:stretch;gap:30px}.main-nav button{font-size:12px;position:relative;padding:0 2px;color:#8ca1af}.main-nav button.active{color:#308cbd;font-weight:600}.main-nav button.active:after{content:"";height:2px;position:absolute;left:0;right:0;bottom:0;background:#409fce}.main-nav span{font-size:9px;padding:2px 5px;background:#eef5f9;border-radius:4px;margin-left:4px}.header-end{margin-left:auto;display:flex;align-items:center;gap:20px}.private{display:flex;align-items:center;gap:6px;font-size:10px;color:#5c8da6;padding:7px 11px;background:#f0f7fa;border:1px solid #deedf4;border-radius:20px}.private svg{width:12px;height:12px}.avatar{width:32px;height:32px;display:grid;place-items:center;background:#edf5fa;border:1px solid #dfeef5;border-radius:50%;font-size:12px;color:#6c9ab2}main{max-width:1780px;margin:auto;padding:0 30px}.intro{display:flex;align-items:center;justify-content:space-between;padding:28px 3px 26px}.eyebrow{font-size:8px;letter-spacing:1.7px;color:#90a7b5;line-height:1.6;font-weight:500}h1{font-size:25px;letter-spacing:.8px;font-weight:600;margin:7px 0}.intro p{font-size:11px;color:#8ea3b1;margin:8px 0 0}.local-note{font-size:9px;color:#8ba4b3;display:flex;gap:7px;align-items:center}.green-dot{height:5px;width:5px;background:#85b8a5;border-radius:50%}.note-divider{width:1px;height:12px;background:#dce7ee;margin:0 5px}.workspace{display:grid;grid-template-columns:243px minmax(0,1fr) 258px;gap:16px;align-items:stretch}.panel{background:#fff;border:1px solid #e1eaf0;border-radius:13px;box-shadow:0 4px 19px #1d557406;min-width:0}.setup{padding:20px 18px}.panel-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:18px}.panel-title h2{font-size:13px;letter-spacing:.4px;font-weight:600;margin:0}.small-label{font-size:7px;letter-spacing:1px;color:#a2b3bf}.dropzone{border:1px dashed #a9cfe1;border-radius:9px;background:#f5fafe;padding:19px 5px 17px;text-align:center;cursor:pointer;transition:background .2s,border-color .2s}.dropzone:hover,.dropzone.drag-over{border-color:#4299c8;background:#eaf6fd}.upload-symbol{position:relative;margin:0 auto 10px;width:33px;color:#75b3d3}.upload-symbol>svg{width:30px;height:30px;stroke-width:1.2}.upload-symbol span{position:absolute;font-size:13px;right:-5px;top:0;background:#dceef8;border-radius:50%;width:14px;height:14px;line-height:14px}.dropzone strong{font-size:11px;font-weight:500}.dropzone p{font-size:9px;margin:7px 0 12px;color:#99adba}.format-hint{font-size:7px;letter-spacing:.3px;color:#9eb4c2}.upload-actions{display:flex;justify-content:space-between;margin:10px 0 17px}.upload-actions button{font-size:9px;padding:0;color:#729db5}.upload-actions button:hover{color:#318dbf}.task-list{display:flex;flex-direction:column;gap:5px;max-height:143px;overflow:auto;scrollbar-width:thin;margin-bottom:5px}.task-row{display:flex;gap:7px;align-items:center;background:#f8fbfd;border:1px solid #edf3f7;border-radius:6px;padding:6px 7px;cursor:pointer;text-align:left;width:100%}.task-row.active{background:#edf8fd;border-color:#bfe0f1}.task-row img{width:29px;height:29px;object-fit:contain;border-radius:3px;background:#fff}.task-row>span{min-width:0;flex:1}.task-row strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9px;font-weight:500}.task-row small{font-size:8px;color:#99acb9}.task-row .task-status{font-size:7px;color:#85a9bc}.task-row .task-status.error{color:#bd7e73}.setting-group{margin-top:18px}.setting-group>label,.field-label>label{font-size:10px;font-weight:550;display:flex;align-items:center;gap:8px;margin-bottom:9px}.setting-group label>span{font-size:8px;font-weight:400;color:#a1b2bd;margin-left:auto}.segmented{display:flex;border:1px solid var(--line);background:#f6f9fb;border-radius:6px;padding:3px;gap:3px}.segmented button{flex:1;font-size:10px;padding:7px 3px;color:#8ca3b2;border-radius:4px}.segmented button.active{background:#fff;color:#3589b6;box-shadow:0 1px 5px #34536a12}.field-label{display:flex;justify-content:space-between;align-items:center;margin-bottom:5px}.field-label>label{margin:0}.field-label>span{display:flex;align-items:center;gap:5px;font-size:9px;color:#94a9b7}.field-label input{width:43px;padding:4px 3px;text-align:center;border:1px solid #dce8ef;border-radius:4px;font-size:11px;background:#fafcfd;appearance:textfield}.field-label input::-webkit-inner-spin-button{appearance:none}input[type=range]{width:100%;height:3px;margin:11px 0 14px;accent-color:#5aa7d0;cursor:pointer}.size-presets{display:flex;gap:6px}.size-presets button{flex:1;font-size:9px;border:1px solid #e4edf3;border-radius:5px;padding:5px;color:#8aa4b4}.size-presets button.active{border-color:#add4e9;background:#f0f8fd;color:#428fb8}.field-hint{font-size:8px;line-height:1.8;color:#9cafbc;margin:8px 0 0}.setting-group select,.color-selection select{width:100%;background:#fbfcfd;border:1px solid #e1eaf0;border-radius:6px;padding:8px 8px;font-size:9px;outline-offset:2px}.checkbox-label{display:flex;gap:5px;margin-top:12px!important;align-items:center;font-size:9px!important;color:#6f90a3;font-weight:400!important}.checkbox-label input{margin:0;accent-color:#439bca;width:12px;height:12px}.checkbox-label span{font-size:7px!important;color:#a8bac6}.primary-button{background:#3b96c7;color:#fff;display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 15px;font-size:11px;font-weight:500;border-radius:7px;transition:background .15s;box-shadow:0 4px 10px #3b96c714}.primary-button:hover{background:#2e87b7}.primary-button b{font-size:17px;line-height:12px;font-weight:400}.setup>.primary-button{margin-top:21px}.setup-footer{text-align:center;font-size:8px;color:#a7b8c3;line-height:1.8;margin:11px 0 0}.viewer{display:flex;flex-direction:column;overflow:hidden;min-width:0}.viewer-title{display:flex;align-items:center;justify-content:space-between;padding:22px 22px 20px;gap:8px}.viewer-title h2{font-size:18px;font-weight:600;margin:8px 0 0;letter-spacing:.5px;max-width:350px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.candidate-badge{font-size:8px;background:#edf6fb;padding:3px 5px;color:#6c9bb5;border-radius:4px;margin-left:6px;letter-spacing:0}.title-actions{display:flex;align-items:center;gap:8px}.subtle-button{font-size:9px;border:1px solid var(--line);padding:7px 9px;border-radius:5px;color:#7597ac;white-space:nowrap}.subtle-button:hover{background:#f2f8fc}.export-button{display:flex;gap:5px;align-items:center;font-size:9px;background:#eaf5fb;padding:7px 9px;border-radius:5px;color:#3d8bb5}.export-button svg{width:13px;height:13px}.view-tabs{display:flex;border-bottom:1px solid var(--line);padding:0 22px;gap:26px;overflow:auto;scrollbar-width:none}.view-tabs button{position:relative;white-space:nowrap;font-size:10px;color:#91a7b5;padding:0 0 13px}.view-tabs button.active{color:#328ab9;font-weight:600}.view-tabs button.active:after{content:"";position:absolute;height:2px;left:0;right:0;bottom:0;background:#459fce}.editor-bar{height:49px;padding:0 17px;display:flex;justify-content:space-between;align-items:center;gap:7px}.tools,.display-tools{display:flex;align-items:center;gap:3px}.editor-bar button{width:29px;height:28px;display:grid;place-items:center;color:#8ca6b7;border-radius:5px;font-size:12px}.editor-bar button:hover{background:#f3f8fc}.editor-bar button.active{background:#eaf5fc;color:#3f93c1}.editor-bar svg{width:14px;height:14px}.tool-separator{height:14px;width:1px;background:var(--line);margin:0 4px}.canvas-meta{height:29px;padding:0 22px;display:flex;align-items:flex-start;gap:10px;font-size:8px;color:#8da5b5}.canvas-meta #edit-hint{font-size:8px;color:#a0b3bf;margin-left:auto}#dirty-label{color:#bd9b6a}.viewport{position:relative;margin:0 12px;border:1px solid #e4edf3;border-radius:8px;background:#f0f5f9;background-image:radial-gradient(#cfdee8 .6px,transparent .6px);background-size:12px 12px;overflow:auto;min-height:430px;height:480px;flex:1;scrollbar-width:thin;scrollbar-color:#c8dce8 transparent;overscroll-behavior:contain;cursor:grab;touch-action:pan-x pan-y}.viewport.edit-mode{cursor:crosshair;touch-action:none}.viewport.dragging{cursor:grabbing;user-select:none}.art-stage{display:flex;align-items:center;justify-content:center;gap:22px;min-height:100%;min-width:100%;width:max-content;padding:26px}.art-frame{flex:none;position:relative;background:#fff;box-shadow:0 4px 16px #335a7610;border:1px solid #dbe6ee;padding:22px}.art-frame:before,.art-frame:after{content:"";position:absolute;pointer-events:none;width:7px;height:7px;border:1px solid #bacfdc}.art-frame:before{left:8px;top:8px;border-right:0;border-bottom:0}.art-frame:after{right:8px;bottom:8px;border-left:0;border-top:0}.art-frame>svg{display:block;max-width:none;stroke:none}.frame-caption{display:flex;justify-content:space-between;gap:18px;font-size:8px;letter-spacing:1px;color:#91a9b8;margin-bottom:13px}.frame-footer{display:flex;justify-content:space-between;gap:10px;font-size:6px;letter-spacing:.7px;color:#b1c0cb;margin-top:13px}.frame-footer b{font-size:7px;font-weight:600;color:#86a7ba;letter-spacing:1.2px}.frame-footer small{font-size:6px;margin-left:4px;font-weight:400}.source-frame .source-image{display:block;width:100%;height:100%;object-fit:contain;background:repeating-conic-gradient(#f1f5f8 0 25%,white 0 50%) 0/12px 12px}.source-image-wrap{width:100%;height:100%}.zoom-bar{display:flex;justify-content:space-between;align-items:center;height:53px;padding:0 21px;font-size:8px;color:#a2b5c1;gap:8px}.zoom-controls{display:flex;align-items:center;gap:3px;flex:none}.zoom-controls button{padding:5px 7px;border-radius:5px;font-size:10px;color:#6b8fa5}.zoom-controls button:hover{background:#f0f7fc}.zoom-controls button:first-child,.zoom-controls button:nth-child(3){font-size:16px;width:24px;padding:3px}.zoom-controls i{height:12px;width:1px;background:var(--line);margin:0 6px}#zoom-value{font-size:9px;min-width:43px;font-variant-numeric:tabular-nums}.viewer-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 20px;border-top:1px solid #edf2f6;margin-top:auto;font-size:8px;color:#98afbd;min-height:42px}.viewer-footer>span{display:flex;align-items:center;gap:6px}.blue-dot{width:5px;height:5px;border-radius:50%;background:#88bed9;flex:none}.viewer-footer button{padding:0;font-size:8px;color:#7d9fb4;white-space:nowrap}.palette{padding:22px 18px 15px;display:flex;flex-direction:column;max-height:920px}.palette .panel-title{margin-bottom:20px}.palette .panel-title h2{margin-top:6px;font-size:13px}.palette-deco{height:8px;width:8px;background:#d0eaf6;border-radius:50%;box-shadow:0 0 0 5px #f4f9fc}.metrics{display:grid;grid-template-columns:1fr 1fr;background:#f4f9fc;border:1px solid #e6f0f6;padding:16px 0;border-radius:8px;margin-bottom:17px}.metrics>div{text-align:center;display:flex;flex-direction:column;gap:6px}.metrics>div+div{border-left:1px solid #dfeaf2}.metrics strong{font-size:25px;font-weight:550;letter-spacing:-.4px;color:#3e80a6;font-variant-numeric:tabular-nums}.metrics span{font-size:9px;color:#93a9b8}.brush-card{display:flex;align-items:center;gap:9px;padding:10px;border:1px solid var(--line);border-radius:7px;background:#fcfdfe;margin-bottom:16px}.brush-swatch{width:26px;height:26px;border-radius:6px;border:1px solid #0001}.brush-card>div{display:flex;flex-direction:column;gap:3px}.brush-card small{font-size:7px;color:#9bb0be}.brush-card strong{font-size:10px;font-weight:600}.brush-card button{font-size:8px;margin-left:auto;color:#789fb7;padding:0}.brush-card button span{margin-left:4px;color:#5c99bb}.palette-filters{display:flex;align-items:center;border-bottom:1px solid var(--line);gap:15px;margin-bottom:7px}.palette-filters button{font-size:9px;color:#95aab8;padding:0 0 10px;position:relative}.palette-filters button.active{color:#3e8eb9}.palette-filters button.active:after{content:"";position:absolute;bottom:-1px;height:2px;background:#6cb2d6;left:0;right:0}.palette-filters span{font-size:7px;border-radius:3px;background:#f4f6f8;padding:2px 4px;margin-left:3px;color:#a1b2bd}.palette-filters button:last-child{margin-left:auto;font-size:12px}.color-list{flex:1;min-height:170px;max-height:410px;overflow:auto;scrollbar-width:thin;scrollbar-color:#d0e3ee transparent}.color-row{display:flex;align-items:center;gap:9px;padding:8px 5px;width:100%;border:1px solid transparent;border-radius:6px;text-align:left}.color-row:hover{background:#f7fafc}.color-row.active{background:#edf7fd;border-color:#c8e4f3}.swatch{position:relative;height:26px;width:26px;border-radius:5px;border:1px solid #0000000d;flex:none}.swatch svg{position:absolute;inset:6px;height:13px;width:13px;color:#fff;filter:drop-shadow(0 1px 1px #0008)}.color-meta{display:flex;flex-direction:column;gap:4px}.color-meta b{font-size:10px;letter-spacing:.1px;font-weight:600}.color-meta small{font-size:7px;letter-spacing:.3px;color:#9eb2bf}.color-amount{font-size:10px;color:#7291a5;margin-left:auto;display:flex;align-items:center;gap:5px;font-variant-numeric:tabular-nums}.color-amount small{font-size:7px;color:#aebdc7}.low-dot{height:4px;width:4px;border-radius:50%;background:#d5bd91}.color-selection{margin-top:11px;padding:11px;background:#f3f9fd;border:1px solid #e1eef6;border-radius:7px}.color-selection>div{display:flex;justify-content:space-between;align-items:center}.color-selection strong{font-size:10px;color:#498eaf}.color-selection>div button{padding:0;color:#92aebf;font-size:15px}.color-selection p{font-size:8px;color:#91a9b8;line-height:1.7;margin:6px 0 9px}.color-selection label{font-size:8px;color:#789bad;display:block;margin-bottom:6px}.color-selection select{background:#fff;padding:6px;font-size:9px}.small-button{font-size:9px;width:100%;padding:8px;background:#e1f0f9;color:#468daf;border-radius:5px;margin-top:7px}.palette-notes{display:flex;align-items:flex-start;gap:7px;border-top:1px solid var(--line);padding-top:13px;margin-top:13px}.note-icon{font-size:8px;color:#9cb5c4;border:1px solid #b9cbd6;border-radius:50%;width:11px;height:11px;text-align:center;line-height:10px;flex:none;margin-top:2px}.palette-notes p{font-size:8px;line-height:1.8;color:#a1b4c0;margin:0}.text-button{font-size:9px;color:#6ca1bd;margin-top:10px;padding:0}.footer{display:flex;align-items:center;justify-content:space-between;padding:23px 2px;font-size:7px;letter-spacing:1.5px;color:#acbecb}.footer>span:first-child{font-weight:600;color:#88a8bb;letter-spacing:1.7px}.footer i{font-size:7px;font-style:normal;margin-left:9px;font-weight:400;letter-spacing:2px}.footer p{font-size:8px;letter-spacing:.5px}.footer b{font-weight:400;margin-left:10px}.toast{position:fixed;left:50%;bottom:25px;transform:translate(-50%,10px);background:#25495f;color:white;box-shadow:0 7px 30px #25506b30;font-size:11px;padding:12px 20px;border-radius:8px;opacity:0;pointer-events:none;transition:.2s;z-index:100;max-width:90vw;width:max-content}.toast.visible{opacity:1;transform:translate(-50%,0)}.loading{position:fixed;inset:0;background:#f4f8fb;display:grid;place-items:center;color:#7f9dae;font-size:12px;z-index:200}.modal{padding:24px;border:1px solid #dce8f0;border-radius:14px;box-shadow:0 30px 100px #234c6c30;color:var(--ink);background:#fff;max-width:calc(100vw - 30px);max-height:85vh}.modal::backdrop{background:#264d6845;backdrop-filter:blur(3px)}.modal-heading{display:flex;justify-content:space-between;align-items:start;gap:20px;margin-bottom:19px}.modal-heading h2{font-size:19px;font-weight:550;margin:6px 0 0}.modal-heading>button{font-size:24px;font-weight:300;padding:0 2px;color:#88a5b7;line-height:1}.color-modal{width:590px}.search-box{height:36px;border:1px solid var(--line);display:flex;align-items:center;gap:8px;border-radius:7px;background:#fbfdfe;padding:0 11px}.search-box svg{height:14px;width:14px;color:#9eb5c3}.search-box input{border:0;background:none;outline:none;font-size:10px;width:100%}.full-palette{display:grid;grid-template-columns:repeat(10,1fr);gap:8px;max-height:385px;overflow:auto;margin-top:18px;padding:3px}.full-palette button{padding:0;text-align:center;font-size:8px;color:#7a99ad;border:1px solid transparent;border-radius:5px}.full-palette button.active{border-color:#439bc7;box-shadow:0 0 0 2px #439bc71a}.full-palette button>span{height:28px;display:block;margin:3px 3px 5px;border-radius:4px;border:1px solid #0001}.full-palette button>small{font-size:7px;display:block;margin-bottom:4px}.modal-note{font-size:8px;color:#9db3c1;line-height:1.8;margin:17px 0 0}.export-modal{width:440px}.export-note{font-size:9px;color:#9bb0be;background:#f4f9fc;border-radius:6px;padding:10px;margin:0 0 14px}.export-options{display:flex;flex-direction:column;gap:7px}.export-options>button{display:flex;align-items:center;gap:13px;width:100%;padding:13px;border:1px solid var(--line);border-radius:7px;text-align:left}.export-options>button:hover{background:#f4faff;border-color:#c3e0f0}.export-options svg{color:#80acc5;width:18px;height:18px}.export-options span{display:flex;flex-direction:column;gap:5px}.export-options strong{font-size:11px;font-weight:500}.export-options small{font-size:8px;color:#9cb2c0}.export-options b{margin-left:auto;color:#80abc4;font-size:16px;font-weight:400}.library-view{padding:30px;min-height:650px}.library-heading{display:flex;justify-content:space-between;gap:25px;align-items:center;margin-bottom:30px}.library-heading h2{font-size:23px;font-weight:550;margin:9px 0}.library-heading p{font-size:11px;color:#8ca4b3}.library-heading .primary-button{width:auto;white-space:nowrap;gap:20px}.saved-list{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}.saved-card{padding:13px;background:#fff;border:1px solid var(--line);border-radius:10px;min-width:0}.saved-preview{width:100%;height:155px;display:grid;place-items:center;background:#f1f7fb;border-radius:7px;cursor:pointer}.saved-preview svg{width:auto;height:130px;max-width:90%;stroke:none}.saved-card h3{font-size:12px;font-weight:500;margin:13px 0 7px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.saved-card p{font-size:9px;color:#96adbc;margin:0}.saved-actions{display:flex;justify-content:space-between;margin-top:14px}.saved-actions button{font-size:9px;padding:0;color:#5d97b7}.saved-actions .remove-saved{color:#b5a3a3}.examples-heading{display:flex;justify-content:space-between;align-items:center;border-top:1px solid var(--line);padding-top:25px;margin-top:35px;margin-bottom:18px}.examples-heading h3{font-size:13px;font-weight:500;margin:0}.examples-heading span{font-size:8px;color:#9fb4c2;letter-spacing:1.4px}.empty-library{grid-column:1/-1;border:1px dashed #d8e6ef;border-radius:10px;text-align:center;padding:48px;font-size:12px;color:#91a9b8}.palette-sheet{width:600px;flex:none;background:#fff;padding:28px;border:1px solid #e0eaf1;box-shadow:0 5px 17px #345b7610}.sheet-header{display:flex;justify-content:space-between;align-items:end;border-bottom:1px solid #e7eef3;padding-bottom:16px;gap:12px}.sheet-header small{font-size:8px;color:#92adbd;letter-spacing:1.5px}.sheet-header h3{font-size:17px;font-weight:550;margin:7px 0 0}.sheet-header>span{font-size:10px;color:#7a9eb4;white-space:nowrap}.sheet-content{display:grid;grid-template-columns:40% 1fr;gap:27px;padding:24px 0}.sheet-art svg{height:auto;width:100%;stroke:none}.sheet-art p{font-size:8px;text-align:center;color:#9fb3c0;margin-top:13px}.sheet-colors{display:grid;grid-template-columns:repeat(3,1fr);gap:12px 10px;align-content:start}.sheet-color{display:flex;gap:6px;align-items:center;font-size:9px}.sheet-color i{width:18px;height:18px;flex:none;border-radius:50%;border:1px solid #0001}.sheet-color span{display:flex;flex-direction:column;gap:3px}.sheet-color small{font-size:7px;color:#99adbc}.sheet-total{padding-top:15px;border-top:1px solid #e7eef3;text-align:right;font-size:9px;color:#8fa9ba}.sheet-total b{font-size:21px;margin-left:8px;color:#5b8da9;font-weight:500}.sheet-note{font-size:8px;color:#b1c1cc;margin:17px 0 0}.viewer:fullscreen{border-radius:0;max-height:100vh;background:#fff}.viewer:fullscreen .viewport{height:auto}.viewer:fullscreen .viewer-footer{margin-top:0}.viewer:fullscreen .canvas-meta{height:30px;flex:none}
@media(min-width:1650px){.workspace{grid-template-columns:264px minmax(0,1fr) 280px;gap:20px}.viewport{height:555px}.setup{padding:23px}.palette{padding:25px 22px}.color-list{max-height:450px}.header{padding:0 40px}main{padding:0 40px}.intro{padding:32px 3px 28px}.viewer-title{padding:25px}}
@media(max-width:1220px){main{padding:0 20px}.header{padding:0 24px;gap:35px}.workspace{grid-template-columns:215px minmax(0,1fr) 226px;gap:11px}.setup{padding:18px 14px}.palette{padding:20px 14px 14px}.panel-title h2{font-size:12px}.small-label{font-size:6px}.viewer-title{padding:20px 17px 18px}.viewer-title h2{font-size:16px;max-width:220px}.viewer-title .eyebrow{font-size:6px;letter-spacing:1px}.candidate-badge{font-size:7px}.view-tabs{padding:0 17px;gap:20px}.view-tabs button{font-size:9px}.editor-bar{padding:0 12px}.editor-bar button{width:26px}.canvas-meta{padding:0 17px}.canvas-meta #edit-hint{font-size:7px}.zoom-bar>span{display:none}.zoom-bar{justify-content:center}.title-actions{gap:5px}.subtle-button{font-size:8px;padding:7px}.export-button{font-size:8px;padding:7px}.export-button svg{width:12px}.viewer-footer{padding:12px 15px;font-size:7px}.viewer-footer button{font-size:7px}.palette .panel-title h2{font-size:12px}.color-row{gap:8px}.color-amount{font-size:9px}.metrics strong{font-size:22px}.palette-filters{gap:12px}.palette-filters button{font-size:8px}.saved-list{grid-template-columns:repeat(3,1fr)}}
@media(max-width:1000px){.workspace{grid-template-columns:215px minmax(0,1fr)}.palette{grid-column:1/-1;max-height:none;position:relative}.palette .panel-title{margin-bottom:15px}.metrics{position:absolute;right:18px;top:18px;width:170px;padding:9px 0;margin:0}.metrics strong{font-size:20px}.metrics span{font-size:8px}.brush-card{width:220px;margin-bottom:15px}.palette-filters{margin-top:3px}.color-list{display:grid;grid-template-columns:repeat(5,1fr);gap:3px 18px;max-height:200px;min-height:0}.palette-notes{margin-top:15px}.color-selection{max-width:500px}.local-note{font-size:8px}.view-tabs{justify-content:space-between;gap:15px}.palette .palette-deco{display:none}.color-amount small{display:none}.color-selection>p{line-height:1.8}.viewport{min-height:450px}.saved-list{grid-template-columns:repeat(3,1fr)}}
@media(max-width:720px){.header{height:69px;padding:0 15px;gap:0;flex-wrap:wrap}.brand-mark{width:26px;height:26px}.brand>span:last-child{font-size:14px;letter-spacing:1.4px;gap:8px}.brand small{font-size:10px;letter-spacing:2px}.main-nav{margin-left:26px;gap:17px}.main-nav button{font-size:10px}.main-nav span{font-size:7px;margin-left:1px;padding:1px 3px}.avatar{display:none}.header-end{gap:0}.private{font-size:0;border:0;background:none;padding:0}.private svg{width:14px;height:14px}.intro{padding:24px 3px 21px}.eyebrow{font-size:7px;letter-spacing:1.2px}h1{font-size:21px;letter-spacing:0;line-height:1.5;margin:7px 0}.intro p{font-size:10px;margin-top:6px}.local-note{display:none}main{padding:0 12px}.workspace{display:flex;flex-direction:column;gap:12px}.setup{padding:17px;display:grid;grid-template-columns:1fr 1fr;gap:0 16px}.setup .panel-title{grid-column:1/-1;margin-bottom:15px}.setup .dropzone{grid-column:1/-1;padding:16px}.upload-symbol{display:inline-block;width:25px;margin:0 12px 0 0;vertical-align:middle}.upload-symbol>svg{width:25px;height:25px}.dropzone strong{font-size:11px}.dropzone p{display:inline-block;font-size:8px;margin:0 0 0 9px}.format-hint{display:block;margin-top:10px;font-size:7px}.upload-actions{grid-column:1/-1;margin:10px 0 2px}.task-list{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;max-height:110px;margin:8px 0 0}.setting-group{margin-top:15px}.setting-group>label,.field-label>label{font-size:9px}.setting-group label>span{display:none}.field-label{min-height:20px}.setting-group select{font-size:8px;padding:8px 5px}.field-hint{font-size:7px}.segmented button{font-size:9px;padding:8px 1px}.size-presets{gap:5px}.size-presets button{font-size:8px;padding:4px}.setting-group:has(#longest){grid-column:2;grid-row:5/7}.setting-group:has(#background){grid-column:1}.setting-group:has(#color-limit){grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;column-gap:15px;align-items:center;margin-top:14px}.setting-group:has(#color-limit)>label:first-child{grid-column:1/-1}.checkbox-label{margin-top:0!important;font-size:8px!important}.setup>.primary-button{grid-column:1/-1;margin-top:17px;padding:11px 14px;font-size:11px}.setup-footer{grid-column:1/-1;margin:8px 0 0;font-size:7px}.setup-footer br{display:none}.viewer-title{padding:20px 16px 18px}.viewer-title h2{font-size:16px;max-width:190px}.viewer-title .eyebrow{font-size:6px;letter-spacing:.8px}.candidate-badge{font-size:6px;margin-left:4px}.title-actions{gap:5px}.subtle-button{font-size:8px;padding:6px}.export-button{font-size:8px;padding:6px}.export-button svg{width:11px}.view-tabs{padding:0 16px;gap:14px;justify-content:space-between}.view-tabs button{font-size:9px;padding-bottom:12px}.editor-bar{height:46px;padding:0 10px}.editor-bar button{width:25px;height:27px}.editor-bar svg{width:13px;height:13px}.tools,.display-tools{gap:2px}.tool-separator{margin:0 3px}.canvas-meta{padding:0 15px;height:25px;font-size:7px}.canvas-meta #edit-hint{font-size:7px}.viewport{height:365px;min-height:365px;margin:0 7px}.art-stage{padding:18px;gap:15px}.art-frame{padding:17px}.frame-caption{font-size:6px;gap:10px;margin-bottom:10px}.frame-footer{font-size:5px;margin-top:10px}.frame-footer b{font-size:6px}.zoom-bar{height:48px}.viewer-footer{font-size:7px;padding:11px 14px;gap:7px}.viewer-footer button{font-size:7px}.palette{padding:20px 17px 16px}.metrics{right:17px;top:16px;width:150px}.metrics strong{font-size:18px}.metrics span{font-size:7px}.palette .panel-title{margin-bottom:17px}.palette .panel-title .eyebrow{font-size:6px}.palette .panel-title h2{font-size:12px}.brush-card{width:100%;margin-top:20px;padding:8px}.brush-card button{font-size:9px}.palette-filters button{font-size:9px}.color-list{grid-template-columns:repeat(3,1fr);gap:4px 9px;max-height:240px}.color-row{gap:7px;padding:8px 3px}.swatch{width:24px;height:24px}.color-meta b{font-size:9px}.color-meta small{font-size:6px}.color-amount{font-size:9px}.palette-notes p{font-size:8px}.footer{padding:22px 3px;font-size:6px;letter-spacing:1px}.footer>span:first-child{font-size:7px}.footer p,.footer i{display:none}.modal{padding:21px;max-width:calc(100vw - 24px)}.modal-heading h2{font-size:18px}.full-palette{grid-template-columns:repeat(7,1fr);gap:6px;max-height:400px}.full-palette button>span{height:26px}.modal-note{font-size:7px}.library-view{padding:20px 17px;min-height:600px}.library-heading{gap:10px;align-items:flex-start}.library-heading h2{font-size:20px}.library-heading p{font-size:9px;line-height:1.8}.library-heading .primary-button{font-size:9px;padding:9px 11px}.saved-list{grid-template-columns:repeat(2,1fr);gap:12px}.saved-card{padding:10px}.saved-preview{height:125px}.saved-preview svg{height:108px}.saved-card h3{font-size:10px}.saved-card p{font-size:8px}.saved-actions button{font-size:8px}.examples-heading span{font-size:6px;letter-spacing:1px}.examples-heading h3{font-size:11px}.toast{font-size:10px;line-height:1.7}.viewer:fullscreen .viewport{min-height:0}}
@media(max-width:380px){.main-nav{margin-left:18px;gap:12px}.brand small{display:none}.private{display:none}.canvas-meta #edit-hint{max-width:170px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.view-tabs{gap:10px}.title-actions .subtle-button{padding:6px 5px}.viewer-title h2{max-width:165px}.editor-bar button{width:23px}.dropzone p{margin-left:4px;font-size:7px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}
/* Give the work area a stable height so fitting does not enlarge its own parent. */
.viewer{height:780px;min-height:0}.viewport{min-height:0}.palette{max-height:780px}
@media(min-width:1650px){.viewer{height:820px}.palette{max-height:820px}}
@media(max-width:1000px){.palette{max-height:none}}
@media(max-width:720px){.viewer{height:640px}.viewport{min-height:280px;height:365px}}
.viewer:fullscreen{height:100vh}
.export-ready{display:flex;gap:13px;align-items:center;padding:13px;border:1px solid #cce6f4;border-radius:8px;background:#f1f9fd;margin-top:15px}.export-ready img{width:66px;height:66px;object-fit:contain;background:#fff;border:1px solid #e0ecf3;border-radius:4px}.export-ready>div{min-width:0;display:flex;flex-direction:column;gap:6px}.export-ready strong{font-size:10px;font-weight:550;color:#4a8eaf}.export-ready a{font-size:9px;word-break:break-all;color:#3789b5;text-decoration:underline;text-underline-offset:3px}.export-ready small{font-size:8px;color:#95acbb}
@media(max-width:720px){.setting-group>label,.field-label>label{font-size:11px}.setting-group select{font-size:10px}.field-hint{font-size:9px}.segmented button{font-size:11px}.size-presets button{font-size:10px}.setup-footer{font-size:8px}.canvas-meta,.canvas-meta #edit-hint{font-size:8px}.color-meta b,.color-amount{font-size:11px}.color-meta small{font-size:8px}.palette-notes p{font-size:9px}.setup .small-label{font-size:7px}}
@media(max-width:720px){.multi-view .frame-caption>span:nth-child(2),.multi-view .frame-footer>span{display:none}.multi-view .frame-caption{font-size:5px;letter-spacing:.6px;gap:0}.multi-view .frame-footer b{font-size:5px;letter-spacing:.6px}.multi-view .frame-footer small{font-size:4px}}
/* Compact controls: explanations appear on demand. */
.intro{padding:22px 3px 20px;min-height:70px}.intro h1{font-size:22px;margin:0;letter-spacing:.3px}.local-note{font-size:10px;color:#7895a7}.setup{padding:20px 18px}.setup .panel-title{margin-bottom:15px}.panel-title h2{font-size:13px}.dropzone{padding:18px 6px 16px}.dropzone strong{font-size:12px}.dropzone p{font-size:10px;color:#809dad;margin:7px 0 11px}.format-hint{font-size:8px;color:#93aab9}.upload-actions button{font-size:10px;color:#518eae}.setting-group{margin-top:17px}.setting-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:28px;margin-bottom:6px}.setting-heading>label{margin:0;font-size:11px;font-weight:550}.help-button{display:inline-grid;place-items:center;width:28px;height:28px;min-width:28px;padding:0;background:none;border:0;flex:none;vertical-align:middle;color:#fff;cursor:pointer}.help-button>span{display:grid;place-items:center;width:17px;height:17px;line-height:17px;border-radius:50%;background:#75a9c7;color:#fff;font-family:Arial,sans-serif;font-size:11px;font-weight:700;box-shadow:0 1px 2px #2d73960b}.help-button:hover>span{background:#3d91be}.help-button:focus-visible{outline:2px solid #8ccce9;border-radius:5px;outline-offset:1px}.segmented button{font-size:11px;padding:8px 3px}.setting-group select{font-size:10px;color:#466a81;padding:9px 8px}.dimension-fields{display:flex;align-items:center;gap:5px}.dimension-fields>label{display:flex;align-items:center;gap:5px;flex:1;min-width:0;font-size:9px;color:#718fa3}.dimension-fields input{min-width:0;width:100%;padding:8px 5px;text-align:center;font-size:12px;border:1px solid #dce8ef;border-radius:5px;background:#fbfdfe;color:#365e76;appearance:textfield}.dimension-fields input::-webkit-inner-spin-button{appearance:none}.dimension-times{font-size:12px;color:#99b1c0;margin:0 1px}.aspect-label{font-size:10px!important;margin:10px 0 10px!important;color:#6d8ca0}.checkbox-label input{width:13px;height:13px}.size-presets button{font-size:10px;padding:6px}.color-limit-field{display:flex;align-items:center;gap:7px;color:#7895a8;font-size:10px}.color-limit-field input{width:72px;background:#fbfdfe;border:1px solid #dce8ef;border-radius:5px;padding:8px 7px;font-size:12px;text-align:center;appearance:textfield}.color-limit-field input::-webkit-inner-spin-button{appearance:none}.color-limit-field small{font-size:9px;color:#93aab9;margin-left:auto}.checkbox-help{display:flex;justify-content:space-between;align-items:center;margin-top:9px;gap:3px}.checkbox-help .checkbox-label{margin:0!important;font-size:10px!important;font-weight:400!important;gap:6px}.setup>.primary-button{margin-top:20px}.viewer-title{padding-top:18px;padding-bottom:17px}.preview-status{display:flex;align-items:center;gap:1px;height:24px}.preview-status .candidate-badge{font-size:8px;letter-spacing:0;margin:0;background:#eef6fb;color:#729bb3;padding:3px 6px;border-radius:4px}.preview-status .help-button{width:25px;min-width:25px;height:24px}.preview-status .help-button>span{width:13px;height:13px;font-size:9px;line-height:13px;background:#9ab9cd}.viewer-title h2{margin-top:5px}.title-actions{gap:7px}.subtle-button{font-size:10px;padding:8px 10px;color:#668da5}.export-button{font-size:10px;padding:8px 10px;white-space:nowrap}.view-switches{display:flex;align-items:center;gap:7px;padding:0 20px 14px;border-bottom:1px solid var(--line);overflow:auto;scrollbar-width:none}.view-switches button{display:flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap;font-size:10px;color:#7895a8;background:#f8fbfd;border:1px solid #e4edf3;border-radius:5px;padding:7px 9px;min-height:30px}.view-switches button.active{background:#eaf5fc;border-color:#b5daed;color:#3188b5}.view-switches button.active:before{content:"";display:block;width:4px;height:4px;border-radius:50%;background:#4c9bc5}.view-switches button:hover{border-color:#aed2e6}.canvas-meta #edit-hint{color:#7896a8}.viewer-footer{min-height:40px;padding:11px 20px}.viewer-footer #status-label{color:#829eaf}.palette .panel-title{margin-bottom:13px}.palette .panel-title h2{margin:0}.brush-card{padding:10px;gap:8px}.brush-card #brush-swatch{width:31px;height:31px;min-width:31px;margin:0;border:1px solid #00000012;border-radius:6px;box-shadow:0 1px 4px #24547709;cursor:pointer}.brush-card #brush-swatch:hover{box-shadow:0 0 0 3px #d8ecf7}.brush-card small{font-size:8px;color:#8ca6b7}.brush-card #choose-color{display:flex;align-items:center;justify-content:center;gap:3px;min-height:32px;font-size:9px;color:#3d89b2;background:#eaf5fc;border:1px solid #d8eaf5;border-radius:5px;padding:6px 8px;white-space:nowrap}.brush-card #choose-color:hover{background:#dfeff9}.brush-card #choose-color span{margin-left:2px;color:#4e94bb}.palette-filters{gap:13px}.palette-filters button{font-size:10px;color:#829dad}.color-meta b{font-size:11px}.color-meta small{font-size:8px;color:#91a8b8}.color-amount{font-size:11px;color:#688ba2}.library-title{display:flex;align-items:center;gap:7px}.library-title h2{margin:0}.library-heading{margin-bottom:26px}.library-heading .help-button{margin-top:0}.examples-heading{margin-top:30px}.footer{padding:20px 2px;font-size:8px;letter-spacing:1px;color:#9bb0bf}.footer>span:first-child{font-size:8px}.palette-dialog-title{display:flex;align-items:center;gap:12px}.palette-dialog-title h2{margin:0}.palette-dialog-title>span{font-size:10px;color:#8ba7b9}.download-dialog-title{display:flex;align-items:center;gap:6px}.download-dialog-title h2{margin:0}.export-options>button{padding:12px;gap:12px}.export-options small{color:#91aaba;font-size:9px}.help-modal{width:430px}.help-modal .modal-heading{margin-bottom:14px}.help-modal .modal-heading h2{margin:0;font-size:18px;font-weight:550}.help-content{font-size:12px;color:#66869b;line-height:1.9}.help-content p{margin:0 0 12px}.help-content p:last-child{margin-bottom:0}.help-content ul{padding-left:19px;margin:8px 0}.help-content strong{font-weight:550;color:#365e77}.help-content .help-detail{font-size:10px;color:#91a8b7}
@media(max-width:1220px){.view-switches{padding-left:16px;padding-right:16px;gap:5px}.view-switches button{font-size:9px;padding:7px}.subtle-button,.export-button{font-size:9px;padding:7px 8px}.viewer-title h2{max-width:190px}.brush-card{gap:6px;padding:8px}.brush-card #choose-color{font-size:8px;padding:6px}.dimension-fields{gap:4px}.dimension-fields>label{gap:4px}.palette-filters button{font-size:9px}.color-limit-field small{font-size:8px}}
@media(max-width:1000px){.palette .panel-title{max-width:220px}.brush-card{width:245px}.brush-card #choose-color{font-size:9px}.metrics{top:17px}.palette-filters{margin-top:8px}}
@media(max-width:720px){.intro{padding:19px 3px 17px;min-height:65px}.intro h1{font-size:19px}.setup{padding:17px;gap:0 14px}.setup .dropzone{padding:16px}.dropzone p{font-size:9px;display:inline-block;margin:0 0 0 9px}.format-hint{font-size:8px;margin-top:10px}.upload-actions{margin:9px 0 1px}.upload-actions button{font-size:10px;min-height:27px}.task-list{margin-top:4px}.setting-group{margin-top:12px}.mode-setting{grid-column:1}.size-setting{grid-column:2;grid-row:5/7}.background-setting{grid-column:1}.color-setting.setting-group:has(#color-limit){grid-column:1/-1;display:block;margin-top:10px}.setting-heading{margin-bottom:5px;min-height:26px}.setting-heading>label{font-size:11px}.help-button{width:28px;height:28px;min-width:28px}.help-button>span{height:17px;width:17px}.dimension-fields{gap:3px}.dimension-fields>label{font-size:9px;gap:3px}.dimension-fields input{font-size:12px;padding:8px 2px}.aspect-label{margin:9px 0!important;font-size:10px!important;gap:5px}.size-presets{gap:4px}.size-presets button{font-size:9px;padding:6px 2px}.segmented button{font-size:10px;padding:8px 1px}.setting-group select{font-size:10px;padding:9px 5px}.color-setting{position:relative}.color-limit-field{width:145px;gap:6px}.color-limit-field input{width:55px;font-size:12px;padding:8px 5px}.color-limit-field small{font-size:8px}.checkbox-help{position:absolute;right:0;bottom:4px;margin:0;gap:0}.checkbox-help .checkbox-label{font-size:10px!important;gap:4px}.setup>.primary-button{margin-top:18px}.viewer-title{padding:15px 14px}.viewer-title h2{font-size:16px;max-width:160px;letter-spacing:.2px}.preview-status{height:21px}.preview-status .candidate-badge{font-size:7px}.preview-status .help-button{width:24px;min-width:24px;height:23px}.title-actions{gap:5px}.subtle-button,.export-button{font-size:9px;padding:8px 7px}.export-button svg{display:none}.view-switches{padding:0 13px 12px;gap:5px;justify-content:space-between}.view-switches button{font-size:9px;min-height:30px;padding:6px 7px;gap:4px}.view-switches button.active:before{width:3px;height:3px}.canvas-meta #edit-hint{font-size:8px}.viewer-footer{padding:10px 14px;font-size:8px}.palette .panel-title{max-width:none;margin-bottom:15px}.palette .panel-title h2{font-size:12px}.palette .panel-title>.help-button{margin-right:153px}.metrics{top:16px}.brush-card{width:100%;padding:10px;margin-top:18px;gap:10px}.brush-card #choose-color{font-size:11px;padding:8px 12px;min-height:34px}.brush-card #brush-swatch{width:34px;height:34px;min-width:34px}.brush-card strong{font-size:12px}.brush-card small{font-size:9px}.palette-filters button{font-size:10px}.library-title{gap:4px}.library-heading .primary-button{font-size:9px;padding:10px}.palette-dialog-title{gap:8px}.palette-dialog-title>span{font-size:9px}.help-modal{padding:23px}.help-content{font-size:12px}.full-palette button>small{font-size:8px}.footer{padding-top:18px;font-size:7px}.footer>span:first-child{font-size:8px}}
@media(max-width:380px){.viewer-title h2{max-width:135px}.subtle-button,.export-button{font-size:8px;padding:8px 6px}.view-switches button{font-size:8px;padding:6px}.checkbox-help .checkbox-label{font-size:9px!important}.checkbox-help .help-button{width:25px;min-width:25px}.color-limit-field{width:132px}}
/* Canvas views can be combined without leaving the work area. */
.art-stage{display:grid;grid-template-columns:max-content;justify-content:center;align-content:center;align-items:start}.canvas-card{width:max-content;min-width:0;justify-self:center;align-self:start}.download-file,.open-file{display:inline-flex;justify-content:center;align-items:center;min-height:34px;padding:8px 12px;border-radius:6px;font-size:11px;color:#fff;background:#3c94c4;cursor:pointer}.download-file:hover{background:#2e86b7}.open-file{background:#e4f1f9;color:#3e86af;border:1px solid #cde3f1}.open-file:hover{background:#d8ecf8}.export-ready .file-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:3px}.export-ready img{cursor:zoom-in}.export-ready a.download-file{text-decoration:none;color:#fff;font-size:10px}.export-ready a.open-file{text-decoration:none;color:#3e86af;font-size:10px}
@media(max-width:720px){.palette .panel-title{max-width:140px}.palette .panel-title>.help-button{margin-right:0}.download-file,.open-file{min-height:36px;font-size:11px}}
.dimension-fields>label>span{display:inline;white-space:nowrap}
.setting-sliders{display:grid;gap:2px;margin-top:7px}.setting-slider{display:flex;align-items:center;gap:8px;min-height:28px;color:#7895a8;font-size:10px}.setting-slider>span{min-width:22px;white-space:nowrap}.setting-slider input[type=range]{display:block;flex:1;min-width:0;width:100%;height:28px;margin:0;padding:0;accent-color:#489bca;cursor:pointer;touch-action:pan-y}.setting-slider input[type=range]:disabled{cursor:default}.slider-scale{display:flex;justify-content:space-between;font-size:9px;color:#8aa5b6;margin-top:0}.color-limit-field input::placeholder{color:#466a81;opacity:1}.color-setting .checkbox-help{position:static;margin-top:9px}.color-setting .color-limit-field{width:100%}.color-limit-field small{white-space:nowrap}
.help-button>svg{width:17px;height:17px;fill:currentColor;stroke:none;color:#69a9cb}.help-button:hover>svg{color:#348ebd}.help-button:focus-visible{outline:2px solid #5a9fc6;outline-offset:2px}.source-missing{display:grid;place-items:center;height:100%;color:#8ea5b5;font-size:11px}.generated-actions{display:flex;gap:7px;flex-wrap:wrap;margin:4px 0}.generated-name{font-size:9px;color:#7298ad;word-break:break-all}.direct-download{padding:7px 9px;font-size:10px;color:#538cac;border:1px solid #cce2ef;border-radius:6px;background:#fff;cursor:pointer}#generated-download-form{margin:0}.export-ready .download-file,.export-ready .open-file{font-size:10px}#export-ready .generated-image{display:block}

/* Canvas-centered editing and quiet dialogs. */
.modal{box-shadow:0 14px 48px #294d651b;border-color:#e2ebf1}
.modal::backdrop{background:rgba(117,166,196,.08);backdrop-filter:none}
.help-modal,.reconvert-modal{width:380px;padding:22px;border-radius:12px}
.help-modal .modal-heading,.reconvert-modal .modal-heading{margin-bottom:13px}
.help-modal .modal-heading h2,.reconvert-modal .modal-heading h2{font-size:17px;margin:0;line-height:1.5}
.help-content,.reconvert-modal>p{font-size:12px;line-height:1.85;color:#668397}
.help-content p{margin-bottom:10px}
.help-content .help-detail{font-size:11px;color:#88a0af}
.reconvert-modal>p{margin:0 0 21px}
.reconvert-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px}
.reconvert-actions .primary-button{width:auto;font-size:11px;padding:10px 13px}
.reconvert-actions .subtle-button{padding:9px 13px}
.presets-label{font-size:9px;color:#809aaa;margin:10px 0 7px;line-height:1.5}
.conversion-actions{margin-top:20px}
.pending-settings{display:flex;align-items:center;gap:5px;font-size:9px;color:#879db0;margin-bottom:8px}
.pending-settings:before{content:"";width:4px;height:4px;border-radius:50%;background:#83adc5}
.batch-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 10px;margin-top:7px}
.batch-actions .subtle-button{font-size:9px;padding:5px 0;border:0;color:#7898ab}
.batch-actions .subtle-button:hover{background:transparent;color:#398ab5}
.editor-bar{height:auto;min-height:57px;display:flex;flex-wrap:wrap;justify-content:flex-start;gap:7px 10px;padding:10px 16px;flex:none}
.editor-bar .tools{min-width:0;flex:none}
.editor-bar .display-tools{margin-left:auto;flex:none}
.editor-bar .brush-card{width:auto;margin:0;padding:3px 5px;gap:5px;flex:none;border-color:#e3edf3;background:#fbfdfe;border-radius:7px}
.editor-bar .brush-card #brush-swatch{width:24px;height:24px;min-width:24px;border-radius:4px}
.editor-bar .brush-card #choose-color{display:grid;grid-template-columns:auto auto;grid-template-rows:auto auto;column-gap:7px;row-gap:0;align-items:center;justify-content:start;min-height:27px;height:auto;width:auto;padding:0 3px;background:none;border:0;color:#4e819e;text-align:left}
.editor-bar .brush-card #choose-color:hover{background:none;color:#2786b6}
.editor-bar .brush-card #choose-color .brush-label{font-size:7px;line-height:11px;grid-column:1;margin:0;color:#8aa4b4}
.editor-bar .brush-card #choose-color strong{grid-column:1;font-size:10px;line-height:13px;font-weight:600}
.editor-bar .brush-card #choose-color .brush-chevron{grid-column:2;grid-row:1/3;font-size:14px;margin:0;color:#80a7bc}
.recent-colors{display:flex;align-items:center;flex-wrap:nowrap;gap:5px;min-width:0;max-width:100%;overflow-x:auto;scrollbar-width:none}
.editor-bar>.recent-colors{flex:1 0 100%;padding-top:1px}
.recent-colors:empty{display:none}
.editor-bar .recent-colors button{width:20px;height:20px;min-width:20px;padding:0;border-radius:5px;border:1px solid #365b7517;box-shadow:inset 0 0 0 2px #ffffff78;flex:none}
.editor-bar .recent-colors button:hover{outline:2px solid #bedcec;outline-offset:1px}
.editor-bar .recent-colors button.active{outline:2px solid #75b1d0;outline-offset:1px}
.merge-summary{font-size:9px;line-height:1.6;color:#8aa3b4;margin:-7px 0 12px}
.color-selection #replace-target{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;background:var(--wb-panel,#fff);font-size:13px;text-align:left}
.color-selection #replace-target:hover{background:var(--wb-soft,#f2f8fc)}
#replace-target-label{flex:1}
.palette-view-switch{display:flex;flex-wrap:wrap;flex:none;gap:8px;margin-bottom:10px}
.palette-view-switch .subtle-button{min-height:44px;font-size:13px}
.palette-view-switch .subtle-button[aria-pressed=true]{background:var(--wb-soft,#e6f4fa);color:var(--wb-ink,#365c74);border-color:var(--wb-brand,#73a9c0)}
.palette-similar-reference{flex:none;margin:0 0 10px;color:var(--wb-muted);font-size:13px}
.palette-similar-reference:not([hidden]){display:flex;align-items:center;gap:6px 10px;flex-wrap:wrap}
#palette-reference-swatch{width:24px;height:24px;border:1px solid var(--wb-line);border-radius:5px}
.color-selection .replace-preview{font-size:9px;color:#7195ab;margin:7px 0 0;line-height:1.6}
.color-selection .replace-preview:empty{display:none}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:1220px) and (min-width:1001px){
  .editor-bar{gap:7px 5px;padding-left:11px;padding-right:11px}
  .editor-bar .tools{gap:1px}
  .editor-bar .tools button{width:25px}
  .editor-bar .tool-separator{margin:0 2px}
  .editor-bar .display-tools button{width:25px}
}
@media(max-width:720px){
  .conversion-actions{grid-column:1/-1;margin-top:16px}
  .batch-actions{margin-top:5px}
  .batch-actions .subtle-button{font-size:10px;min-height:28px}
  .presets-label{font-size:8px;margin-top:8px}
  .editor-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 7px;padding:10px 11px;min-height:88px}
  .editor-bar .tools{grid-column:1;grid-row:1;gap:2px}
  .editor-bar .display-tools{grid-column:2;grid-row:1;margin:0;gap:2px}
  .editor-bar .tools button,.editor-bar .display-tools button{width:25px;height:28px}
  .editor-bar .tool-separator{margin:0 2px}
  .editor-bar .brush-card{grid-column:1;grid-row:2;justify-self:start;padding:3px 5px;gap:5px}
  .editor-bar .brush-card #brush-swatch{width:25px;height:25px;min-width:25px}
  .editor-bar .brush-card #choose-color{min-height:27px;padding:0 3px;column-gap:6px}
  .editor-bar .brush-card #choose-color .brush-label{font-size:7px;line-height:11px}
  .editor-bar .brush-card #choose-color strong{font-size:10px;line-height:13px}
  .editor-bar>.recent-colors{grid-column:1/-1;grid-row:2;margin-left:108px;justify-self:stretch;justify-content:flex-end;padding:3px 0;gap:4px}
  .editor-bar .recent-colors button{width:18px;height:18px;min-width:18px;border-radius:4px}
  .help-modal,.reconvert-modal{padding:21px;width:380px}
  .palette .color-list{min-height:100px}
  .merge-summary{margin:0 0 10px;font-size:9px}
}
@media(max-width:380px){
  .editor-bar{padding-left:9px;padding-right:9px;column-gap:4px}
  .editor-bar .tools button,.editor-bar .display-tools button{width:23px}
  .editor-bar .tools,.editor-bar .display-tools{gap:1px}
  .editor-bar .recent-colors button{width:17px;height:17px;min-width:17px}
  .editor-bar>.recent-colors{gap:3px;margin-left:103px}
}

/* Conversion audit stays compact until the user asks for details. */
.merge-summary details{margin-top:6px}.merge-summary summary{cursor:pointer;color:#628da5}.merge-mappings{display:flex;flex-wrap:wrap;gap:4px;margin:8px 0}.merge-mappings button,#undo-merge{border:1px solid #e0edf4;border-radius:6px;background:#fff;padding:4px 6px;font-size:10px;color:#5f8197}#undo-merge:disabled{opacity:.45;cursor:default}#restore-candidate{color:#548ba8;font-size:11px}#recent-colors button[aria-pressed=true]{outline:2px solid #6aafce;outline-offset:2px}

/* Full-size generated PNG preview and secondary download options. */
.export-modal{scroll-padding-top:54px}
.export-modal .modal-heading{position:sticky;top:0;z-index:1;align-items:center;background:#fff;box-shadow:0 -24px #fff}
.export-modal .modal-heading>button{min-width:44px;min-height:44px}
.image-preview-modal{width:min(900px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);padding:20px;overflow:hidden}
.image-preview-modal[open]{display:flex;flex-direction:column}
.image-preview-modal .modal-heading{margin-bottom:12px;flex:none}
.image-preview-modal .modal-heading h2{margin:0;font-size:18px;line-height:1.5}
.image-preview-note{font-size:11px;line-height:1.6;color:#8aa2b2;margin:4px 0 0}
.image-preview-toolbar{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-bottom:12px;flex:none}
.image-preview-toolbar .subtle-button,.image-preview-toolbar .download-file{min-height:34px;font-size:11px;padding:8px 12px;line-height:1.5}
.image-preview-toolbar .subtle-button[aria-pressed=true]{border-color:#bad8e9;background:#edf7fc;color:#3b8bb5}
.export-image-viewport{width:100%;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c8dce8 transparent;background:#f5f8fb;border:1px solid #e4edf3;border-radius:7px;padding:10px}
.export-image-viewport img{display:block;width:auto;height:auto;max-width:100%;max-height:calc(100vh - 190px);max-height:calc(100dvh - 190px);margin:0 auto;object-fit:contain;box-shadow:0 3px 14px #3156730b;user-select:auto;-webkit-user-select:auto}
.image-preview-modal.actual-size .export-image-viewport img{width:auto;height:auto;max-width:none;max-height:none;margin:0}
#export-ready .download-options{margin-top:12px;padding-top:10px;border-top:1px solid #e4edf3}
#export-ready .download-options summary{cursor:pointer;font-size:10px;line-height:1.7;color:#7796aa}
#export-ready .download-options .generated-actions{margin:9px 0 0;gap:7px}
#export-ready .generated-actions a.direct-download,#export-ready .generated-actions a.download-file,#export-ready .generated-actions a.open-file,#export-ready .fallback-download{display:inline-flex;justify-content:center;align-items:center;min-height:34px;line-height:1.5;white-space:normal;text-align:center;text-decoration:none;cursor:pointer}
#export-ready .generated-actions a.direct-download{background:#fff;color:#538cac;border:1px solid #cce2ef;border-radius:6px;padding:7px 9px;font-size:10px}
#export-ready .generated-actions a.direct-download:hover{background:#f1f8fc}
.export-backup-options{margin-top:14px;padding-top:6px;border-top:1px solid var(--line)}
.export-backup-options>summary{min-height:44px;padding:12px 4px;cursor:pointer;color:#52788f;font-size:12px}
.export-backup-options>p{margin:0 0 10px;color:#58788d;font-size:12px;line-height:1.7}
.export-backup-options .export-options>button{min-height:54px}
#export-ready .fallback-download{font-size:10px;color:#7b99ad;padding:5px 0;min-height:30px}
#export-ready .fallback-download:hover{color:#3c8bb6;text-decoration:underline;text-underline-offset:3px}
@media(max-width:720px){
  .image-preview-modal{padding:16px}
  .image-preview-modal .modal-heading{margin-bottom:10px}
  .image-preview-modal .modal-heading h2{font-size:17px}
  .image-preview-note{font-size:10px}
  .image-preview-toolbar{gap:7px;margin-bottom:10px}
  .image-preview-toolbar .subtle-button,.image-preview-toolbar .download-file{min-height:36px;font-size:11px;padding:8px 11px}
  .export-image-viewport{padding:6px}
}

.generated-thumbnail{padding:0;flex:none;border-radius:5px;line-height:0}.generated-thumbnail:focus-visible{outline:2px solid #77b6d7;outline-offset:3px}.export-progress{font-size:11px;color:#658fa7;line-height:1.7}.download-error,#export-ready small.download-error{color:#a35f55}#export-ready .download-options>button,#export-ready .download-options>a{margin-top:8px}.image-preview-modal .modal-heading>div{min-width:0}.image-preview-modal .modal-heading h2{overflow-wrap:anywhere}

.main-nav>a{display:flex;align-items:center;font-size:12px;padding:0 2px;color:#7296ab}.main-nav>a:hover{color:#308cbd}@media(max-width:720px){.main-nav{gap:14px}.main-nav>a{font-size:10px}}

/* Separate each MARD letter family into a flush-left, collapsible section. */
.full-palette{display:block;padding:0 4px 0 0}.full-palette-group{margin:0 0 12px;padding:0 0 12px;border-bottom:1px solid #e6eef4}.full-palette-group:last-child{margin-bottom:0;border-bottom:0}.full-palette-group>summary{display:flex;align-items:center;gap:8px;min-height:36px;margin:0 0 8px;padding:0;list-style:none;cursor:pointer;color:#4c7893;user-select:none}.full-palette-group>summary::-webkit-details-marker{display:none}.full-palette-group>summary:focus-visible{outline:3px solid #8ccce9;outline-offset:1px;border-radius:4px}.palette-group-title{font-size:13px;font-weight:650;letter-spacing:.3px}.palette-group-count{font-size:10px;font-weight:400;color:#92aaba}.palette-group-chevron{margin-left:auto;padding-right:3px;font-size:17px;line-height:1;transform:rotate(-90deg);transition:transform .15s}.full-palette-group[open] .palette-group-chevron{transform:rotate(0)}.full-palette-grid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:8px}.full-palette-group:not([open])>.full-palette-grid{display:none}.palette-empty{padding:22px 0;margin:0;color:#8ba5b5;font-size:12px;text-align:left}
@media(max-width:720px){.full-palette-grid{grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}.full-palette-group{margin-bottom:10px;padding-bottom:10px}.full-palette-group>summary{min-height:38px}.palette-group-title{font-size:12px}}

.gallery-edit-actions{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 12px;margin:0 20px 14px;padding:12px;border:1px solid #d8e9f4;border-radius:7px;background:#f5fafd;font-size:11px;color:#6c91a9}.gallery-edit-actions>div{display:flex;align-items:center;gap:12px}.gallery-edit-actions button{padding:8px 12px;border:1px solid #bddbef;border-radius:5px;background:#fff;color:#398dbb;font-size:11px}.gallery-edit-actions a{color:#348cbb;text-decoration:underline}.gallery-edit-actions p{flex-basis:100%;margin:0;line-height:1.7;font-size:11px;overflow-wrap:anywhere}

/* Local image/grid calibration. Geometry remains in original image coordinates. */
.calibration-modal{width:min(1080px,96vw);max-width:1080px;max-height:94dvh;padding:24px;overflow:auto}.calibration-modal .modal-heading{align-items:flex-start}.calibration-modal .modal-heading h2{font-size:21px;margin:0}.calibration-modal .modal-heading p{font-size:12px;line-height:1.7;color:#7d9aab;margin:7px 0 0}.calibration-layout{display:grid;grid-template-columns:minmax(0,1fr) 245px;gap:22px}.calibration-preview{min-width:0}.calibration-tools{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:12px}.calibration-tools button{padding:9px 10px;border:1px solid #dce9f2;border-radius:6px;background:#f8fbfd;color:#7294aa;font-size:11px;min-height:36px}.calibration-tools button[aria-pressed=true]{background:#e9f5fc;border-color:#9ac8e3;color:#348ab8}.calibration-preview canvas{display:block;width:100%;height:clamp(320px,60vh,600px);border:1px solid #dce9f2;border-radius:7px;touch-action:none;cursor:crosshair;background:#edf4f8}.calibration-instruction{min-height:36px;font-size:11px;line-height:1.7;color:#8da5b5;margin:10px 0 0}.calibration-zoom{display:flex;justify-content:center;align-items:center;gap:12px}.calibration-zoom button{min-width:34px;min-height:34px;border:1px solid #dce9f2;border-radius:5px;color:#5c8ba7;font-size:12px}.calibration-zoom>span{font-size:11px;color:#7d9aac;min-width:42px;text-align:center}.calibration-zoom #cal-fit{padding:0 10px}.calibration-settings{display:flex;flex-direction:column;gap:15px;min-width:0}.calibration-result{padding:17px 13px;border:1px solid #d6e8f4;border-radius:8px;background:#f2f9fd}.calibration-result>span{display:block;font-size:11px;color:#7e9eb2}.calibration-result>strong{display:block;font-size:23px;line-height:1.5;color:#3f789b;margin:7px 0}.calibration-result>small{font-size:10px;line-height:1.7;color:#8aa4b5;display:block}.calibration-fine{display:grid;grid-template-columns:1fr 1fr;gap:9px}.calibration-fine h3{grid-column:1/-1;margin:0 0 2px;font-size:12px;font-weight:550;color:#6288a0}.calibration-fine label{display:grid;gap:5px;font-size:10px;color:#8aa3b3}.calibration-fine input{width:100%;min-width:0;padding:8px;border:1px solid #dce9f2;border-radius:5px;background:#fbfdfe;font-size:12px}.calibration-settings .checkbox-label{margin:0;font-size:11px;line-height:1.7}.calibration-background{display:grid;gap:7px;color:#7796aa;font-size:11px}.calibration-background select{width:100%;border:1px solid #dce9f2;border-radius:5px;padding:9px 6px;background:#fbfdfe;font-size:11px}.calibration-error{font-size:11px;line-height:1.7;color:#b47b50;min-height:18px;margin:0}.calibration-tip{font-size:10px;line-height:1.8;color:#98acb9;margin:0}.calibration-footer{display:flex;justify-content:flex-end;gap:12px;margin-top:20px}.calibration-footer .primary-button{padding:12px 20px;width:auto;min-width:210px;font-size:12px}.calibration-footer>.subtle-button{padding:10px 15px}.upload-actions{flex-wrap:wrap;row-gap:7px}
@media(max-width:720px){.calibration-modal{padding:17px;width:96vw}.calibration-layout{grid-template-columns:minmax(0,1fr);gap:17px}.calibration-settings{display:grid;grid-template-columns:1fr 1fr;gap:12px}.calibration-result{grid-column:1}.calibration-fine{grid-column:2}.calibration-settings>.checkbox-label,.calibration-error,.calibration-tip{grid-column:1/-1}.calibration-modal .modal-heading h2{font-size:18px}.calibration-preview canvas{height:48vh;min-height:300px}.calibration-tools button{font-size:10px;padding:8px}.calibration-footer .primary-button{min-width:0;flex:1}.calibration-result>strong{font-size:19px}}

/* Existing artwork uses editing tools; source-image conversion stays in its own mode. */
.pattern-edit-mode .setup>#dropzone,.pattern-edit-mode .setup>.upload-actions,.pattern-edit-mode .setup>.task-list,.pattern-edit-mode .setup>.mode-setting,.pattern-edit-mode .setup>.background-setting,.pattern-edit-mode .setup>.color-setting,.pattern-edit-mode .setup>.conversion-actions{display:none}.pattern-edit-intro{font-size:11px;line-height:1.8;color:#8aa2b2;margin:0 0 12px}.pattern-edit-mode .setup>.size-setting{margin-top:10px;grid-column:auto;grid-row:auto}.edit-size-actions{display:grid;gap:10px;margin-top:18px}.edit-size-actions>p{font-size:11px;color:#7d9bad;margin:0}.edit-size-actions>span{font-size:10px;color:#b08b62}.edit-size-actions>.primary-button{font-size:12px;min-height:40px;margin:0}.edit-size-actions>a{font-size:11px;color:#8aa5b7;text-align:center;padding:8px}.resize-dialog{width:min(760px,94vw);padding:24px}.resize-dialog .modal-heading h2{font-size:20px;margin:0}.resize-dialog .modal-heading p{font-size:12px;color:#86a1b2;line-height:1.8;margin:6px 0 0}.resize-comparison{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.resize-comparison figure{margin:0;min-width:0;padding:12px;border:1px solid #e1ebf2;border-radius:7px;background:#fbfdfe}.resize-comparison figcaption{font-size:12px;color:#7193a9;margin-bottom:9px}.resize-comparison canvas{display:block;width:100%;height:240px;object-fit:contain;image-rendering:pixelated;background:white}.resize-comparison p{font-size:11px;line-height:1.7;color:#8aa4b5;margin:10px 0 0}.resize-impact{font-size:12px;line-height:1.8;color:#7998ad;margin:16px 0}.resize-actions{display:flex;gap:12px;justify-content:flex-end}.resize-actions .primary-button{width:auto;padding:11px 20px;min-width:120px;font-size:12px}
@media(max-width:720px){.pattern-edit-mode .setup{display:block}.resize-dialog{padding:17px}.resize-comparison{gap:10px}.resize-comparison figure{padding:8px}.resize-comparison canvas{height:160px}.resize-comparison p{font-size:10px}.resize-actions .primary-button{min-width:105px}}

/* Same cell scale makes changes in overall artwork dimensions visible. */
.resize-art{display:grid;place-items:center;min-height:260px;overflow:auto;padding:8px;background-color:#f6f9fb;background-image:linear-gradient(45deg,#e9eff340 25%,transparent 25%),linear-gradient(-45deg,#e9eff340 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e9eff340 75%),linear-gradient(-45deg,transparent 75%,#e9eff340 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0;border-radius:5px}.resize-comparison .resize-art canvas{display:block;max-width:none;max-height:none;object-fit:initial;background:transparent;flex:none}.resize-change-summary{display:grid;grid-template-columns:1.3fr 1fr 1.1fr;gap:9px;margin-top:17px}.resize-stat{padding:12px 10px;border:1px solid #dde9f1;border-radius:7px;background:#f5fafd;min-width:0}.resize-stat>span{display:block;color:#89a1b1;font-size:10px}.resize-stat>strong{display:flex;align-items:center;gap:7px;flex-wrap:wrap;color:#507e9b;font-size:13px;line-height:1.8;margin:5px 0}.resize-stat>strong>b{color:#9db6c6;font-size:13px;font-weight:400}.resize-stat>small{font-size:10px;color:#8ba4b4}.resize-lost-colors{margin-top:14px}.resize-lost-colors>strong{font-size:11px;color:#a07d60;font-weight:500}.resize-lost-list{display:flex;flex-wrap:wrap;gap:7px;margin-top:8px}.resize-lost-list>span{display:flex;align-items:center;gap:5px;padding:6px 8px;border:1px solid #eadfd3;border-radius:5px;background:#fffaf5;font-size:11px;color:#8c745f}.resize-lost-list small{font-size:9px;color:#ab9a8a}.resize-lost-list i,.resize-color-table th i{display:inline-block;width:12px;height:12px;flex:none;border:1px solid #0001;border-radius:3px}.resize-colors-retained{font-size:11px;color:#7d9b8c;line-height:1.7;margin:0}.resize-color-details{margin-top:13px;color:#7e9bae;font-size:11px}.resize-color-details>summary{cursor:pointer;min-height:30px;line-height:30px}.resize-color-table-wrap{max-height:190px;overflow:auto;border:1px solid #e5edf3;border-radius:5px}.resize-color-table{width:100%;border-collapse:collapse;text-align:right;font-size:11px}.resize-color-table th,.resize-color-table td{padding:8px 10px;border-bottom:1px solid #edf2f6;font-weight:400}.resize-color-table th:first-child{text-align:left;white-space:nowrap}.resize-color-table th i{vertical-align:middle;margin-right:6px}.resize-color-table thead{background:#f2f7fa;color:#86a0b2}.resize-color-removed{color:#b18768;background:#fffaf6}.resize-dialog{max-height:94dvh;overflow:auto}
@media(max-width:720px){.resize-change-summary{grid-template-columns:1fr;gap:7px}.resize-stat{display:grid;grid-template-columns:80px 1fr;align-items:center;padding:9px}.resize-stat>strong{margin:0;font-size:12px}.resize-stat>small{grid-column:2}.resize-art{min-height:260px;padding:5px}.resize-color-table th,.resize-color-table td{padding:7px}}

/* Keep identity and version actions together; reserve height for the canvas. */
#viewer-panel .viewer-title{padding:11px 15px 9px;gap:12px;align-items:center}#viewer-panel .viewer-identity{min-width:0;flex:1}#viewer-panel .viewer-title h2{margin:0;max-width:100%;font-size:18px;line-height:1.35}#viewer-panel .viewer-context{display:flex;align-items:center;flex-wrap:wrap;gap:4px 9px;min-height:13px;margin-top:3px;color:#8ca6b6;font-size:9px;line-height:1.5}#gallery-edit-source{max-width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#gallery-edit-source::after{content:'·';margin-left:9px;color:#b0c3cf}.pattern-edit-mode #viewer-panel .preview-status{display:none}#viewer-panel .title-actions{flex:none;gap:6px;flex-wrap:wrap;justify-content:flex-end}#viewer-panel .title-actions>button,#viewer-panel .gallery-edit-actions>button{min-height:32px;padding:7px 10px;font-size:11px;white-space:nowrap}#viewer-panel .gallery-edit-actions{display:flex;gap:7px;padding:0;margin:0;border:0;border-radius:0;background:none;font-size:10px}#viewer-panel .gallery-submit-status{font-size:11px;line-height:1.7;color:#7397af;background:#f3f9fd;border-left:2px solid #bad9ec;margin:0 15px 9px;padding:6px 9px;overflow-wrap:anywhere}#viewer-panel .gallery-submit-status a{color:#328abb;text-decoration:underline}#viewer-panel .view-switches{padding:0 15px 8px;gap:6px}#viewer-panel .view-switches button{min-height:28px;padding:5px 9px}#viewer-panel .canvas-meta{height:19px;min-height:0;padding:0 15px;align-items:center;gap:10px}#viewer-panel .canvas-meta #edit-hint{margin-left:0}#viewer-panel .canvas-meta #dirty-label{margin-left:auto}#viewer-panel .canvas-meta:has(#edit-hint:empty):has(#dirty-label:empty):has(#save-state:empty){display:none}
@media(min-width:721px){#viewer-panel .editor-bar{padding:7px 14px;gap:6px;min-height:44px}#viewer-panel .editor-bar .tools{order:0;flex:none}#viewer-panel .editor-bar .brush-card{order:1;flex:none}#viewer-panel .editor-bar>.recent-colors{order:2;flex:0 1 180px;min-width:45px;margin-left:2px;padding:0}#viewer-panel .editor-bar .display-tools{order:3;margin-left:auto;flex:none}}
@media(max-width:720px){#viewer-panel .viewer-title{padding:10px 11px 8px;flex-wrap:wrap;gap:7px}#viewer-panel .viewer-title h2{font-size:16px}#viewer-panel .viewer-context{font-size:9px}#viewer-panel .title-actions{gap:5px}#viewer-panel .title-actions>button,#viewer-panel .gallery-edit-actions>button{font-size:10px;padding:7px 8px;min-height:34px}#viewer-panel .view-switches{padding:0 11px 7px;justify-content:flex-start}#viewer-panel .view-switches button{font-size:10px}#viewer-panel .editor-bar{min-height:75px;padding-top:6px;padding-bottom:6px;row-gap:4px}#viewer-panel .gallery-submit-status{margin-left:11px;margin-right:11px}#viewer-panel .canvas-meta{padding-left:11px;padding-right:11px}}
@media(max-width:460px){#viewer-panel .title-actions{width:100%;justify-content:flex-start}#viewer-panel .viewer-context{flex-wrap:nowrap}#gallery-edit-source{max-width:170px}}

/* Never crop a quick color or its selection outline to fit the compact toolbar. */
#viewer-panel .editor-bar>.recent-colors{overflow:visible;flex-wrap:wrap;padding:4px;gap:6px}
#recent-colors button[aria-pressed=true]{outline-offset:1px}
@media(min-width:721px){#viewer-panel .editor-bar>.recent-colors{flex:0 0 auto;width:max-content;max-width:100%;min-width:0}}

.edit-size-actions>.undo-resize-button{padding:9px 7px;min-height:36px;border:1px solid #cfe2ee;border-radius:6px;background:#f6fbfe;color:#5286a4;font-size:11px}.edit-size-actions>.undo-resize-button:hover{background:#eaf5fc;border-color:#afd2e7}

/* Start with the task, while keeping existing artwork focused on editing. */
.workflow-entry{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 15px}
.workflow-entry>button{display:flex;align-items:center;gap:11px;min-width:0;min-height:60px;padding:11px 16px;border:1px solid #dce9f1;border-radius:9px;background:#fff;text-align:left;color:#4d819f;transition:background .15s,border-color .15s}
.workflow-entry>button:hover{border-color:#9fcce4;background:#f4faff}
.workflow-entry>button>svg{width:21px;height:21px;color:#64a1c3}
.workflow-entry>button>span{display:grid;gap:4px;min-width:0}
.workflow-entry strong{font-size:12px;font-weight:550;line-height:1.4;color:#3f718e}
.workflow-entry small{font-size:10px;line-height:1.4;color:#88a3b4}
.workflow-entry b{margin-left:auto;font-size:15px;font-weight:400;color:#8db4cb}
.pattern-edit-mode #workflow-entry{display:none}
.workflow-next{margin:0 0 13px;padding-left:9px;border-left:2px solid #a9d2e7;font-size:10px;line-height:1.8;color:#7397ad}
.pattern-edit-mode .pattern-edit-intro{margin-bottom:9px}
.physical-size-settings{margin-top:12px;padding-top:11px;border-top:1px solid #eaf1f6}
.physical-size-settings>label{display:flex;justify-content:space-between;gap:5px;margin-bottom:7px;font-size:10px;font-weight:500;color:#7896aa}
.physical-size-settings>label>span{margin:0;font-size:9px;font-weight:400;color:#93aabb}
.physical-size{font-size:11px;line-height:1.7;color:#4986a9;font-variant-numeric:tabular-nums;margin:8px 0 3px}
.physical-size-settings>small{display:block;font-size:9px;line-height:1.7;color:#99aebb}
#viewer-panel .canvas-meta{height:auto;min-height:20px;flex-wrap:wrap;row-gap:3px;padding-bottom:4px;font-size:9px;line-height:1.6}
#viewer-panel .canvas-meta #dirty-label:empty{display:none}
#viewer-panel .canvas-meta #save-state{margin-left:auto;color:#8ba4b3;font-variant-numeric:tabular-nums}
#viewer-panel .canvas-meta #save-state[data-state=saved]{color:#6c9a86}
#viewer-panel .canvas-meta #save-state[data-state=unsaved]{color:#b08a5d}
#viewer-panel .canvas-meta #save-state[data-state=error]{color:#b2796a}
#viewer-panel .canvas-meta #save-state[data-state=pending]{color:#5995b7}
.palette-selection-hint{font-size:10px;line-height:1.7;color:#8aa5b6;margin:0 0 7px}
.sheet-colors>button.sheet-color{font-family:inherit;font-size:9px;font-weight:400;line-height:normal;text-align:left;color:inherit;background:transparent;border:0;border-radius:4px;padding:0;min-width:0}
.sheet-colors>button.sheet-color:hover{background:#f0f8fc;box-shadow:0 0 0 4px #f0f8fc}
.sheet-colors>button.sheet-color.active{background:#e8f5fc;box-shadow:0 0 0 4px #e8f5fc;color:#328ab7}
.sheet-colors>button.sheet-color:focus-visible{outline:2px solid #8ccce9;outline-offset:4px}
@media(max-width:1000px){.workflow-entry{gap:10px}.workflow-entry>button{padding:10px 12px}.palette-selection-hint{margin-top:0}}
@media(max-width:720px){
  .workflow-entry{gap:7px;margin-bottom:12px}
  .workflow-entry>button{display:block;min-height:65px;padding:9px 8px;text-align:center}
  .workflow-entry>button>svg,.workflow-entry b{display:none}
  .workflow-entry strong{font-size:11px}
  .workflow-entry small{font-size:9px}
  .setup>.workflow-next{grid-column:1/-1;margin-bottom:12px}
  .setup .size-setting{grid-row:auto}
  .physical-size-settings>label{font-size:10px}
  .physical-size-settings>label>span{display:none}
  .physical-size-settings>select{font-size:10px}
  .physical-size{font-size:10px}
  .physical-size-settings>small{font-size:8px}
  #viewer-panel .canvas-meta{font-size:9px;min-height:20px;column-gap:7px}
  .palette-selection-hint{font-size:10px}
}
@media print{.sheet-colors>button.sheet-color,.sheet-colors>button.sheet-color.active{background:none;box-shadow:none}}

/* The mobile dock belongs to the viewer, never to the enlarged artwork. */
.mobile-canvas-toolbar,.mobile-return-canvas,.control-caption{display:none}
.workflow-next{font-size:12px;color:#466b82;border-left-color:#63a8cf}
#viewer-panel .canvas-meta #save-state{color:#526f82;font-size:11px}
#viewer-panel .canvas-meta #save-state[data-state=saved]{color:#376e53}
#viewer-panel .canvas-meta #save-state[data-state=unsaved]{color:#896125}
#viewer-panel .canvas-meta #save-state[data-state=error]{color:#a04436}
#viewer-panel .canvas-meta #save-state[data-state=pending]{color:#356e8e}
.palette-selection-hint{font-size:12px;color:#526f82}
.color-selection strong{font-size:12px;color:#346d8c}
.color-selection p,.color-selection .replace-preview{font-size:11px;color:#52768d}
.viewport{touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}

@media(max-width:720px),(max-width:1440px) and (pointer:coarse){
  :root{--mobile-dock-height:calc(106px + env(safe-area-inset-bottom,0px))}
  body{padding-bottom:calc(var(--mobile-dock-height) + 18px)}
  body:has(#workspace[hidden]){padding-bottom:0}
  main{padding:0 12px}
  .workspace{display:flex;flex-direction:column;gap:12px}
  .header{height:60px;min-height:60px;flex-wrap:nowrap;padding:0 12px;gap:8px}
  .brand{gap:7px;flex:none}
  .brand>span:last-child{font-size:0;letter-spacing:0;gap:0}
  .brand small{display:inline;font-size:14px;letter-spacing:0;color:#416982}
  .main-nav{margin-left:auto;gap:10px;min-width:0}
  .main-nav>a,.main-nav button{font-size:11px;white-space:nowrap;min-height:44px}
  .main-nav span{font-size:10px}
  .header-end{display:none}
  .intro{padding:12px 1px;min-height:56px}
  .intro h1{font-size:20px;margin:3px 0}
  .workflow-entry{gap:7px}
  .workflow-entry>button{padding:10px 5px;min-height:72px}
  .workflow-entry strong{font-size:13px;color:#325e79}
  .workflow-entry small{font-size:11px;color:#58788e}
  .workspace>.setup{display:block;order:0;padding:17px}
  .workspace>#viewer-panel{order:1}
  .workspace>.palette{order:2}
  .pattern-edit-mode .workspace>#viewer-panel,.canvas-ready .workspace>#viewer-panel{order:0}
  .pattern-edit-mode .workspace>.setup,.canvas-ready .workspace>.setup{order:1}
  .setup,.palette{scroll-margin-top:12px}
  .setup .panel-title,.palette .panel-title{gap:6px;max-width:none;margin-bottom:10px}
  .setup .panel-title h2,.palette .panel-title h2{font-size:15px;line-height:1.5}
  .mobile-return-canvas{display:block;min-height:44px;margin-left:auto;padding:6px 8px;font-size:12px;color:#32749b;white-space:nowrap}
  .palette .panel-title>.help-button{margin-right:0}
  .pattern-edit-intro{font-size:12px;color:#526f82}
  .setup>.workflow-next{font-size:12px;line-height:1.75;margin-bottom:16px}
  .setting-group{margin-top:18px}
  .setting-heading>label,.setting-group>label,.field-label>label{font-size:13px;color:#3e6077}
  .help-button{width:44px;height:44px;min-width:44px}
  .setting-group select,.color-selection select{min-height:44px;font-size:16px;padding:9px}
  .dimension-fields{gap:8px}
  .dimension-fields>label{font-size:12px;gap:7px}
  .dimension-fields input{min-height:44px;font-size:16px;padding:8px 4px}
  .size-presets{gap:8px}
  .size-presets button,.segmented button{min-height:44px;font-size:13px}
  .color-limit-field{width:auto}
  .color-limit-field input{min-height:44px;font-size:16px;width:78px}
  .color-limit-field small,.presets-label,.field-hint,.physical-size-settings>small{font-size:12px;color:#5b778a}
  .physical-size-settings>label{font-size:13px;color:#476b83}
  .physical-size{font-size:14px;color:#306c91}
  .checkbox-label,.checkbox-help .checkbox-label,.aspect-label{min-height:44px;font-size:13px!important;gap:8px}
  .checkbox-label input{width:18px;height:18px}
  .checkbox-help{position:static;margin-top:8px;justify-content:space-between}
  .upload-actions button,.batch-actions .subtle-button{min-height:44px;font-size:12px}
  .format-hint{font-size:11px;color:#57798f}
  .dropzone strong{font-size:14px}
  .dropzone p{font-size:12px;color:#57798f}
  .conversion-actions .primary-button,.edit-size-actions>.primary-button{min-height:48px;font-size:14px}
  .edit-size-actions>.undo-resize-button,.edit-size-actions>a{min-height:44px;font-size:13px}
  #viewer-panel{height:calc(100dvh - 24px - var(--mobile-dock-height));min-height:460px;scroll-margin-top:12px}
  #viewer-panel .viewer-title{flex:none;padding:10px 11px 5px;gap:5px}
  #viewer-panel .viewer-title h2{font-size:17px}
  #viewer-panel .viewer-context{font-size:11px;color:#5b7a8f}
  #viewer-panel .title-actions{width:auto;max-width:100%;gap:5px;justify-content:flex-start}
  #viewer-panel .title-actions>button,#viewer-panel .gallery-edit-actions>button{min-height:44px;font-size:12px;padding:7px 10px}
  #viewer-panel .view-switches{flex:none;padding:0 9px 5px;gap:5px;flex-wrap:wrap}
  #viewer-panel .view-switches button{min-height:44px;font-size:12px;padding:7px 9px}
  #viewer-panel .editor-bar{display:flex;flex:none;min-height:44px;gap:5px;padding:0 9px 4px;justify-content:space-between}
  #viewer-panel .editor-bar .tools{display:flex;flex:none;min-width:44px}
  #viewer-panel .editor-bar .tools [data-tool],#viewer-panel .editor-bar .tool-separator,#viewer-panel .editor-bar #undo,#viewer-panel .editor-bar .brush-card,#viewer-panel .editor-bar>.recent-colors{display:none}
  #viewer-panel .editor-bar .tools #redo{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;min-width:44px;width:44px;min-height:44px;height:44px}
  #viewer-panel .editor-bar .display-tools{margin-left:auto;gap:5px}
  #viewer-panel .editor-bar .display-tools button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;width:44px;min-width:44px;height:44px;min-height:44px;font-size:14px}
  #viewer-panel .control-caption{display:block;font-size:11px;line-height:1.2;color:#4c728a}
  #viewer-panel .editor-bar svg{width:20px;height:20px}
  #viewer-panel .canvas-meta{flex:none;min-height:24px;font-size:12px;line-height:1.5;padding:0 11px 5px;gap:6px}
  #viewer-panel .canvas-meta #edit-hint{display:none}
  #viewer-panel .canvas-meta #save-state{font-size:12px;margin-left:0}
  #viewer-panel .viewport{flex:1;min-height:220px;height:auto;margin:0 7px;scroll-padding:12px}
  #viewer-panel .art-stage{padding:16px}
  #viewer-panel>.zoom-bar{display:none}
  #viewer-panel .viewer-footer{flex:none;min-height:38px;margin:0;padding:6px 10px;gap:7px;font-size:11px}
  #viewer-panel .viewer-footer button{min-height:32px;font-size:11px}
  #viewer-panel .viewer-footer>span{min-width:0}
  #status-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
  .mobile-canvas-toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;position:fixed;left:0;right:0;bottom:0;z-index:60;padding:6px max(8px,env(safe-area-inset-right,0px)) calc(6px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left,0px));border:1px solid #cbdde9;border-bottom:0;border-radius:14px 14px 0 0;background:#fff;box-shadow:0 -5px 24px #2b566421;isolation:isolate}
  .mobile-dock-heading{display:flex;align-items:center;gap:8px;min-width:0;min-height:44px}
  #mobile-panel-tabs{display:flex;align-items:center;gap:3px;flex:none}
  #mobile-panel-tabs button{min-height:44px;padding:7px 9px;font-size:12px;color:#526f82;border-radius:6px;white-space:nowrap}
  #mobile-panel-tabs button[aria-pressed=true]{background:#edf6fc;color:#246d97;font-weight:600}
  #mobile-tool-label{flex:1;min-width:0;font-size:11px;line-height:1.5;color:#4c6e84;text-align:right;overflow-wrap:anywhere}
  .mobile-tool-row{display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));gap:5px}
  .mobile-tool-row>button{display:flex;align-items:center;justify-content:center;gap:5px;min-width:44px;min-height:44px;padding:5px 2px;border:1px solid #d9e6ef;border-radius:7px;background:#f9fbfd;color:#526f82;font-size:14px;line-height:1.2;white-space:nowrap}
  .mobile-tool-row>button[aria-pressed=true]{background:#e2f2fc;border-color:#70b0d4;color:#1d658e;box-shadow:inset 0 0 0 1px #70b0d4;font-weight:600}
  .mobile-tool-row svg{width:18px;height:18px}
  .mobile-canvas-actions{display:grid;grid-template-columns:minmax(70px,1fr) 44px 44px 44px 32px 44px;align-items:center;gap:2px}
  .mobile-canvas-actions>button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:44px;min-height:44px;padding:3px;border:1px solid #d9e6ef;border-radius:7px;background:#f9fbfd;color:#466d85;font-size:12px;line-height:1.2}
  .mobile-canvas-actions svg{width:18px;height:18px}
  .mobile-canvas-actions #mobile-choose-color{display:flex;flex-direction:row;justify-content:center;gap:6px;min-width:70px;background:#3489b8;border-color:#3489b8;color:white}
  #mobile-choose-color>i{display:block;width:25px;height:25px;border:2px solid #ffffffd1;box-shadow:0 0 0 1px #1b52765e;border-radius:5px;background:#000;flex:none}
  #mobile-choose-color>span{font-size:11px;line-height:1.3;text-align:left}
  #mobile-brush-code{display:block;font-size:14px;font-weight:650;line-height:1.3}
  .mobile-canvas-actions #mobile-zoom-out,.mobile-canvas-actions #mobile-zoom-in{font-size:23px}
  #mobile-zoom-value{display:block;min-width:0;text-align:center;color:#456b83;font-size:11px;font-variant-numeric:tabular-nums;line-height:1.4;overflow-wrap:anywhere}
  #viewer-panel:fullscreen{height:100dvh;min-height:0;max-height:100dvh;padding-bottom:calc(var(--mobile-dock-height));border:0;border-radius:0;background:#fff}
  #viewer-panel:fullscreen .viewport{min-height:100px}
  #viewer-panel:fullscreen .mobile-canvas-toolbar{position:fixed}
  .palette{padding:17px}
  .palette-selection-hint{font-size:12px;color:#526f82}
  .palette-filters{gap:14px}
  .palette-filters button{min-height:44px;font-size:13px;padding:8px 0}
  .palette .color-list{grid-template-columns:repeat(2,minmax(0,1fr));max-height:330px;gap:5px 10px}
  .color-row{min-height:52px;padding:7px 4px;gap:8px}
  .swatch{width:30px;height:30px}
  .color-meta b,.color-amount{font-size:13px;color:#41667e}
  .color-meta small{font-size:10px;color:#58758a}
  .color-selection{padding:13px}
  .color-selection strong,.color-selection label,.color-selection p,.color-selection .replace-preview{font-size:13px;line-height:1.6;color:#446d87}
  .color-selection #clear-selection{min-width:44px;min-height:44px;font-size:22px}
  .color-selection .small-button,.color-selection .subtle-button{min-height:44px;font-size:14px}
  .color-selection summary,.text-button{min-height:44px;font-size:13px;line-height:44px}
  .color-modal{position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:none;height:min(82dvh,720px);max-height:82dvh;padding:16px 16px calc(16px + env(safe-area-inset-bottom,0px));border-radius:18px 18px 0 0;overflow:hidden}
  .color-modal[open]{display:flex;flex-direction:column}
  .color-modal .modal-heading{flex:none;align-items:center;gap:12px;min-height:44px;margin-bottom:10px}
  .color-modal .modal-heading h2{font-size:20px}
  .color-modal .palette-dialog-title{gap:9px;flex-wrap:wrap}
  .color-modal .palette-dialog-title>span{font-size:12px;color:#58758a}
  .color-modal .modal-heading>button{min-width:44px;min-height:44px;font-size:27px;color:#456d86}
  .color-modal .search-box{flex:none;min-height:46px;height:46px;background:#f8fbfd}
  .color-modal .search-box input{min-height:44px;font-size:16px;color:#365c74}
  .color-modal .full-palette{flex:1;min-height:0;max-height:none;overflow:auto;overscroll-behavior:contain;margin-top:12px;padding:0 5px 0 2px;scroll-padding-top:8px}
  .full-palette-group>summary{min-height:44px;margin-bottom:8px;color:#355f7a}
  .palette-group-title{font-size:15px}
  .palette-group-count{font-size:12px;color:#5a788e}
  .full-palette-grid{grid-template-columns:repeat(auto-fill,minmax(44px,1fr));gap:7px}
  .full-palette button{min-width:44px;min-height:57px;padding:2px;border-radius:6px;color:#3e657d}
  .full-palette button.active{border-color:#1f78ab;box-shadow:0 0 0 1px #1f78ab;background:#edf7fd}
  .full-palette button>span{height:31px;margin:2px 2px 5px}
  .full-palette button>small{font-size:12px;margin-bottom:3px;line-height:1.2}
  .toast{bottom:calc(var(--mobile-dock-height) + 12px);font-size:13px;max-width:calc(100vw - 24px);padding:11px 15px;line-height:1.6}
  .calibration-tools button,.calibration-zoom button,.calibration-footer .primary-button,.calibration-footer .subtle-button{min-height:44px;font-size:12px}
  .calibration-fine input,.calibration-background select{min-height:44px;font-size:16px}
  .calibration-footer{position:sticky;bottom:0;background:#fff;padding:10px 0 calc(6px + env(safe-area-inset-bottom,0px));margin-top:10px}
}
@media(max-width:359px){
  .main-nav{gap:7px}
  .main-nav>a,.main-nav button{font-size:10px}
  .main-nav span{font-size:9px;margin-left:1px;padding:1px 2px}
  .mobile-tool-row>button{flex-direction:column;gap:2px;font-size:12px;padding:3px 2px}
  .mobile-tool-row svg{width:17px;height:17px}
  #mobile-panel-tabs button{padding-left:7px;padding-right:7px;font-size:11px}
  #mobile-tool-label{font-size:10px}
  .mobile-dock-heading{gap:5px}
}
@media(max-width:720px) and (min-width:560px) and (max-height:500px),(max-width:1440px) and (min-width:560px) and (max-height:500px) and (pointer:coarse){
  :root{--mobile-dock-height:calc(56px + env(safe-area-inset-bottom,0px))}
  .mobile-canvas-toolbar{grid-template-columns:minmax(279px,1fr) minmax(0,1.25fr);gap:4px 10px}
  .mobile-dock-heading{grid-column:1/-1}
  .mobile-tool-row{gap:3px}
  .mobile-tool-row>button{flex-direction:column;gap:2px;padding:2px;font-size:11px}
  #viewer-panel{height:calc(100dvh - 120px);min-height:370px}
  #viewer-panel:fullscreen{height:100dvh;min-height:0}
  #viewer-panel:fullscreen .viewer-title,#viewer-panel:fullscreen .viewer-footer{display:none}
  #viewer-panel:fullscreen .canvas-meta{min-height:20px}
  #viewer-panel:fullscreen .viewport{min-height:70px}
  .color-modal{height:94dvh;max-height:94dvh}
}
@media print{.mobile-canvas-toolbar,.mobile-return-canvas{display:none!important}}
@media(max-width:720px),(pointer:coarse) and (max-width:1440px){.palette .metrics{position:static;width:auto;margin:0 0 12px}.palette .panel-title{max-width:none}}

/* Scale artwork without the legacy CSS zoom/client-coordinate disagreement. */
.canvas-card{position:relative;overflow:hidden}
.canvas-content{position:absolute;left:0;top:0;width:max-content;max-width:none;transform-origin:0 0}
/* The canvas controller restores its own anchor after replacing artwork. */
#viewport{overflow-anchor:none}

/* The dock is measured at runtime so wrapping/system font sizes do not cover art. */
#mobile-more{display:none;flex:none;min-width:44px;min-height:44px;padding:6px;border:1px solid #d9e6ef;border-radius:7px;background:#f5fafd;color:#426e87;font-size:12px}
.mobile-actions-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px}
.mobile-actions-grid>button{min-height:48px;padding:12px;border:1px solid #d8e7f0;border-radius:7px;background:#f5fafd;text-align:left;font-size:14px}
#cloud-save-status:not(:empty){display:grid;gap:8px;margin-top:12px;color:#406276;line-height:1.5}
#cloud-save-status>button{justify-self:start;min-height:44px}
#mobile-save-summary{font-size:13px;line-height:1.7;color:#5c7d91}
.resize-view-switches{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:12px}
.export-resolution{display:grid;gap:8px;margin:8px 0 16px;font-size:13px;color:#4c7188}.export-resolution select{min-height:44px;padding:8px;border:1px solid #d8e7f0;border-radius:6px;background:#f7fbfe;font-size:14px}#export-generation-status{font-size:13px;line-height:1.8;margin:10px 0;color:#4b7793}#cancel-export-generation,#cancel-gallery-submit{min-height:44px}
.calibration-fine input[aria-invalid=true]{border-color:#c27461;box-shadow:0 0 0 1px #c27461}
.resize-view-switches>button{min-height:44px;padding:8px 12px;border:1px solid #d8e7f0;border-radius:6px;font-size:13px}
.resize-view-switches>button[aria-pressed=true]{background:#e7f4fc;border-color:#80b9da;color:#236f9a}
.resize-dialog[data-comparison-view=before] [data-resize-side=after],.resize-dialog[data-comparison-view=after] [data-resize-side=before]{display:none}
.resize-dialog[data-comparison-view=before] .resize-comparison,.resize-dialog[data-comparison-view=after] .resize-comparison{grid-template-columns:minmax(0,1fr)}
@media(max-width:720px),(pointer:coarse) and (max-width:1440px){
  .mobile-dock-heading{gap:4px}
  #mobile-panel-tabs{flex-shrink:1;min-width:0}
  #mobile-panel-tabs button{padding-left:7px;padding-right:7px}
  #mobile-tool-label{max-width:92px;font-size:10px}
  #view-highlight{min-height:44px;margin-bottom:10px}
  .modal{max-height:calc(var(--mobile-viewport-height,100dvh) - 16px);overscroll-behavior:contain;scroll-padding-bottom:70px}
  .color-modal,.canvas-actions-modal{bottom:var(--mobile-keyboard-inset,0px);max-height:calc(var(--mobile-viewport-height,100dvh) - 8px);padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
  .color-modal{height:min(82dvh,calc(var(--mobile-viewport-height,100dvh) - 8px))}
  .canvas-actions-modal{position:fixed;inset:auto 0 var(--mobile-keyboard-inset,0px);margin:0;width:100%;max-width:none;border-radius:16px 16px 0 0}
  .mobile-keyboard-open .mobile-canvas-toolbar{visibility:hidden;pointer-events:none}
  .resize-actions{position:sticky;bottom:-17px;z-index:2;min-height:64px;padding:12px 0 calc(12px + env(safe-area-inset-bottom,0px));background:#fff;border-top:1px solid #e0eaf2}
  .resize-actions>button{min-height:44px}
  .resize-art{place-items:start}
  .resize-dialog[data-comparison-view=before] .resize-art,.resize-dialog[data-comparison-view=after] .resize-art{min-height:300px}
}

/* Two-row mobile dock and a scrollable camera space independent of fit padding. */
.art-stage{--canvas-fit-padding:26px;align-content:start;justify-content:start}
#viewer-panel #viewport.page-scroll-mode{touch-action:pan-y;overflow:hidden;overscroll-behavior:auto}
.blank-canvas-mode .setup>.mode-setting,.blank-canvas-mode .setup>.background-setting,.blank-canvas-mode .setup>.color-setting,.blank-canvas-mode .setup>.conversion-actions{display:none}
.blank-canvas-mode .setup{display:block}
.blank-canvas-mode .setup>.size-setting{grid-column:auto;grid-row:auto}
@media(max-width:720px),(pointer:coarse) and (max-width:1440px){
 #viewer-panel .viewport{flex:1 1 0;min-height:0;min-width:0;height:0;overflow:auto}
 #viewer-panel .art-stage{--canvas-fit-padding:16px}
 #viewer-panel #mobile-more{display:flex}
}
@media(max-width:480px){.mobile-tool-row>button{flex-direction:column;gap:2px;font-size:12px}}
@media(min-width:560px) and (max-width:639px) and (max-height:500px){
 :root{--mobile-dock-height:calc(106px + env(safe-area-inset-bottom,0px))}
 .mobile-canvas-toolbar{grid-template-columns:minmax(0,1fr)}
}
.edit-size-actions>#open-insert-grid{min-height:44px}
.insert-grid-dialog{width:min(420px,calc(100vw - 30px))}
.insert-grid-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr) minmax(0,.8fr);gap:8px}
.insert-grid-fields label{display:grid;gap:6px;min-width:0;font-size:13px}
.insert-grid-fields :is(select,input){width:100%;min-width:0;min-height:44px;padding:6px;font-size:16px;border:1px solid var(--wb-line);border-radius:7px;color:inherit;background:var(--wb-soft)}
.insert-grid-dialog p{font-size:13px;line-height:1.5;margin:12px 0}
#insert-grid-position-hint{color:var(--wb-muted)}
.insert-grid-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
.insert-grid-actions button{width:auto;min-height:44px}
.chart-profile-modal{width:min(470px,calc(100vw - 28px));max-height:calc(100dvh - 24px);overflow:auto}
.chart-profile-modal form{display:grid;gap:11px}
.chart-profile-modal label{display:grid;gap:5px;font-size:13px}
.chart-profile-modal :is(select,input){width:100%;min-width:0;min-height:44px;padding:6px;font-size:16px;border:1px solid var(--wb-line);border-radius:7px;color:inherit;background:var(--wb-soft)}
.chart-profile-modal fieldset{display:grid;grid-template-columns:1fr 1fr;gap:10px;min-width:0;margin:0;padding:8px 10px 10px;border:1px solid var(--wb-line);border-radius:7px}
.chart-profile-modal legend{padding:0 5px;font-size:13px}
.chart-profile-note,#chart-profile-status{margin:0;font-size:13px;line-height:1.55;color:var(--wb-muted)}
#chart-profile-status:empty{display:none}
.chart-profile-actions{display:flex;justify-content:flex-end;gap:8px}
.chart-profile-actions button,#open-chart-profile-export{width:auto;min-height:44px}
@media(max-width:480px){.insert-grid-fields{grid-template-columns:1fr}.insert-grid-dialog{padding:18px}}
