@font-face{font-family:Exqt;src:url('assets/exqt.ttf') format('truetype');font-display:swap}
:root{--ink:#44394d;--muted:#887f8f;--line:#c8bdcd;--cream:#fffdf4;--purple:#e5daf6;--coral:#f78069;--shadow:#d7cbdd}
*{box-sizing:border-box}body{margin:0;background:#f6f3ed;color:var(--ink);font:16px/1.5 Exqt,monospace}button,input,output{font:inherit;color:inherit}button,a,input,label{ -webkit-tap-highlight-color:transparent}button{cursor:pointer;border:1px solid var(--line);background:#fffdf8;padding:9px 10px;box-shadow:0 2px 0 #ded5df}button:hover{background:#f1eafa}button:active{box-shadow:none;translate:0 2px}button:focus-visible,input:focus-visible,canvas:focus-visible,a:focus-visible{outline:3px solid #8466b6;outline-offset:3px}button:disabled{opacity:.45;cursor:default}input[type=range]{width:100%;accent-color:#8f72af;cursor:pointer;height:20px;margin:0 0 13px}input[type=text]{width:100%;background:#fffef9;border:1px solid var(--line);padding:9px 11px;outline-offset:2px}input[type=file]{position:absolute;width:1px;height:1px;opacity:0}.topbar{height:92px;padding:0 36px;border-bottom:2px solid var(--ink);display:flex;align-items:center;justify-content:space-between;background:var(--cream);gap:24px}.brand{display:flex;align-items:center;gap:12px;color:var(--ink);text-decoration:none;font-size:30px;line-height:1.15}.brand small{display:block;font-size:11px;letter-spacing:2px;margin-top:6px}.pixel-flower{background:var(--coral);font-size:34px;line-height:48px;width:48px;text-align:center;color:var(--cream);clip-path:polygon(12% 0,88% 0,88% 12%,100% 12%,100% 88%,88% 88%,88% 100%,12% 100%,12% 88%,0 88%,0 12%,12% 12%)}.top-note{font-size:14px;color:#756a7f}.badge{border:1px solid var(--line);font-size:12px;padding:6px 10px}.badge span{color:#977ba9;margin-left:10px}.workspace{display:grid;grid-template-columns:264px minmax(350px,1fr) 264px;max-width:1440px;margin:0 auto;padding:28px 28px 20px;align-items:start;gap:24px}.panel{border:1px solid #a99aaf;background:var(--cream);box-shadow:3px 3px 0 var(--shadow)}.panel-title{display:flex;justify-content:space-between;background:#eee7f5;border-bottom:1px solid #a99aaf;font-size:14px;padding:10px 14px}.panel-content{padding:18px}.upload{position:relative;display:flex;flex-direction:column;text-align:center;align-items:center;border:1px dashed #a493b5;background:#f5effa;padding:16px 5px;cursor:pointer}.upload:hover,.upload.drag-over{background:#e8dcf5;outline:2px dashed #9779b2}.upload:focus-within{outline:3px solid #8466b6}.upload-icon{font-size:27px;color:#8e6fa7;line-height:1.4}.upload strong{font-weight:normal;font-size:16px;margin:6px 0}.upload span:not(.upload-icon){font-size:12px}.upload small{font-size:10px;color:var(--muted);margin-top:8px}.section-label{margin:23px 0 10px;display:flex;align-items:center;justify-content:space-between;font-size:14px}.section-label>span{font-size:10px;color:#9785a4;letter-spacing:1px}.materials{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}.material{padding:10px 2px 7px;font-size:13px;display:grid;justify-items:center;gap:7px}.material.active,.segmented .active,.papers .active{background:#e8ddf5;border-color:#8e71a8;box-shadow:0 2px 0 #a68ab9}.swatch{display:block;width:32px;height:32px;color:#b38bca;font-size:26px;line-height:32px}.swatch.paper{color:#e4a38f;filter:drop-shadow(2px 2px 0 #c9beb8)}.swatch.clear{color:#b3c5ce;text-shadow:2px 1px #edf7ff}.swatch.puffy{color:#b291cb;text-shadow:-2px -2px #efe0ff,2px 2px #78558d}.toggle-row{display:flex;align-items:center;gap:8px;padding:16px 0;border-bottom:1px dashed var(--line);cursor:pointer}.toggle-row>span:first-child{flex:1}.toggle-row strong{display:block;font-weight:normal;font-size:13px}.toggle-row small{font-size:11px;color:var(--muted);display:block;margin-top:3px}.toggle-row input{width:1px;height:1px;opacity:0;position:absolute}.switch{width:32px;height:18px;background:#e6dfe8;border:1px solid #b6a8bd;padding:2px}.switch:before{content:'';display:block;width:12px;height:12px;background:#fffdf8;border:1px solid #b6a8bd}.toggle-row input:checked+.switch{background:#a184bf}.toggle-row input:checked+.switch:before{margin-left:12px}.toggle-row input:focus-visible+.switch{outline:3px solid #8466b6}.segmented{display:flex;margin-bottom:15px}.segmented button{flex:1;font-size:12px;padding:8px 3px}.range-label{display:flex;justify-content:space-between;align-items:center;font-size:13px;margin:12px 0 6px}.range-label output{font-size:12px;color:#9678aa}.papers{display:flex;gap:6px}.papers button{flex:1;font-size:11px;padding:7px 2px}.paper-dot{width:13px;height:13px;display:block;border:1px solid #b6a8bd;margin:0 auto 5px}.cream{background:#fff4d5}.lilac{background:#e9ddfa}.mint{background:#dcefe7}.field-label{display:block;font-size:13px;margin:20px 0 8px}.privacy-note{border-top:1px dashed var(--line);padding:12px 18px;font-size:11px;color:var(--muted);line-height:1.8}.desk{min-width:0}.desk-top{display:flex;align-items:center;justify-content:space-between;padding:0 4px 17px;gap:10px}.tiny-label{font-size:10px;letter-spacing:1px;color:#9b839e}h1{font-size:23px;font-weight:normal;margin:4px 0 0}.edition{font-size:10px;color:#99899e;text-align:right;line-height:1.8;white-space:nowrap}.canvas-area{position:relative;min-height:700px;padding:35px 16px 28px;display:flex;justify-content:center;align-items:center;background-color:#e9e2ed;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20'%3E%3Cpath d='M0 0H20V20' fill='none' stroke='%23dcd1e2' stroke-width='1'/%3E%3C/svg%3E");border:1px solid #d5cadc;overflow:hidden}.floating-label{position:absolute;top:13px;left:16px;background:#fffdf7;border:1px solid #d2c1d9;padding:4px 9px;font-size:11px;z-index:1}#sheet{display:block;width:min(100%,350px);height:auto;box-shadow:7px 9px 0 #bcaec64d;touch-action:none;cursor:grab;background:#fffdf4}#sheet:active{cursor:grabbing}.desk-bottom{display:flex;justify-content:space-between;padding:14px 4px;font-size:11px;color:#897791;gap:8px}.status-dot{display:inline-block;width:6px;height:6px;background:#a0b59c;margin-right:7px}.selection-card{display:flex;gap:12px;align-items:center;background:#f3eef6;padding:12px;border:1px solid #e2d8e7;margin-bottom:18px}.selected-preview{width:52px;height:62px;display:grid;place-items:center;background:#fffdf7;border:1px solid #e1d5e7}.selected-preview img{max-width:44px;max-height:54px}.selection-card small{display:block;font-size:10px;color:#9c89a7}.selection-card strong{font-size:14px;font-weight:normal;display:block;max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-top:5px}fieldset{padding:0;margin:0;border:0;min-width:0}.two-buttons{display:flex;gap:8px;margin:9px 0 17px}.two-buttons button{flex:1;font-size:12px}.cutout-section{border-top:1px dashed var(--line);border-bottom:1px dashed var(--line);padding:15px 0 12px}.wide-button{width:100%;font-size:12px}.cutout-section small{display:block;font-size:10px;color:var(--muted);line-height:1.8;margin-top:9px}.text-button{border:0;box-shadow:none;background:transparent;padding:6px 0 0;color:#977aa9;font-size:11px;text-decoration:underline}.sticker-list{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;max-height:152px;overflow-y:auto;padding:2px 2px 4px}.sticker-list button{height:46px;padding:4px;display:grid;place-items:center;box-shadow:none}.sticker-list img{max-width:100%;max-height:35px}.sticker-list button.active{background:#f1e4fa;border:2px solid #9b78b3}.arrange{margin-top:13px;background:#f8f3fc}.finish{border-top:1px solid var(--line);padding:17px 18px;background:#f4edf8}.finish .tiny-label{font-size:9px;letter-spacing:.3px}.finish>button{display:flex;justify-content:space-between;width:100%;background:var(--coral);border:1px solid #bf6054;box-shadow:3px 3px 0 #d5b1b2;margin:9px 0 12px;font-size:15px;padding:12px;color:#472e39}.finish>button:hover{background:#ff9983}.finish>small{font-size:10px;color:var(--muted)}footer{max-width:1384px;margin:0 auto;padding:10px 0 22px;border-top:1px solid #ded5df;display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#9a8d9f}footer b{font-weight:normal;color:#77617e;margin-left:8px}footer button{background:none;border:0;box-shadow:none;font-size:11px;color:#887093}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:var(--ink);color:#fffdf5;padding:12px 20px;font-size:14px;z-index:10;box-shadow:4px 4px #cbbad4;max-width:90vw;opacity:0;pointer-events:none}#toast.show{opacity:1}
@media(min-width:1400px){.workspace{padding-top:36px}.canvas-area{min-height:742px}#sheet{width:370px}}
@media(max-width:1100px){.workspace{grid-template-columns:232px minmax(290px,1fr) 232px;gap:14px;padding:20px 16px}.panel-content{padding:14px}.topbar{padding:0 20px}.top-note{display:none}.canvas-area{min-height:625px;padding:42px 13px 25px}.finish{padding:14px}.finish>button{font-size:13px}.desk-top h1{font-size:20px}.edition{display:none}footer{margin:0 18px}}
@media(max-width:850px){.workspace{grid-template-columns:240px 1fr;gap:18px}.inspector{grid-column:1/-1}.inspector .panel-content{display:grid;grid-template-columns:1fr 1fr;gap:12px 24px}.selection-card{grid-column:1;margin:0}.inspector fieldset{grid-column:2;grid-row:1/5}.inspector .section-label{margin:0}.sticker-list{max-height:130px}.arrange{margin:0}.finish{display:flex;align-items:center;gap:18px}.finish .tiny-label{display:none}.finish>button{max-width:280px;margin:0}.canvas-area{min-height:650px}.topbar{height:80px}.brand{font-size:26px}}
@media(max-width:560px){.topbar{padding:12px 16px;height:76px}.brand{font-size:24px}.brand small{font-size:8px;letter-spacing:1px}.pixel-flower{width:38px;line-height:38px;font-size:28px}.badge{font-size:10px;padding:4px 7px}.badge span{display:none}.workspace{display:flex;flex-direction:column;padding:18px 14px;gap:22px}.desk{order:0;width:100%}.tools{order:1;width:100%}.inspector{order:2;width:100%}.canvas-area{min-height:0;padding:42px 24px 24px}#sheet{width:100%;max-width:330px}.desk-top h1{font-size:22px}.desk-bottom{padding-bottom:0}.tools .panel-content{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}.upload{grid-column:1/-1}.tools .section-label,.tools .materials,.tools .toggle-row,.tools .segmented,.tools .range-label,.tools input[type=range],.tools .papers,.tools .field-label,.tools input[type=text]{grid-column:1/-1}.materials{grid-template-columns:repeat(3,1fr)}.material{display:flex;align-items:center;justify-content:center}.inspector .panel-content{display:block}.selection-card{margin-bottom:18px}.inspector .section-label{margin:20px 0 10px}.sticker-list{grid-template-columns:repeat(6,1fr)}.arrange{margin-top:14px}.finish{display:block}.finish>button{max-width:none;margin-bottom:12px}footer{gap:12px;font-size:10px;align-items:flex-start}.top-note{display:none}}

/* v02: UI remains flat; material lighting is rendered only on the canvas. */
.paper-dot.cream{background:#decba4}.paper-dot.lilac{background:#b9a5d0}.paper-dot.mint{background:#a2c5b6}.paper-dot.blue{background:#9dbbd6}
.custom-paper{display:flex;align-items:center;justify-content:space-between;font-size:12px;margin-top:12px;grid-column:1/-1}.custom-paper input{width:47px;height:27px;padding:2px;border:1px solid var(--line);background:#fffdf4;cursor:pointer}
.fit-row{font-size:12px;display:flex;align-items:center;gap:6px;cursor:pointer}.fit-row input{accent-color:#8f72af}.layout-hint{display:block;font-size:10px;color:var(--muted);margin:4px 0 0 23px}.layout-controls{grid-column:1}.layout-controls .section-label{margin:18px 0 10px}.layout-controls .segmented{margin-bottom:12px}.desk-bottom{flex-wrap:wrap}.papers{gap:4px}.segmented button{font-size:11px}

.transform-target{position:absolute;width:30px;height:30px;transform:translate(-50%,-50%);border:0;padding:0;margin:0;background:transparent;box-shadow:none;touch-action:none;user-select:none;-webkit-user-select:none;z-index:3;}
.transform-target:hover,.transform-target:active{background:transparent;box-shadow:none;translate:none}.transform-target[hidden]{display:none}.transform-target:focus-visible{outline:2px solid #715393;outline-offset:-5px}.canvas-area{user-select:none;-webkit-user-select:none}#sheet{user-select:none;-webkit-user-select:none}

.history-tools{position:absolute;right:18px;top:16px;display:flex;gap:8px;z-index:5}.history-tools button{width:36px;height:36px;padding:0;background:#fffdf5;color:#70556f;border:1px solid #b9a5c8;box-shadow:2px 3px 0 #d8cfe0;font:26px/1 Exqt,sans-serif;cursor:pointer}.history-tools button:hover:not(:disabled){background:#e9ddf5}.history-tools button:active:not(:disabled){transform:translate(1px,2px);box-shadow:1px 1px 0 #d8cfe0}.history-tools button:disabled{opacity:.38;cursor:default}.history-tools button:focus-visible{outline:2px dashed #9272b2;outline-offset:3px}

.save-bar{max-width:1400px;margin:16px auto 0;padding:12px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#f1eaf7;border:1px solid #b9a5c8}.save-bar strong,.save-bar small{display:block}.save-bar small{color:#9272a6;margin-top:6px;font-size:12px}.save-actions{display:flex;gap:8px;flex-wrap:wrap}.save-bar button,#drawer button{background:#fffdf5;border:1px solid #b9a5c8;color:#70556f;padding:10px 14px;box-shadow:2px 3px 0 #d8cfe0;cursor:pointer;font:inherit}.save-bar button:hover,#drawer button:hover{background:#e9ddf5}.save-bar button:disabled{opacity:.5}#drawer{width:min(840px,calc(100vw - 32px));max-height:85vh;box-sizing:border-box;padding:24px;background:#fffdf5;border:2px solid #9272a6;color:#70556f;box-shadow:6px 6px 0 #b9a5c8}#drawer::backdrop{background:#382b4866}#drawer header{display:flex;justify-content:space-between;align-items:center;gap:12px}#drawer h2{font-size:24px;margin:8px 0}#drawer header small,#drawer-count{font-size:12px;color:#9272a6}#drawer p{font-size:14px;line-height:1.7}#drawer-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:24px 0}.drawer-card{border:1px solid #b9a5c8;background:#f1eaf7;padding:10px;box-shadow:3px 3px 0 #d8cfe0}.drawer-open{display:flex;flex-direction:column;align-items:center;width:100%;gap:10px}.drawer-open img{width:84px;height:152px;object-fit:contain;image-rendering:auto}.drawer-open strong{max-width:100%;overflow-wrap:anywhere;font-size:15px}.drawer-open small{font-size:10px;line-height:1.6}.drawer-card .text-button{margin-top:10px;font-size:12px}#drawer .drawer-note{border-top:1px dashed #b9a5c8;padding-top:12px;font-size:12px}@media(max-width:700px){.save-bar{margin:10px;align-items:flex-start;flex-direction:column}.save-actions{gap:6px}.save-bar button{font-size:12px;padding:9px}#drawer-list{grid-template-columns:repeat(2,minmax(0,1fr))}#drawer{padding:16px}}

#drawer-question{max-width:360px;padding:24px;border:2px solid #9272a6;background:#fffdf5;color:#70556f;box-shadow:5px 5px 0 #b9a5c8}#drawer-question::backdrop{background:#382b4866}#drawer-question p{line-height:1.8}#drawer-answer{box-sizing:border-box;width:100%;padding:10px;border:1px solid #b9a5c8;background:#fffdf5;color:#70556f;font:inherit}#drawer-question form>div{display:flex;justify-content:flex-end;gap:10px;margin-top:20px}#drawer-question button{font:inherit;padding:9px 18px;background:#eee3f5;color:#70556f;border:1px solid #b9a5c8;cursor:pointer}

#manual-editor{width:min(960px,calc(100vw - 24px));max-height:94vh;overflow:auto;box-sizing:border-box;padding:22px;border:2px solid #9272a6;background:#fffdf5;color:#70556f;box-shadow:6px 6px 0 #b9a5c8}#manual-editor::backdrop{background:#382b4877}#manual-editor header{display:flex;gap:14px;align-items:center;justify-content:space-between}#manual-editor h2{margin:7px 0;font-size:24px}#manual-editor header small,#manual-editor header span{font-size:12px}#manual-editor button{font:inherit;color:#70556f;background:#f4eef8;border:1px solid #b9a5c8;padding:9px 14px;cursor:pointer;box-shadow:2px 3px 0 #d8cfe0}#manual-editor button.active,#manual-apply{background:#e3d3ee}#manual-editor button:disabled{opacity:.38;cursor:default}.manual-toolbar{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin:16px 0}.manual-toolbar .segmented{margin:0}.manual-toolbar label{flex:1;min-width:140px;font-size:14px}.manual-toolbar input,.manual-zoom-row input{display:block;width:100%;margin:8px 0}.manual-history{display:flex;gap:8px}#manual-view{display:block;width:100%;height:clamp(220px,48vh,520px);touch-action:none;border:1px solid #b9a5c8;box-sizing:border-box;outline-offset:3px}.manual-zoom-row{display:flex;align-items:center;gap:20px;margin-top:14px}.manual-zoom-row label{flex:1;font-size:14px}.manual-help{font-size:12px;line-height:1.7;color:#9272a6}#manual-editor footer{display:flex;justify-content:flex-end;gap:12px;padding:10px 0 0;border:0;margin:0}#manual-open{margin-top:12px}@media(max-width:600px){#manual-editor{padding:14px}.manual-toolbar{gap:12px}.manual-toolbar .segmented{width:100%}#manual-editor header{align-items:flex-start;flex-direction:column}#manual-editor button{font-size:13px;padding:8px 10px}}

#manual-editor .segmented{display:flex;min-width:270px;flex:0 0 auto}#manual-editor .segmented button{white-space:nowrap;min-width:86px}#manual-editor output{margin-left:8px}@media(max-width:600px){#manual-editor .segmented{min-width:0}#manual-editor .segmented button{min-width:0;flex:1}}

#pieces-drawer{width:min(840px,calc(100vw - 32px));max-height:85vh;padding:24px;background:#fffdf5;border:2px solid #9272a6;color:#70556f;box-shadow:6px 6px 0 #b9a5c8}#pieces-drawer::backdrop{background:#382b4866}#pieces-drawer header{display:flex;justify-content:space-between;align-items:center;gap:12px}#pieces-drawer h2{font-size:24px;margin:8px 0}#pieces-drawer header small,#pieces-count{font-size:12px;color:#9272a6}#pieces-drawer p{font-size:14px;line-height:1.7}#pieces-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:24px 0}#pieces-list .drawer-open img{width:120px;height:120px;object-fit:contain}#pieces-drawer .drawer-note{border-top:1px dashed #b9a5c8;padding-top:12px;font-size:12px}#save-piece{margin-top:12px}@media(max-width:700px){#pieces-drawer{padding:16px}#pieces-list{grid-template-columns:repeat(2,minmax(0,1fr))}}

.materials{grid-template-columns:repeat(4,minmax(0,1fr))}.swatch.jelly{color:#9dd8d8;text-shadow:-2px -2px #ffffff,2px 2px #689caa}.jelly-controls{margin-top:15px;padding:10px;border:1px dashed var(--line);background:#f7f3fa}.jelly-controls small{font-size:10px;color:var(--muted)}

body:not(:has([data-material="jelly"][aria-pressed="true"])) .jelly-controls{display:none}
