:root{color-scheme:light;--bg:#F6F4EF;--panel:#FFFFFF;--surface:#F0EDE6;--surface-hi:#E6E2D8;--border:#E1DCD1;--border-hi:#CBC4B5;--accent:#2C7A44;--accent-hover:#235E34;--accent-soft:rgba(44,122,68,0.10);--accent-soft-hi:rgba(44,122,68,0.18);--accent-fill:#2C7A44;--accent-fill-hover:#235E34;--text:#1E1D19;--muted:#5F5A50;--faint:#8F887A;--danger:#B8432E;--danger-soft:rgba(184,67,46,0.10);--swatch-border:rgba(30,26,18,0.16);--checker-a:#CFCCC5;--checker-b:#F3F1EC;--grid-line:rgba(30,26,18,0.06);--grid-strong:rgba(110,104,92,0.42);--backdrop:rgba(24,22,18,0.38);--space-1:0.25rem;--space-2:0.5rem;--space-3:0.75rem;--space-4:1rem;--space-5:1.25rem;--space-6:1.5rem;--space-8:2rem;--radius-sm:4px;--radius-md:6px;--radius-lg:8px;--radius-full:999px;--shadow-pop:0 1px 2px rgba(30,26,18,0.06),0 8px 24px rgba(30,26,18,0.12);--ease:120ms ease;--font-sans:'IBM Plex Sans',system-ui,-apple-system,'Segoe UI',sans-serif;--font-mono:'IBM Plex Mono',ui-monospace,'SFMono-Regular',Consolas,monospace;--font-display:var(--font-sans);--font-body:var(--font-sans)}:root[data-theme=dark]{color-scheme:dark;--bg:#141310;--panel:#1C1A16;--surface:#25221D;--surface-hi:#2F2B25;--border:#322E27;--border-hi:#474136;--accent:#5DB97A;--accent-hover:#75C78F;--accent-soft:rgba(93,185,122,0.14);--accent-soft-hi:rgba(93,185,122,0.26);--text:#ECE8DF;--muted:#A39C8F;--faint:#736C60;--danger:#E8705C;--danger-soft:rgba(232,112,92,0.14);--swatch-border:rgba(255,255,255,0.16);--checker-a:#2A2620;--checker-b:#33302A;--grid-line:rgba(255,255,255,0.05);--grid-strong:rgba(170,164,152,0.34);--backdrop:rgba(0,0,0,0.55);--shadow-pop:0 1px 2px rgba(0,0,0,0.4),0 10px 28px rgba(0,0,0,0.5)}*,::after,::before{box-sizing:border-box;margin:0;padding:0}body,html{height:100%}body{background:var(--bg);color:var(--text);font-family:var(--font-sans);font-size:14px;line-height:1.45;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer}::selection{background:var(--accent-soft-hi);color:var(--text)}:focus{outline:0}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}[hidden]{display:none!important}.visually-hidden-input{position:absolute;opacity:0;width:0;height:0;pointer-events: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}.icon{width:18px;height:18px;flex-shrink:0}:where(button,a,label,span)>svg:where(:not([width])){width:18px;height:18px;flex-shrink:0}.logo{display:inline-flex;align-items:center;gap:.6rem;white-space:nowrap;flex-shrink:0;text-decoration:none;color:var(--text);font-weight:700;font-size:1.125rem;letter-spacing:-.01em}.logo-img{display:block;width:34px;height:30px;image-rendering:pixelated}.btn{display:inline-flex;align-items:center;justify-content:center;gap:.45rem;height:34px;padding:0 .85rem;border:1px solid var(--border-hi);border-radius:var(--radius-md);background:var(--panel);color:var(--text);font-size:.875rem;font-weight:500;line-height:1;white-space:nowrap;text-decoration:none;transition:background var(--ease),border-color var(--ease),color var(--ease)}.btn svg{width:16px;height:16px;flex-shrink:0}.btn:hover{background:var(--surface)}.btn:active{background:var(--surface-hi)}.btn:disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.btn-primary{background:var(--accent-fill);border-color:var(--accent-fill);color:#fff;font-weight:600}.btn-primary:hover{background:var(--accent-fill-hover);border-color:var(--accent-fill-hover);color:#fff}.btn-primary:active{background:var(--accent-fill-hover)}.btn-danger{color:var(--danger);border-color:var(--danger)}.btn-danger:hover{background:var(--danger-soft);color:var(--danger)}.btn-danger.btn-solid{background:var(--danger);color:#fff}.btn-ghost{border-color:transparent;background:0 0}.btn-ghost:hover{background:var(--surface)}.icon-btn,.theme-toggle-btn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;flex-shrink:0;padding:0;border:1px solid transparent;border-radius:var(--radius-md);background:0 0;color:var(--muted);transition:background var(--ease),color var(--ease),border-color var(--ease)}.icon-btn svg,.theme-toggle-btn svg{width:18px;height:18px}.icon-btn:hover,.theme-toggle-btn:hover{background:var(--surface);color:var(--text)}.icon-btn:active{background:var(--surface-hi)}.icon-btn:disabled{color:var(--faint);opacity:.5;cursor:default;background:0 0}.icon-btn.active{background:var(--accent-soft);color:var(--accent)}.theme-toggle-btn .icon-sun{display:none}:root[data-theme=dark] .theme-toggle-btn .icon-sun{display:block}:root[data-theme=dark] .theme-toggle-btn .icon-moon{display:none}.field-label{display:block;font-size:.75rem;font-weight:500;color:var(--muted);margin-bottom:.35rem}.custom-num-input,.text-input{height:34px;border:1px solid var(--border-hi);border-radius:var(--radius-md);background:var(--panel);color:var(--text);padding:0 .6rem;transition:border-color var(--ease)}.custom-num-input{width:100%;font-family:var(--font-mono);font-size:.875rem;-moz-appearance:textfield;appearance:textfield}.custom-num-input::-webkit-inner-spin-button,.custom-num-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.custom-num-input:focus,.text-input:focus{border-color:var(--accent)}.seg{display:flex;gap:2px;padding:2px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);margin-bottom:var(--space-4)}.seg-btn{flex:1;min-width:0;height:30px;padding:0 .5rem;border:1px solid transparent;border-radius:var(--radius-sm);background:0 0;color:var(--muted);font-size:.8125rem;font-weight:500;white-space:nowrap;transition:background var(--ease),color var(--ease)}.seg-btn:hover{color:var(--text)}.seg-btn.active{background:var(--panel);border-color:var(--border-hi);color:var(--text);font-weight:600}.seg-mono .seg-btn{font-family:var(--font-mono)}body.editor{height:100vh;height:100dvh;overflow:hidden;display:grid;grid-template-columns:64px minmax(0,1fr) 248px;grid-template-rows:52px 44px minmax(0,1fr) auto;grid-template-areas:"top   top      top" "tools opts     side" "tools stage    side" "tools timeline side"}.ed-top{grid-area:top;display:flex;align-items:center;gap:var(--space-2);padding:0 var(--space-3) 0 var(--space-4);background:var(--panel);border-bottom:1px solid var(--border);min-width:0;position:relative;z-index:20}.ed-top .logo{margin-right:var(--space-2)}.ed-top-sep{width:1px;height:22px;background:var(--border);margin:0 var(--space-1);flex-shrink:0}.ed-top-spacer{flex:1;min-width:var(--space-2)}.ed-top-group{display:flex;align-items:center;gap:2px}.menubar{display:flex;align-items:center}.menu-wrap{position:relative}.menu-btn{height:30px;padding:0 .6rem;border:none;border-radius:var(--radius-sm);background:0 0;color:var(--muted);font-size:.8125rem;font-weight:500}.menu-btn.open,.menu-btn:hover{background:var(--surface);color:var(--text)}.menu{position:absolute;top:calc(100% + 6px);left:0;z-index:300;min-width:252px;padding:4px;background:var(--panel);border:1px solid var(--border-hi);border-radius:var(--radius-md);box-shadow:var(--shadow-pop)}.menu-item{display:grid;grid-template-columns:16px 1fr auto;align-items:center;gap:.5rem;width:100%;height:30px;padding:0 .55rem 0 .45rem;border:none;border-radius:var(--radius-sm);background:0 0;color:var(--text);font-size:.8125rem;text-align:left;white-space:nowrap}.menu-item:focus-visible,.menu-item:hover:not(:disabled){background:var(--accent-soft);outline:0}.menu-item:disabled{color:var(--faint);cursor:default}.menu-check svg{display:block;width:14px;height:14px;color:var(--accent)}.menu-key{font-family:var(--font-mono);font-size:.6875rem;color:var(--faint)}.menu-sep{height:1px;margin:4px 2px;background:var(--border)}.size-btn{display:inline-flex;align-items:center;gap:.45rem;height:34px;padding:0 .7rem;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);color:var(--text);font-family:var(--font-mono);font-size:.8125rem;transition:border-color var(--ease),background var(--ease)}.size-btn svg{width:16px;height:16px;color:var(--muted)}.size-btn:hover{border-color:var(--border-hi);background:var(--surface-hi)}.ed-tools{grid-area:tools;display:flex;flex-direction:column;align-items:center;gap:2px;padding:var(--space-2) 6px;background:var(--panel);border-right:1px solid var(--border);overflow-y:auto;overflow-x:hidden;scrollbar-width:none;min-height:0}.ed-tools::-webkit-scrollbar{width:0}.tool-sep{width:32px;height:1px;background:var(--border);margin:6px 0;flex-shrink:0}.tool-btn{width:52px;height:46px;flex-shrink:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:0;border:1px solid transparent;border-radius:var(--radius-md);background:0 0;color:var(--muted);font-size:.6875rem;font-weight:500;line-height:1;transition:background var(--ease),color var(--ease),border-color var(--ease)}.tool-btn svg{width:20px;height:20px}.tool-btn:hover{background:var(--surface);color:var(--text)}.tool-btn.active{background:var(--accent-soft);border-color:var(--accent);color:var(--accent);font-weight:600}.tool-mobile{display:none}.tab-badge{position:absolute;top:5px;left:calc(50% + 6px);min-width:16px;height:16px;padding:0 4px;border-radius:var(--radius-full);background:var(--accent-fill);color:#fff;font-family:var(--font-mono);font-size:.625rem;font-weight:500;line-height:16px;text-align:center}.ed-opts{grid-area:opts;display:flex;align-items:center;gap:var(--space-3);min-width:0;padding:0 var(--space-3);background:var(--panel);border-bottom:1px solid var(--border);overflow-x:auto;overflow-y:hidden;scrollbar-width:none;white-space:nowrap}.ed-opts::-webkit-scrollbar{height:0}.opt-tool-name{flex-shrink:0;padding-right:var(--space-3);border-right:1px solid var(--border);font-size:.8125rem;font-weight:600;line-height:22px;color:var(--text)}.opt-group{display:flex;align-items:center;gap:4px;flex-shrink:0}.opt-label{margin-right:2px;font-size:.75rem;color:var(--muted)}.stepper{display:flex;align-items:center;height:30px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--panel)}.stepper-btn{width:28px;height:100%;display:inline-flex;align-items:center;justify-content:center;padding:0;border:none;background:0 0;color:var(--muted)}.stepper-btn svg{width:14px;height:14px}.stepper-btn:hover{color:var(--text);background:var(--surface)}.stepper-btn:first-child{border-radius:var(--radius-md) 0 0 var(--radius-md)}.stepper-btn:last-child{border-radius:0 var(--radius-md) var(--radius-md) 0}.stepper-value{min-width:4.2ch;text-align:center;font-family:var(--font-mono);font-size:.8125rem;color:var(--text)}.seg.seg-sm{margin-bottom:0}.seg-sm .seg-btn{height:24px;padding:0 .6rem;font-size:.75rem}.opt-btn,.opt-toggle{display:inline-flex;align-items:center;justify-content:center;gap:.35rem;height:30px;min-width:30px;padding:0 .45rem;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--panel);color:var(--muted);font-size:.8125rem;font-weight:500;transition:background var(--ease),color var(--ease),border-color var(--ease)}.opt-btn svg,.opt-toggle svg{width:16px;height:16px}.opt-btn{border-color:transparent;background:0 0}.opt-btn:hover,.opt-toggle:hover{background:var(--surface);color:var(--text)}.opt-toggle.active{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}.opt-btn:disabled,.opt-toggle:disabled{opacity:.4;cursor:default;color:var(--muted)}.opt-btn:disabled{background:0 0}.opt-toggle:disabled{background:var(--panel)}.opt-divider{width:1px;height:18px;margin:0 4px;background:var(--border);flex-shrink:0}.opt-sel-info{min-width:10ch;margin-right:4px;font-family:var(--font-mono);font-size:.75rem;color:var(--faint)}.opt-hint{flex:1 1 0;min-width:0;padding-left:var(--space-2);overflow:hidden;text-overflow:ellipsis;text-align:right;font-size:.75rem;color:var(--faint)}.opt-transform{position:sticky;right:0;z-index:1;margin-left:auto;padding-left:var(--space-2);background:var(--panel)}.opt-transform::before{content:'';flex-shrink:0;width:1px;height:22px;margin-right:var(--space-2);background:var(--border)}.canvas-area{grid-area:stage;position:relative;min-width:0;min-height:0;overflow:hidden;background-color:var(--bg)}.canvas-scroll{width:100%;height:100%;display:flex;padding:var(--space-6);overflow:auto;touch-action:none}.canvas-frame{position:relative;flex-shrink:0;margin:auto;border:1px solid var(--border-hi)}#pixelCanvas{display:block;cursor:crosshair;touch-action:none;image-rendering:pixelated;image-rendering:crisp-edges;background-color:var(--checker-b);background-image:conic-gradient(var(--checker-a) 25%,var(--checker-b) 0 50%,var(--checker-a) 0 75%,var(--checker-b) 0);background-size:16px 16px}.grid-overlay{position:absolute;inset:0;display:none;pointer-events:none;background-image:linear-gradient(to right,var(--grid-strong) 1px,transparent 1px),linear-gradient(to bottom,var(--grid-strong) 1px,transparent 1px)}.canvas-frame.show-grid .grid-overlay{display:block}.canvas-frame.grid-too-dense .grid-overlay{display:none}.mirror-axis{position:absolute;display:none;pointer-events:none}.mirror-axis.axis-x{top:0;bottom:0;left:50%;border-left:1px dashed var(--accent)}.mirror-axis.axis-y{left:0;right:0;top:50%;border-top:1px dashed var(--accent)}.canvas-frame.mirror-x .axis-x,.canvas-frame.mirror-y .axis-y{display:block}.sel-box{position:absolute;pointer-events:none;border:1px dashed #111;box-shadow:inset 0 0 0 1px rgba(255,255,255,.85)}.sel-box.floating{border-color:var(--accent-fill)}.canvas-area.panning,.canvas-area.panning #pixelCanvas{cursor:grabbing!important}.toast{position:absolute;top:var(--space-3);left:50%;z-index:6;transform:translateX(-50%);max-width:calc(100% - 2 * var(--space-3));padding:.45rem .75rem;display:none;background:var(--text);color:var(--bg);border-radius:var(--radius-md);font-size:.8125rem;line-height:1.35;text-align:center;pointer-events:none}.toast.open{display:block}.drop-hint{position:absolute;inset:var(--space-3);z-index:7;display:none;align-items:center;justify-content:center;border:2px dashed var(--accent);border-radius:var(--radius-lg);background:var(--accent-soft);color:var(--accent);font-weight:600;pointer-events:none}.canvas-area.drop-over .drop-hint{display:flex}.canvas-hud{position:absolute;right:var(--space-3);bottom:var(--space-3);display:flex;align-items:center;gap:2px;height:34px;padding:0 2px 0 var(--space-3);background:var(--panel);border:1px solid var(--border);border-radius:var(--radius-md);font-family:var(--font-mono);font-size:.75rem;color:var(--muted);user-select:none}.hud-pos{display:none;min-width:6ch;padding-right:var(--space-2);margin-right:var(--space-2);border-right:1px solid var(--border);line-height:18px;color:var(--text)}.hud-pos.on{display:inline}.hud-dims{padding-right:var(--space-2);margin-right:2px;border-right:1px solid var(--border);line-height:18px}.hud-btn{height:28px;min-width:28px;padding:0 .35rem;display:inline-flex;align-items:center;justify-content:center;border:none;border-radius:var(--radius-sm);background:0 0;color:var(--muted);font-family:var(--font-mono);font-size:.75rem}.hud-btn svg{width:15px;height:15px}.hud-btn:hover{background:var(--surface);color:var(--text)}.hud-btn.active{color:var(--accent);background:var(--accent-soft)}.canvas-hud-zoom{min-width:48px}.canvas-hud-zoom.is-zoomed{color:var(--accent)}.canvas-rotate{display:none}.ed-side{grid-area:side;display:flex;flex-direction:column;min-height:0;overflow-y:auto;background:var(--panel);border-left:1px solid var(--border)}.side-section{padding:var(--space-4);border-bottom:1px solid var(--border)}.side-section:last-child{border-bottom:none}.side-head{display:flex;align-items:center;gap:var(--space-2);min-height:24px;margin-bottom:var(--space-3)}.side-head h2{font-size:.8125rem;font-weight:600;color:var(--text)}.side-count{font-family:var(--font-mono);font-size:.75rem;color:var(--faint)}.side-link{margin-left:auto;display:inline-flex;align-items:center;gap:.3rem;height:26px;padding:0 .5rem;border:1px solid transparent;border-radius:var(--radius-sm);background:0 0;color:var(--accent);font-size:.8125rem;font-weight:500}.side-link svg{width:14px;height:14px}.side-link:hover{background:var(--accent-soft)}.side-link.active{background:var(--accent-soft)}.color-row{display:flex;align-items:center;gap:var(--space-2)}.color-pair{position:relative;width:58px;height:52px;flex-shrink:0}.color-chip{position:absolute;padding:0;border:1px solid var(--swatch-border);border-radius:var(--radius-md);box-shadow:inset 0 0 0 2px var(--panel)}.color-primary{left:0;top:0;z-index:1;width:38px;height:38px}.color-secondary{right:0;bottom:0;width:30px;height:30px}.color-chip:hover{border-color:var(--text)}.color-chip.is-transparent,.swatch-clear{background-color:var(--checker-b);background-image:conic-gradient(var(--checker-a) 25%,var(--checker-b) 0 50%,var(--checker-a) 0 75%,var(--checker-b) 0);background-size:10px 10px}.color-swap{position:absolute;top:0;right:0;width:18px;height:18px;display:flex;align-items:center;justify-content:center;padding:0;border:none;border-radius:var(--radius-sm);background:0 0;color:var(--muted)}.color-swap svg{width:14px;height:14px}.color-swap:hover{color:var(--text);background:var(--surface)}.hex-field{flex:1;min-width:0;display:flex;align-items:center;height:34px;border:1px solid var(--border-hi);border-radius:var(--radius-md);background:var(--panel);padding:0 .6rem;gap:.4rem;transition:border-color var(--ease)}.hex-field:focus-within{border-color:var(--accent)}.hex-field-label{font-size:.6875rem;font-weight:600;color:var(--faint);letter-spacing:.04em}.color-hex-input{flex:1;min-width:0;border:none;background:0 0;color:var(--text);font-family:var(--font-mono);font-size:.875rem;text-transform:uppercase}.color-hint{margin-top:var(--space-2);font-size:.75rem;color:var(--faint)}.palette-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.swatch{position:relative;aspect-ratio:1;width:100%;min-width:0;padding:0;border:1px solid var(--swatch-border);border-radius:var(--radius-sm)}.swatch:hover{border-color:var(--text)}.swatch.active{border-color:var(--text);box-shadow:inset 0 0 0 2px var(--panel);outline:2px solid var(--text);outline-offset:0}.swatch.secondary::before{content:'';position:absolute;right:2px;bottom:2px;width:6px;height:6px;border:1px solid var(--text);border-radius:1px;background:var(--panel)}.swatch-clear{background-size:50% 50%}.swatch-clear::after{content:'';position:absolute;left:50%;top:14%;bottom:14%;width:1.5px;background:var(--danger);transform:translateX(-50%) rotate(45deg)}.preview-box{display:flex;align-items:center;justify-content:center;height:124px;border:1px solid var(--border);border-radius:var(--radius-md);background-color:var(--checker-b);background-image:conic-gradient(var(--checker-a) 25%,var(--checker-b) 0 50%,var(--checker-a) 0 75%,var(--checker-b) 0);background-size:12px 12px;overflow:hidden}#previewCanvas{display:block;image-rendering:pixelated;image-rendering:crisp-edges}.pe-close-btn.sheet-close{display:none}.layer-list{display:flex;flex-direction:column;gap:2px;max-height:160px;overflow-y:auto}.layer-row{display:flex;align-items:center;gap:6px;flex-shrink:0;height:36px;padding:0 6px 0 2px;border:1px solid transparent;border-radius:var(--radius-md);cursor:pointer;user-select:none}.layer-row:hover{background:var(--surface)}.layer-row.active{background:var(--accent-soft);border-color:var(--accent)}.layer-eye{width:28px;height:28px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;padding:0;border:none;border-radius:var(--radius-sm);background:0 0;color:var(--muted)}.layer-eye svg{width:16px;height:16px}.layer-eye:hover{color:var(--text);background:var(--surface-hi)}.layer-row.is-hidden .layer-eye{color:var(--faint)}.layer-row.is-hidden .layer-name,.layer-row.is-hidden .layer-thumb-wrap{opacity:.45}.layer-thumb-wrap{width:28px;height:28px;flex-shrink:0;display:flex;align-items:center;justify-content:center;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-sm);background-color:var(--checker-b);background-image:conic-gradient(var(--checker-a) 25%,var(--checker-b) 0 50%,var(--checker-a) 0 75%,var(--checker-b) 0);background-size:6px 6px}.layer-thumb{display:block;image-rendering:pixelated;image-rendering:crisp-edges}.layer-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.8125rem;color:var(--text)}.layer-row.active .layer-name{font-weight:600}.layer-name-input{flex:1;min-width:0;height:26px;padding:0 .4rem;border:1px solid var(--accent);border-radius:var(--radius-sm);background:var(--panel);font-size:.8125rem}.layer-actions{display:flex;gap:3px;margin-top:var(--space-2)}.layer-act{flex:1;height:28px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--panel);color:var(--muted)}.layer-act svg{width:15px;height:15px}.layer-act:hover{background:var(--surface);color:var(--text)}.layer-act.danger:hover{color:var(--danger);background:var(--danger-soft)}.layer-act:disabled{opacity:.4;cursor:default;background:var(--panel);color:var(--muted)}.frames-bar{grid-area:timeline;display:flex;align-items:center;gap:var(--space-3);min-width:0;padding:var(--space-2) var(--space-3);background:var(--panel);border-top:1px solid var(--border)}.sheet-head{display:none}.frames-actions,.frames-controls{display:flex;align-items:center;gap:var(--space-1);flex-shrink:0}.frames-actions{padding-left:var(--space-3);border-left:1px solid var(--border);align-self:stretch}.frame-ctrl-btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;height:34px;min-width:34px;padding:0 .5rem;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--panel);color:var(--muted);font-size:.8125rem;font-weight:500;white-space:nowrap;transition:background var(--ease),color var(--ease),border-color var(--ease)}.frame-ctrl-btn svg{width:16px;height:16px;flex-shrink:0}.frame-ctrl-btn:hover{background:var(--surface);color:var(--text)}.frame-ctrl-btn:disabled{opacity:.45;cursor:default;background:var(--panel);color:var(--muted)}.frame-ctrl-btn.active{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}#playBtn{width:38px;padding:0;color:var(--text)}#playBtn svg{width:14px;height:14px}#playBtn.active{color:var(--accent)}.frame-del-btn:hover{color:var(--danger);background:var(--danger-soft)}.fps-control{display:flex;align-items:center;height:34px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--panel)}.fps-step{width:28px;height:100%;border:none;background:0 0;color:var(--muted);font-size:1rem;line-height:1}.fps-step:hover{color:var(--text);background:var(--surface)}.fps-step:first-child{border-radius:var(--radius-md) 0 0 var(--radius-md)}.fps-step:last-child{border-radius:0 var(--radius-md) var(--radius-md) 0}.fps-value{display:flex;align-items:baseline;gap:.25rem;padding:0 .15rem;font-family:var(--font-mono);font-size:.8125rem;color:var(--muted);white-space:nowrap}.fps-input{width:2.4ch;border:none;background:0 0;color:var(--text);font-family:var(--font-mono);font-size:.8125rem;text-align:right;-moz-appearance:textfield;appearance:textfield}.fps-input::-webkit-inner-spin-button,.fps-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.frame-info{font-family:var(--font-mono);font-size:.75rem;color:var(--faint);padding:0 var(--space-2);white-space:nowrap}.frames-strip{flex:1;min-width:0;display:flex;align-items:center;gap:6px;overflow-x:auto;overflow-y:hidden;padding:4px 2px;scrollbar-width:thin}.frame-item{position:relative;flex-shrink:0;padding:0;border:1px solid var(--border-hi);border-radius:var(--radius-md);background:var(--panel);overflow:hidden}.frame-item:hover{border-color:var(--muted)}.frame-item.active{border-color:var(--accent);outline:2px solid var(--accent);outline-offset:-1px}.frame-item.drop-target{outline:2px dashed var(--accent);outline-offset:2px}.frame-thumb-wrap{width:56px;height:56px;display:flex;align-items:center;justify-content:center;background-color:var(--checker-b);background-image:conic-gradient(var(--checker-a) 25%,var(--checker-b) 0 50%,var(--checker-a) 0 75%,var(--checker-b) 0);background-size:8px 8px}.frame-thumb{display:block;image-rendering:pixelated;image-rendering:crisp-edges}.frame-num{position:absolute;left:0;bottom:0;min-width:16px;padding:1px 4px;background:var(--panel);border-top-right-radius:var(--radius-sm);font-family:var(--font-mono);font-size:.625rem;line-height:1.3;color:var(--muted)}.frame-item.active .frame-num{background:var(--accent-fill);color:#fff}.frame-add{flex-shrink:0;width:40px;height:58px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--border-hi);border-radius:var(--radius-md);background:0 0;color:var(--muted)}.frame-add svg{width:18px;height:18px}.frame-add:hover{border-color:var(--accent);color:var(--accent);background:var(--accent-soft)}.msheet,.msheet-backdrop{display:none}.pe-backdrop{display:none;position:fixed;inset:0;z-index:100;background:var(--backdrop)}.pe-backdrop.open{display:block}.modal-panel{display:none;position:fixed;z-index:200;top:50%;left:50%;transform:translate(-50%,-50%);width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 32px);overflow-y:auto;padding:var(--space-5);background:var(--panel);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-pop)}.modal-panel.open{display:block}.palette-editor{width:min(460px,calc(100vw - 24px))}.shortcuts-modal{width:min(460px,calc(100vw - 24px))}.pe-header{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);margin-bottom:var(--space-4)}.pe-title{font-size:1rem;font-weight:600;color:var(--text)}.pe-close-btn{width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;padding:0;margin-right:-6px;border:none;border-radius:var(--radius-md);background:0 0;color:var(--muted)}.pe-close-btn svg{width:18px;height:18px}.pe-close-btn:hover{background:var(--surface);color:var(--text)}.pe-section-label{font-size:.75rem;font-weight:500;color:var(--muted);margin-bottom:var(--space-2)}.pe-footer{display:flex;justify-content:flex-end;align-items:center;gap:var(--space-2);margin-top:var(--space-5)}.pe-footer .pe-footer-left{margin-right:auto}.confirm-title-danger{color:var(--danger)}.confirm-body{font-size:.875rem;line-height:1.55;color:var(--muted)}.confirm-body strong{color:var(--text);font-weight:600}.pe-swatches{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:var(--space-2);padding:var(--space-3);max-height:min(48vh,340px);overflow-y:auto;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md)}.pe-swatch-wrap{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px}.pe-swatch{width:100%;aspect-ratio:1;border:1px solid var(--swatch-border);border-radius:var(--radius-sm);cursor:pointer}.pe-swatch:hover{border-color:var(--text)}.pe-swatch-fixed{position:relative;cursor:default}.pe-swatch-fixed:hover{border-color:var(--swatch-border)}.pe-swatch-label{font-family:var(--font-mono);font-size:.5625rem;color:var(--faint);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pe-del-btn{position:absolute;top:-6px;right:-6px;width:20px;height:20px;display:flex;align-items:center;justify-content:center;padding:0;border:1px solid var(--border-hi);border-radius:var(--radius-full);background:var(--panel);color:var(--muted);font-size:13px;line-height:1;opacity:0}.pe-swatch-wrap:focus-within .pe-del-btn,.pe-swatch-wrap:hover .pe-del-btn{opacity:1}.pe-del-btn:hover{color:#fff;background:var(--danger);border-color:var(--danger)}@media (hover:none){.pe-del-btn{opacity:1}}@media (max-width:480px){.pe-swatches{gap:6px;padding:var(--space-2)}.pe-swatch-label{font-size:.5rem}.palette-editor .pe-footer{flex-wrap:wrap}.palette-editor .pe-footer .btn-primary{flex-basis:100%;justify-content:center}}.size-presets{display:grid;grid-template-columns:repeat(5,1fr)}.size-fields{display:grid;grid-template-columns:1fr auto 1fr;align-items:end;gap:var(--space-2)}.size-lock-btn{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--panel);color:var(--faint)}.size-lock-btn svg{width:16px;height:16px}.size-lock-btn:hover{color:var(--text)}.size-lock-btn.active{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}.size-body{display:flex;align-items:flex-end;gap:var(--space-4)}.size-body .size-fields{flex:1;min-width:0}.anchor-grid{display:grid;grid-template-columns:repeat(3,18px);grid-template-rows:repeat(3,18px);gap:3px;width:max-content;padding:3px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface)}.anchor-btn{padding:0;border:1px solid var(--border-hi);border-radius:3px;background:var(--panel)}.anchor-btn:hover{border-color:var(--muted)}.anchor-btn.active{background:var(--accent-fill);border-color:var(--accent-fill)}.size-note{margin-top:var(--space-3);font-size:.8125rem;color:var(--muted)}.save-as-input-wrap{display:flex;align-items:center;gap:var(--space-2);height:38px;padding:0 .7rem;margin-bottom:var(--space-4);border:1px solid var(--border-hi);border-radius:var(--radius-md);background:var(--panel);transition:border-color var(--ease)}.save-as-input-wrap:focus-within{border-color:var(--accent)}.save-as-input{flex:1;min-width:0;border:none;background:0 0;color:var(--text);font-size:.9375rem}.save-as-ext{font-family:var(--font-mono);font-size:.875rem;color:var(--faint)}.export-summary{font-family:var(--font-mono);font-size:.8125rem;color:var(--muted);padding:.6rem .75rem;background:var(--surface);border-radius:var(--radius-md)}.export-summary strong{color:var(--text);font-weight:500}.sc-list{max-height:min(56vh,440px);overflow-y:auto;border:1px solid var(--border);border-radius:var(--radius-md);padding:0 var(--space-3) var(--space-2);margin-bottom:var(--space-2)}.sc-group+.sc-group{border-top:1px solid var(--border)}.sc-group-label{font-size:.75rem;font-weight:600;color:var(--faint);padding:var(--space-3) 0 var(--space-1)}.sc-row{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);min-height:34px}.sc-label{font-size:.875rem;color:var(--text)}.sc-keys{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:var(--space-1)}.sc-chip{display:inline-flex;align-items:stretch;height:26px;border:1px solid var(--border-hi);border-bottom-width:2px;border-radius:var(--radius-sm);background:var(--panel);overflow:hidden}.sc-add,.sc-key,.sc-recording,.sc-remove{border:none;background:0 0;color:var(--text);padding:0}.sc-key{min-width:26px;padding:0 .45rem;font-family:var(--font-mono);font-size:.75rem}.sc-key:hover{background:var(--surface)}.sc-remove{width:20px;display:flex;align-items:center;justify-content:center;color:var(--faint);border-left:1px solid var(--border)}.sc-remove svg{width:9px;height:9px}.sc-remove:hover{color:var(--danger);background:var(--danger-soft)}.sc-add{width:26px;height:26px;display:flex;align-items:center;justify-content:center;color:var(--faint);border:1px dashed var(--border-hi);border-radius:var(--radius-sm)}.sc-add svg{width:11px;height:11px}.sc-add:hover{color:var(--accent);border-color:var(--accent)}.sc-recording{height:26px;padding:0 .55rem;font-family:var(--font-mono);font-size:.75rem;color:var(--accent);background:var(--accent-soft);border:1px solid var(--accent);border-radius:var(--radius-sm)}.sc-none{font-size:.75rem;color:var(--faint)}.sc-status{min-height:1.2rem;font-size:.8125rem;color:var(--muted)}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--border-hi);border:3px solid transparent;background-clip:padding-box;border-radius:var(--radius-full)}::-webkit-scrollbar-thumb:hover{background-color:var(--faint)}*{scrollbar-color:var(--border-hi) transparent}@media (max-width:1100px) and (min-width:821px){body.editor{grid-template-columns:64px minmax(0,1fr) 216px}.frame-ctrl-btn .btn-label{display:none}.frame-info{display:none}.opt-hint{display:none}.menu-btn{padding:0 .45rem}.hex-field-label{display:none}}@media (max-width:1000px) and (min-width:821px){.size-btn{display:none}.ed-top .logo-text{display:none}.opt-tool-name,.opt-transform .opt-flip{display:none}}@media (max-width:1240px) and (min-width:821px){.opt-transform .opt-label,[data-for="select move"] .opt-text{display:none}}@media (max-width:820px){body.editor{grid-template-columns:minmax(0,1fr);grid-template-rows:52px 42px minmax(0,1fr) auto auto;grid-template-areas:"top" "opts" "stage" "side" "tools"}.ed-opts{gap:var(--space-2);padding:0 var(--space-2)}.opt-hint,.opt-label,.opt-sel-info,.opt-text,.opt-tool-name{display:none}.opt-btn,.opt-toggle,.stepper{height:32px}.opt-btn,.opt-toggle{min-width:34px}.opt-transform{display:none}.ed-top{padding:0 var(--space-2) 0 var(--space-3);gap:2px}.ed-top .logo{margin-right:var(--space-1)}.ed-top .desk-only{display:none}.ed-top .btn-primary{height:36px;padding:0 .8rem}.canvas-scroll{padding:var(--space-3)}.canvas-hud{right:var(--space-2);bottom:var(--space-2)}.hud-pos,.hud-pos.on{display:none}.canvas-rotate{display:flex;left:var(--space-2);right:auto;padding:0 2px}.canvas-rotate .hud-btn{width:40px;height:30px}.canvas-rotate .hud-btn svg{width:18px;height:18px}.ed-side{flex-direction:row;align-items:center;gap:var(--space-2);overflow:visible;border-left:none;border-top:1px solid var(--border);padding:var(--space-2) var(--space-2) var(--space-2) var(--space-3);position:relative;z-index:45}.side-section{padding:0;border:none}.color-hint,.hex-field,.side-color .side-head,.side-preview{display:none}.color-pair{width:50px;height:46px}.color-primary{width:34px;height:34px}.color-secondary{width:26px;height:26px}.color-swap{width:16px;height:16px}.side-palette{flex:1;min-width:0;display:flex;align-items:center;gap:var(--space-2)}.side-palette .side-head{order:2;margin:0}.side-palette .side-count,.side-palette .side-head h2,.side-palette .side-link .btn-label{display:none}.side-palette .side-link{width:40px;height:44px;justify-content:center;padding:0;border:1px solid var(--border);border-radius:var(--radius-md);color:var(--muted)}.side-palette .side-link svg{width:18px;height:18px}.palette-grid{flex:1;min-width:0;grid-template-columns:none;grid-template-rows:repeat(2,20px);grid-auto-flow:column;grid-auto-columns:20px;gap:4px;overflow-x:auto;overflow-y:hidden;padding:2px;scrollbar-width:none}.palette-grid::-webkit-scrollbar{height:0}.swatch{width:20px;height:20px}.palette-grid .swatch{grid-row:var(--strip-row);grid-column:var(--strip-col)}.ed-tools{flex-direction:row;justify-content:space-between;gap:0;padding:4px 4px calc(4px + env(safe-area-inset-bottom,0px));border-right:none;border-top:1px solid var(--border);overflow:visible;position:relative;z-index:45}.ed-tools .tool-desk,.ed-tools .tool-sep{display:none}.tool-mobile{display:flex}.tool-btn{position:relative;flex:1 1 0;width:auto;min-width:0;height:52px;font-size:.6875rem}.tool-btn svg{width:22px;height:22px}.ed-side .side-layers{position:fixed;left:var(--space-2);right:var(--space-2);bottom:calc(var(--dock-h,132px) + var(--space-2));z-index:50;display:none;padding:var(--space-3);background:var(--panel);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-pop)}.ed-side .side-layers.open{display:block}.side-layers .side-head h2{font-size:.9375rem}.pe-close-btn.sheet-close{display:inline-flex;margin-left:var(--space-1)}.layer-list{max-height:38vh}.layer-row{height:44px}.layer-act{height:40px}.frames-bar{position:fixed;left:var(--space-2);right:var(--space-2);bottom:calc(var(--dock-h,132px) + var(--space-2));z-index:50;display:none;flex-wrap:wrap;gap:var(--space-3);padding:var(--space-3);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-pop)}.frames-bar.open{display:flex}.sheet-head{display:flex;align-items:center;justify-content:space-between;width:100%}.sheet-title{font-size:.9375rem;font-weight:600}.frames-strip{order:2;flex:1 1 100%;padding:4px 2px}.frames-controls{order:3}.frames-actions{order:4;margin-left:auto;border-left:none;padding-left:0}.frame-info{display:none}.fps-control,.frame-ctrl-btn{height:40px}.frame-ctrl-btn{min-width:40px}#playBtn{width:44px}.frame-ctrl-btn .btn-label{display:none}.frame-thumb-wrap{width:60px;height:60px}.frame-add{height:62px;width:44px}.msheet{position:fixed;left:var(--space-2);right:var(--space-2);bottom:calc(var(--dock-h,132px) + var(--space-2));z-index:50;padding:var(--space-3);background:var(--panel);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-pop)}.msheet.open{display:block}.msheet .sheet-head{margin-bottom:var(--space-3)}.msheet-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-2)}.msheet-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:72px;padding:var(--space-2);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--panel);color:var(--text);font-size:.8125rem;font-weight:500;text-align:center;text-decoration:none}.msheet-item svg{width:22px;height:22px;color:var(--muted)}.msheet-item:active{background:var(--surface)}.msheet-item small{display:block;margin-top:2px;font-family:var(--font-mono);font-size:.6875rem;color:var(--faint);font-weight:400}.msheet-item.danger,.msheet-item.danger svg{color:var(--danger)}.msheet-item.active{border-color:var(--accent);background:var(--accent-soft);color:var(--accent)}.msheet-item.active svg{color:var(--accent)}.more-grid,.tools-grid{grid-template-columns:repeat(4,1fr)}.more-grid .msheet-item{min-height:64px;font-size:.75rem}.msheet-backdrop{position:fixed;inset:0;z-index:40;background:rgba(24,22,18,.22)}.msheet-backdrop.open{display:block}.tool-mobile.tab-open{background:var(--surface);color:var(--text);border-color:var(--border-hi)}#toolsTab.active.tab-open{background:var(--accent-soft);color:var(--accent);border-color:var(--accent)}.modal-panel{top:42%}}@media (max-width:380px){.ed-top .logo-text{display:none}}@media (max-width:350px){.hud-dims{display:none}}@media (max-width:820px) and (max-height:520px){.tool-btn{height:44px}.tool-btn .tool-label{display:none}body.editor{grid-template-rows:46px 38px minmax(0,1fr) auto auto}.color-pair{width:44px;height:38px}.color-primary{width:28px;height:28px}.color-secondary{width:22px;height:22px}.side-palette .side-link{height:36px}.palette-grid{grid-template-rows:repeat(2,16px);grid-auto-columns:16px}.swatch{width:16px;height:16px}}