:root{--bg:#111214;--panel:#1c1d21;--panel2:#26272c;--line:#34363c;--text:#ececf0;--muted:#9a9ca6;--accent:#f6a93b;--accent2:#4ac7c0;--danger:#ff6b6b;--radius:12px;--safe-t:env(safe-area-inset-top,0px);--safe-l:env(safe-area-inset-left,0px);--safe-r:env(safe-area-inset-right,0px);--safe-b:env(safe-area-inset-bottom,0px)}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;overscroll-behavior:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;font:15px/1.4 system-ui,-apple-system,Segoe UI,Roboto,sans-serif}button{font:inherit;color:inherit;cursor:pointer;background:0 0;border:0;padding:0}button:disabled{opacity:.4;cursor:default}input,select{font:inherit;color:inherit;background:var(--panel2);border:1px solid var(--line);border-radius:8px;min-height:36px;padding:7px 10px}input[type=color]{width:44px;height:36px;padding:2px}input[type=number]{width:110px}.muted{color:var(--muted)}.hint{color:var(--muted);margin:6px 0 0;font-size:.85rem}.link{color:var(--accent2);font-weight:600}.danger{color:var(--danger)}.checker{background-color:#bbb;background-image:linear-gradient(45deg,#999 25%,#0000 25% 75%,#999 75%),linear-gradient(45deg,#999 25%,#0000 25% 75%,#999 75%);background-position:0 0,6px 6px;background-size:12px 12px}.studio{background:#1c1c1f;position:fixed;inset:0;overflow:hidden}.studio .gl{touch-action:none;cursor:crosshair;width:100%;height:100%;display:block;position:absolute;inset:0}.brush-cursor{pointer-events:none;border:1px solid #ffffffe6;border-radius:50%;display:none;position:absolute;top:0;left:0;box-shadow:0 0 0 1px #0009}.pick-ring{pointer-events:none;color:#fff;border:4px solid #fff;border-radius:50%;place-items:center;width:72px;height:72px;font-size:24px;display:grid;position:absolute;top:0;left:0;box-shadow:0 2px 10px #0009}.topbar{padding:calc(8px + var(--safe-t)) calc(8px + var(--safe-r)) 8px calc(8px + var(--safe-l));pointer-events:none;justify-content:space-between;align-items:center;display:flex;position:absolute;top:0;left:0;right:0}.topbar .group{pointer-events:auto;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid var(--line);background:#1c1d21db;border-radius:14px;gap:4px;padding:4px;display:flex}.tb{min-width:40px;height:40px;color:var(--text);border-radius:10px;align-items:center;gap:6px;padding:0 8px;display:inline-flex}.tb span{font-size:.9rem;font-weight:600}.tb.on{background:var(--panel2);color:var(--accent)}.tb.on.open{outline:2px solid var(--accent)}.tb.color .swatch{border:2px solid #fff;border-radius:50%;width:26px;height:26px;box-shadow:0 0 0 1px #000}.hint-inline{color:var(--muted);padding:0 8px;font-size:.8rem}@media (width<=640px){.hint-inline,.tb span{display:none}}.sidebar{left:calc(6px + var(--safe-l));-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid var(--line);background:#1c1d21db;border-radius:16px;flex-direction:column;align-items:center;gap:10px;padding:10px 6px;display:flex;position:absolute;top:50%;transform:translateY(-50%)}.sidebar .slider.v{height:150px}.modify{background:var(--panel2);width:36px;height:36px;color:var(--text);border-radius:9px;place-items:center;display:grid}.modify.on{background:var(--accent);color:#000}.hist{flex-direction:column;gap:2px;display:flex}.icon-btn{width:40px;height:40px;color:var(--text);border-radius:10px;place-items:center;display:inline-grid}.icon-btn:hover{background:var(--panel2)}.show-ui{left:calc(8px + var(--safe-l));top:calc(8px + var(--safe-t));width:40px;height:40px;color:var(--muted);background:#1c1d2199;border-radius:10px;place-items:center;display:grid;position:absolute}.ui-hidden .topbar,.ui-hidden .sidebar,.ui-hidden .popover{display:none}.slider{touch-action:none;cursor:pointer;position:relative}.slider.v{width:36px}.slider.h{width:100%;height:36px}.slider .track{background:#3b3d44;border-radius:4px;position:absolute}.slider.v .track{width:8px;top:0;bottom:0;left:14px}.slider.h .track{height:8px;top:14px;left:0;right:0}.slider .fill{background:var(--accent);border-radius:4px;position:absolute}.slider.v .fill{width:8px;bottom:0;left:14px}.slider.h .fill{height:8px;top:14px;left:0}.slider .knob{background:#fff;border-radius:50%;width:22px;height:22px;position:absolute;box-shadow:0 1px 4px #00000080}.slider.v .knob{left:7px;transform:translateY(50%)}.slider.h .knob{top:7px;transform:translate(-50%)}.slider .val{background:var(--panel);border:1px solid var(--line);white-space:nowrap;border-radius:8px;padding:4px 8px;font-size:.85rem;position:absolute;top:50%;left:44px;transform:translateY(-50%)}.slider.h .val{top:-34px;left:50%;transform:translate(-50%)}.popover{top:calc(58px + var(--safe-t));width:320px;max-width:calc(100vw - 16px);max-height:calc(100% - 70px - var(--safe-t) - var(--safe-b));background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);z-index:5;flex-direction:column;display:flex;position:absolute;overflow:hidden;box-shadow:0 10px 40px #00000080}.popover.right{right:calc(8px + var(--safe-r))}.popover.left{left:calc(8px + var(--safe-l))}.popover.wide{width:420px}.pop-head{border-bottom:1px solid var(--line);justify-content:space-between;align-items:center;padding:8px 8px 8px 14px;font-weight:700;display:flex}.pop-sub{border-bottom:1px solid var(--line);align-items:center;gap:10px;padding:8px 10px;display:flex}.pop-sub b{flex:1}.pop-body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}@media (width<=520px){.popover,.popover.wide{width:auto;left:8px;right:8px}}.toast{bottom:calc(24px + var(--safe-b));border:1px solid var(--line);z-index:9;pointer-events:none;text-align:center;background:#1c1d21f2;border-radius:999px;max-width:90vw;padding:10px 16px;position:absolute;left:50%;transform:translate(-50%)}.overlay{text-align:center;z-index:20;background:#111214e6;place-content:center;gap:12px;padding:24px;display:grid;position:absolute;inset:0}.overlay.static{position:fixed}.overlay button,.modal-actions button,.gallery header button{background:var(--panel2);border-radius:999px;padding:10px 18px;font-weight:600}.primary{align-items:center;gap:4px;display:inline-flex;background:var(--accent)!important;color:#000!important}.loading{color:var(--muted);place-items:center;display:grid;position:absolute;inset:0}.brush-panel{min-height:300px;display:flex}.groups{border-right:1px solid var(--line);flex-direction:column;gap:2px;width:120px;padding:6px;display:flex}.groups button{text-align:left;color:var(--muted);border-radius:8px;padding:10px;font-weight:600}.groups button.on{background:var(--panel2);color:var(--text)}.brushes{flex-direction:column;flex:1;gap:4px;padding:6px;display:flex}.brush-item{background:#141518;border:2px solid #0000;border-radius:10px;flex-direction:column;padding:6px;display:flex}.brush-item img{object-fit:cover;border-radius:6px;width:100%;height:48px}.brush-item span{text-align:left;margin-top:4px;font-size:.85rem}.brush-item em{color:var(--accent)}.brush-item.on{border-color:var(--accent)}.brush-edit{padding:10px 14px}.brush-edit .pop-sub{padding:0 0 8px}.brush-big{object-fit:cover;background:#141518;border-radius:8px;width:100%;height:72px;margin-bottom:8px}.field{margin:6px 0}.field-head{color:var(--muted);justify-content:space-between;font-size:.85rem;display:flex}.num{font-variant-numeric:tabular-nums}.seg{gap:4px;display:flex}.seg button{background:var(--panel2);border-radius:8px;flex:1;padding:8px}.seg button.on{background:var(--accent);color:#000;font-weight:700}.check{align-items:center;gap:8px;padding:8px 0;display:flex}.layer-props{border-bottom:1px solid var(--line);align-items:center;gap:8px;padding:8px 10px;display:flex}.layer-props select{flex:1;min-width:0}.layer-props .op{flex:1;align-items:center;gap:6px;display:flex}.layer-props .op .num{text-align:right;width:40px;font-size:.85rem}.layer-list{padding:6px}.layer-row{border-radius:10px;align-items:center;gap:8px;min-height:56px;padding:4px 6px;display:flex;position:relative}.layer-row.on{background:var(--panel2);outline:2px solid var(--accent)}.layer-row.clip{margin-left:18px}.layer-row.clip:before{content:"↳";color:var(--muted);position:absolute;left:-16px}.layer-row .thumb{border-radius:6px;flex:none;place-items:center;width:56px;height:44px;display:grid;overflow:hidden}.layer-row .thumb img{max-width:100%;max-height:100%}.layer-row .name{cursor:pointer;flex:1;min-width:0}.layer-row .name span{white-space:nowrap;text-overflow:ellipsis;display:block;overflow:hidden}.layer-row .name small{color:var(--muted)}.layer-row .name input{width:100%}.layer-row.bg{border-top:1px solid var(--line);border-radius:0;margin-top:4px}.layer-menu{z-index:3;background:var(--panel);border:1px solid var(--line);border-radius:10px;flex-direction:column;min-width:220px;padding:4px;display:flex;position:absolute;top:52px;right:8px;box-shadow:0 8px 30px #00000080}.layer-menu button{text-align:left;border-radius:8px;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;display:flex}.layer-menu button:hover{background:var(--panel2)}.toggle{background:#3b3d44;border-radius:12px;flex:none;width:40px;height:24px;position:relative}.toggle span{background:#fff;border-radius:50%;width:18px;height:18px;transition:left .15s;position:absolute;top:3px;left:3px}.toggle.on{background:var(--accent)}.toggle.on span{left:19px}.color-panel{padding:12px}.sv{touch-action:none;cursor:crosshair;border-radius:8px;height:160px;position:relative;overflow:hidden}.sv canvas{width:100%;height:100%;display:block}.sv .dot,.hue .dot{pointer-events:none;border:2px solid #fff;border-radius:50%;width:18px;height:18px;position:absolute;transform:translate(-50%,-50%);box-shadow:0 0 0 1px #000}.hue{touch-action:none;cursor:crosshair;background:linear-gradient(90deg,red,#ff0,#0f0,#0ff,#00f,#f0f,red);border-radius:6px;height:24px;margin:12px 0;position:relative}.hue .dot{top:50%}.color-row{align-items:center;gap:8px;display:flex}.swatch{border:1px solid #fff3;border-radius:8px;flex:none;width:32px;height:32px}.swatch.big{width:44px;height:36px}.swatch.on{outline:2px solid var(--accent);outline-offset:1px}.hex{flex:1;font-family:ui-monospace,monospace}.label{color:var(--muted);margin:12px 0 6px;font-size:.85rem}.swatches{grid-template-columns:repeat(8,1fr);gap:6px;display:grid}.swatches .swatch{aspect-ratio:1;width:100%;height:auto}.tabs{border-bottom:1px solid var(--line);display:flex;overflow-x:auto}.tabs button{color:var(--muted);white-space:nowrap;padding:10px 12px;font-weight:600}.tabs button.on{color:var(--text);box-shadow:inset 0 -2px var(--accent)}.list{flex-direction:column;gap:6px;padding:10px;display:flex}.list>button{text-align:left;background:var(--panel2);border-radius:10px;padding:12px 14px;font-weight:600}.list .info{color:var(--muted);flex-direction:column;gap:4px;padding:6px 2px;font-size:.85rem;display:flex}.row{justify-content:space-between;align-items:center;gap:10px;padding:4px 2px;display:flex}.row>span{color:var(--muted)}.row select,.row input{max-width:60%}.help ul{color:var(--muted);margin:2px 0 10px;padding-left:18px}.help b{margin-top:6px}.modal-bg{z-index:30;background:#0009;place-items:center;padding:12px;display:grid;position:fixed;inset:0}.modal{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);flex-direction:column;width:520px;max-width:100%;max-height:calc(100dvh - 24px);display:flex}.modal .pop-body,.popover .pop-body{min-height:0}.modal .pop-body{padding:12px}.presets{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:6px;margin-bottom:12px;display:grid}.presets button{background:var(--panel2);border:2px solid #0000;border-radius:10px;flex-direction:column;align-items:flex-start;padding:10px;display:flex}.presets button small{color:var(--muted)}.presets button.on{border-color:var(--accent)}.form{flex-direction:column;gap:4px;display:flex}.modal-actions{border-top:1px solid var(--line);justify-content:flex-end;gap:8px;padding:12px;display:flex}.gallery{min-height:100%;padding:calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(16px + var(--safe-b)) calc(16px + var(--safe-l));max-width:1200px;margin:0 auto}.gallery header{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px;display:flex}.gallery h1{letter-spacing:-.02em;margin:0;font-size:1.5rem;font-weight:500}.gallery h1 b{color:var(--accent)}.gallery .actions{align-items:center;gap:8px;display:flex}.gallery .grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:14px;display:grid}.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);position:relative;overflow:hidden}.card .art{aspect-ratio:4/3;place-items:center;width:100%;display:grid;overflow:hidden}.card .art img{max-width:100%;max-height:100%}.card .blank{background:#fff;width:100%;height:100%}.card .meta{grid-template-rows:auto auto;grid-template-columns:1fr auto;align-items:center;padding:8px 4px 8px 10px;display:grid}.card .meta .name{white-space:nowrap;text-overflow:ellipsis;font-weight:600;overflow:hidden}.card .meta .muted{grid-row:2;font-size:.8rem}.card .meta .icon-btn{grid-row:1/span 2}.card-menu{background:var(--panel2);border:1px solid var(--line);z-index:2;border-radius:10px;flex-direction:column;min-width:160px;display:flex;position:absolute;bottom:50px;right:8px;box-shadow:0 8px 30px #00000080}.card-menu button{text-align:left;padding:10px 14px}.empty{text-align:center;max-width:480px;margin:0 auto;padding:60px 16px}.gallery footer{text-align:center;margin-top:40px;font-size:.85rem}
