.editor-shell{--ui-accent: #d4d9e3;--ui-accent-soft: rgb(255 255 255 / 20%);--ui-accent-strong: rgb(255 255 255 / 46%);--ui-danger: #bf7f85;--text-primary: #edf0f4;--text-muted: #a7adba;--text-subtle: #8b92a0;--text-highlight: #d8dde7;--border: rgb(255 255 255 / 12%);--border-soft: rgb(255 255 255 / 8%);min-height:100vh;height:100vh;max-height:100vh;overflow:hidden;display:flex;flex-direction:column;gap:.75rem;padding:1.55rem;color:var(--text-primary);background:radial-gradient(circle at 22% -20%,rgb(255 255 255 / 6%) 0%,transparent 42%),radial-gradient(circle at 82% 120%,rgb(255 255 255 / 4%) 0%,transparent 40%),linear-gradient(180deg,#080a0f,#0a0d14)}.editor-shell:before{content:"";position:fixed;inset:0;pointer-events:none;background:linear-gradient(180deg,#ffffff0d 0,#fff0 14%)}.editor-topbar{position:relative;z-index:2;margin:0;padding:.35rem .1rem .6rem;border:none;border-radius:0;background:transparent;backdrop-filter:none;box-shadow:none;display:flex;justify-content:flex-start;align-items:center;gap:0}.editor-title{margin:0;font-size:1.05rem;letter-spacing:-.02em;font-weight:600;color:var(--text-primary)}.hidden-file-input{display:none}.editor-viewport-wrap{--preview-drawer-width: 0px;display:flex;flex-direction:row;gap:.6rem;width:100%;min-height:0;flex:1;overflow:hidden;align-items:stretch;position:relative;z-index:1}.editor-viewport-wrap .viewport-panel{flex:1 1 auto;display:flex;flex-direction:column;min-height:0;min-width:0}.editor-viewport-wrap.drawer-open{--preview-drawer-width: clamp(260px, 30vw, 360px)}.panel{border:1px solid var(--border);border-radius:1rem;background:linear-gradient(180deg,#121723d1,#0c101bd1);backdrop-filter:blur(10px);box-shadow:0 18px 36px #00000057,inset 0 1px #ffffff1a,inset 0 -12px 24px #0003;padding:1.25rem;overflow:hidden}.panel h2{margin:0 0 .78rem;font-size:clamp(1.05rem,2vw,1.2rem);letter-spacing:-.015em}.toolbar-group{display:flex;flex-direction:column;gap:.72rem}.toolbar-group h3{margin:0;font-size:.78rem;font-weight:600;letter-spacing:.02em;color:var(--text-muted);text-transform:none}.toolbar-group label{display:block;margin-bottom:.8rem}.toolbar-group label span{display:block;margin-bottom:.3rem;color:var(--text-highlight);font-size:.84rem}.export-menu-wrapper{position:absolute;top:.85rem;right:.85rem;z-index:3;display:inline-flex;flex-direction:column;align-items:flex-end;gap:.45rem}.editor-viewport-wrap .export-menu-wrapper{position:absolute}.export-menu-wrapper .export-tooltip{right:0;left:auto;top:calc(100% + .5rem);position:absolute}.export-tooltip{width:250px;min-width:220px;display:grid;gap:.56rem;padding:.72rem;border-radius:.86rem;border:1px solid var(--border);background:linear-gradient(140deg,#ffffff12,#ffffff05),#090e16d4;backdrop-filter:blur(12px);box-shadow:0 14px 38px #00000059,inset 0 1px #ffffff14;z-index:5;animation:fadeIn .14s ease;position:absolute}.export-tooltip label{margin-bottom:.32rem}.export-tooltip label span{margin-bottom:.16rem;font-size:.74rem}.export-all-option{display:inline-flex;align-items:center;gap:.45rem;margin-bottom:.08rem;user-select:none}.export-all-option span{font-size:.74rem;margin-bottom:0;color:var(--text-muted)}.export-tooltip select,.export-tooltip input{width:100%}@keyframes fadeIn{0%{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:translateY(0)}}.palette-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,190px));gap:.62rem;width:100%;justify-content:center;align-items:start}.helper{color:var(--text-subtle);font-size:.86rem}.palette-entry{display:flex;flex-direction:column;justify-content:flex-start;gap:.34rem;align-items:stretch;width:100%;padding:.42rem .44rem;border-radius:.72rem;border:1px solid var(--border-soft);background:linear-gradient(180deg,#ffffff0d,#ffffff05)}.palette-entry label{margin-bottom:0;display:flex;justify-content:space-between;gap:.42rem;align-items:center;min-width:0;width:100%}.palette-label{min-width:1.9rem;height:1.2rem;display:inline-grid;place-items:center;padding:.16rem .38rem;border-radius:999px;border:1px solid var(--border-soft);background:#ffffff12;font-size:.69rem;color:var(--text-muted);text-align:center}.palette-entry input[type=color]{width:48px;height:28px;border:none;border-radius:.68rem;padding:0;cursor:pointer;box-shadow:0 0 0 1px var(--border-soft)}.palette-actions{display:flex;justify-content:flex-end;gap:.32rem;width:100%}.inline-actions{display:flex;justify-content:center;gap:.5rem;align-items:center;margin-top:.22rem;flex-wrap:wrap}.inline-actions .helper{color:var(--text-subtle)}.compare-toggle{display:inline-flex;padding:.18rem;border-radius:.7rem;border:1px solid var(--border-soft);background:#ffffff08;gap:.28rem}.compare-toggle .toolbar-action{min-width:5.1rem}.compare-toggle .toolbar-action.active{background:#ffffff29;border-color:var(--ui-accent-strong);box-shadow:inset 0 0 0 1px #ffffff1f}button{border:1px solid var(--border-soft);border-radius:.6rem;padding:.52rem .92rem;color:var(--text-primary);background:#ffffff0f;cursor:pointer;transition:transform .13s ease,border-color .13s ease,box-shadow .13s ease,background .13s ease}button:hover:not(:disabled){border-color:var(--ui-accent-soft);background:#ffffff1c;box-shadow:0 8px 20px var(--ui-accent-soft);transform:translateY(-1px)}button.inline{padding:.42rem .62rem}button.toolbar-action{height:2rem;padding:.36rem .72rem;font-size:.78rem;border-radius:.62rem}button.danger{border-color:var(--ui-danger);color:var(--ui-danger)}button.primary{border-color:var(--ui-accent-strong);background:#ffffff1f;box-shadow:0 12px 24px #00000047}button.subtle{background:#ffffff08;border-color:var(--border-soft)}button:active:not(:disabled){transform:translateY(1px)}button:disabled{opacity:.45;cursor:not-allowed;box-shadow:none;transform:none}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--ui-accent-strong);outline-offset:1px}input[type=range]{width:100%;appearance:none;height:.48rem;border-radius:999px;background:#ffffff1f;margin-top:.28rem}input[type=range]::-webkit-slider-thumb{appearance:none;width:16px;height:16px;border-radius:999px;border:0;background:radial-gradient(circle,#edf2ff 0 60%,var(--ui-accent) 100%);box-shadow:0 0 0 2px #090e18bf}input[type=number],select{width:100%;border:1px solid var(--border-soft);border-radius:.58rem;background:#ffffff14;color:var(--text-primary);padding:.46rem .62rem}input[type=number]{appearance:textfield}.viewport-panel{display:flex;flex-direction:column;min-height:0}.editor-toolbar{flex:0 0 auto;max-height:clamp(180px,24vh,260px);overflow:visible;margin-top:0;padding:.84rem .9rem;position:relative;z-index:8;border-radius:.9rem}.toolbar-groups{display:grid;grid-template-columns:minmax(0,1fr);width:100%;max-width:1160px;margin:0 auto}.editor-toolbar .toolbar-group{display:flex;flex-direction:column;gap:.42rem}.editor-toolbar .toolbar-group h3{margin-bottom:0;font-size:.76rem}.editor-toolbar .toolbar-group label{margin-bottom:.45rem}.editor-toolbar .toolbar-group label span{margin-bottom:.2rem;font-size:.78rem}.editor-toolbar .palette-entry label{margin-bottom:0}.editor-toolbar .palette-entry .palette-label{margin-bottom:0;font-size:.7rem;display:inline-grid;place-items:center}.viewport{position:relative;border-radius:.84rem;flex:1;min-height:0;overflow:hidden;cursor:pointer;background:radial-gradient(circle at 35% 20%,rgb(255 255 255 / 4%),transparent 42%),linear-gradient(180deg,#0a0f18,#090d15);display:flex;align-items:center;justify-content:center;padding:.72rem}.viewport canvas{display:block;width:100%;height:100%;object-fit:contain;max-width:100%;max-height:100%;border-radius:.72rem;box-shadow:0 0 0 1px #ffffff14,0 12px 30px #00000059;background:#0c1118}.editor-viewport-wrap .viewport-panel{min-height:0}.viewport.dragActive{border:1px solid var(--ui-accent-soft);box-shadow:0 0 0 1px #ffffff24,inset 0 0 0 1px #7a8dff3d}.viewport-overlay{position:absolute;inset:.72rem;border-radius:.72rem;border:1px dashed rgb(255 255 255 / 18%);display:grid;justify-items:center;align-content:center;gap:.25rem;text-align:center;color:var(--text-highlight);background:#070c1485;backdrop-filter:blur(4px);z-index:2;pointer-events:none;transition:opacity .2s ease,transform .22s ease;opacity:1}.viewport-overlay.drag{color:#e8f0ff;border-color:#7a8dff75;background:#7a8dff24}.viewport-export-icon{width:2rem;height:2rem;border-radius:999px;border:1px solid var(--border);background:#ffffff24;padding:0;color:#f4f7ff;font-size:1rem;display:grid;place-items:center;line-height:1;box-shadow:0 10px 24px #05080f7a}.viewport-export-icon:hover{transform:translateY(-1px);box-shadow:0 12px 28px #7a8dff40}.viewport-overlay p{margin:0;line-height:1.25;font-size:.95rem;text-wrap:balance}.viewport-error{position:absolute;left:.9rem;bottom:.9rem;margin:0;padding:.42rem .6rem;border-radius:.55rem;border:1px solid rgb(197 109 109 / 55%);background:#17080bd1;color:#f0c4c4;font-size:.78rem;max-width:min(65ch,calc(100% - 2rem));line-height:1.25}.permutations-panel .helper{margin-top:0}.permutations-header{display:flex;align-items:center;justify-content:space-between;gap:.5rem}.permutations-count{padding:.2rem .5rem;border-radius:999px;border:1px solid var(--border-soft);background:#ffffff1a;color:#d9e2ff;font-size:.72rem;letter-spacing:.03em}.permutation-progress{margin-bottom:.52rem;color:var(--text-muted)}.permutations-panel{display:flex;flex-direction:column;min-height:0;overflow:hidden;margin-top:0;width:0;min-width:0;flex:0 0 0px;max-height:none;opacity:0;pointer-events:none;transform:translate(10px);padding:0;border:0;box-shadow:none;background:transparent;transition:opacity .22s ease,transform .26s ease,padding .26s ease,width .28s ease,flex-basis .28s ease}.advanced-trigger-wrap{position:relative;display:flex;align-items:flex-start;justify-content:flex-start}.advanced-trigger{border-radius:.62rem;background:linear-gradient(180deg,#ffffff14,#ffffff08)}.advanced-panel{position:absolute;right:0;left:auto;bottom:calc(100% + .56rem);width:min(360px,calc(100vw - 2.5rem));padding:.72rem;border-radius:.9rem;border:1px solid var(--border);background:linear-gradient(140deg,#ffffff12,#ffffff05),#090e16e0;backdrop-filter:blur(14px);box-shadow:0 16px 42px #0000006b,inset 0 1px #ffffff14;display:grid;gap:.44rem;z-index:24;animation:fadeIn .15s ease}.advanced-panel label{margin-bottom:.34rem}.advanced-panel label span{margin-bottom:.18rem;font-size:.74rem}.permutations-panel.open{width:var(--preview-drawer-width);flex-basis:var(--preview-drawer-width);opacity:1;pointer-events:auto;transform:translate(0);padding:1.1rem;border:1px solid var(--border);background:linear-gradient(180deg,#121723d1,#0c101bd1);box-shadow:0 18px 36px #00000057,inset 0 1px #ffffff1a,inset 0 -12px 24px #0003;min-height:0}.permutation-grid{min-height:0;overflow-y:auto;overflow-x:hidden;display:grid;gap:.7rem;grid-template-columns:repeat(1,minmax(0,1fr));align-content:flex-start;padding:.1rem .2rem 0 0;max-height:100%;transition:max-height .3s ease}.permutations-panel.open .permutation-grid{max-height:100%}.perm-card{border-radius:.88rem;border:1px solid var(--border-soft);padding:.46rem;text-align:left;background:linear-gradient(180deg,#ffffff14,#ffffff0a);display:flex;flex-direction:column;gap:.48rem;color:#e3edf7;cursor:pointer;transition:transform .13s ease,border-color .13s ease,box-shadow .13s ease}.perm-card:hover{border-color:var(--ui-accent-soft);box-shadow:0 10px 22px #0000004d;transform:translateY(-2px)}.perm-card.selected{border-color:var(--ui-accent);box-shadow:inset 0 0 0 1px var(--ui-accent-soft)}.perm-card img{aspect-ratio:5 / 4;width:100%;border-radius:.68rem;object-fit:contain;border:1px solid rgb(255 255 255 / 18%);background:#090f18}.perm-fallback{aspect-ratio:5 / 4;width:100%;border-radius:.68rem;border:1px dashed rgb(255 255 255 / 18%);display:grid;place-items:center;color:#9bb0c7;font-size:.8rem;text-align:center;padding:.44rem;background:linear-gradient(115deg,#ffffff08,#ffffff1f 45%,#ffffff08);background-size:220% 100%;animation:permPulse 1.2s linear infinite}.perm-swatches{display:flex;gap:.36rem}.perm-swatches span{width:.86rem;height:.86rem;border-radius:999px;border:1px solid rgb(255 255 255 / 28%);box-shadow:inset 0 0 0 1px #0a0d148c}@keyframes permPulse{0%{background-position:200% 0}to{background-position:-20% 0}}@media (max-width: 1320px){.toolbar-groups{grid-template-columns:minmax(0,1fr)}}@media (max-width: 1200px){.editor-shell{padding:1.2rem}.permutation-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.editor-toolbar{max-height:clamp(170px,23vh,230px)}}@media (max-width: 900px){.editor-shell{padding:1rem}.permutation-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.toolbar-groups{grid-template-columns:minmax(0,1fr)}.palette-grid{grid-template-columns:repeat(2,minmax(0,1fr));justify-content:stretch}.advanced-panel{width:min(340px,70vw)}}@media (max-width: 680px){.editor-topbar{flex-direction:column;gap:.95rem}.editor-toolbar{max-height:clamp(160px,26vh,230px)}.toolbar-groups,.palette-grid{grid-template-columns:1fr}.permutation-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.viewport-overlay p{font-size:.85rem}}@media (max-height: 820px){.editor-shell{gap:.65rem}.editor-topbar{padding:.85rem 1rem}.editor-title{font-size:1.2rem}.editor-toolbar{max-height:clamp(150px,24vh,200px)}}@media (min-width: 901px){.editor-toolbar{max-height:none;overflow:visible}}:root{font-family:Space Grotesk,Manrope,Avenir Next,sans-serif;color:#d9e3f2;background:#090b14}*{box-sizing:border-box}body{margin:0;min-height:100vh}button,input,select{font:inherit}
