:root{
  --bg:#f5f3f8;--panel:#ffffff;--line:#ded9e8;--ink:#40394d;--muted:#8a8198;
  --accent:#806fbd;--accent-2:#eae4fb;--danger:#d86578;--shadow:0 10px 30px rgba(57,43,79,.09);
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:"Malgun Gothic","Apple SD Gothic Neo","Noto Sans KR","Pretendard",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg);overflow:hidden}
button,input,select{font:inherit}button{cursor:pointer}.hidden{display:none!important}
.app-shell{height:100vh;display:flex;flex-direction:column}
.topbar{height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 18px;background:#fff;border-bottom:1px solid var(--line);box-shadow:0 3px 16px rgba(56,45,76,.04);z-index:5;gap:12px}
.brand{display:flex;align-items:center;gap:10px;min-width:280px}.brand-mark{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(145deg,#efeafd,#d7efff);font-size:20px;color:#6d61a8}.brand strong{display:block;font-size:15px}.brand span{display:block;color:var(--muted);font-size:11px;margin-top:2px}.top-actions{display:flex;gap:6px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
button,.button{border:1px solid var(--line);border-radius:9px;background:#fff;color:var(--ink);padding:8px 11px;font-size:12px;transition:.15s;white-space:nowrap}.button{display:inline-flex;align-items:center}.ghost:hover{border-color:#bcb0dd;background:#f7f3ff}.primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:700}.primary:hover{filter:brightness(.97)}.danger{background:#fff5f6;border-color:#f1c8d0;color:#bb465d}.mini{padding:6px 8px;font-size:11px;border-radius:7px}.icon-btn{width:28px;height:28px;padding:0;font-size:18px;display:grid;place-items:center}
.workspace{flex:1;display:grid;grid-template-columns:360px minmax(430px,1fr) 330px;min-height:0}.panel{background:var(--panel);overflow:auto}.left-panel{border-right:1px solid var(--line)}.right-panel{border-left:1px solid var(--line)}.panel-section{padding:14px 16px 15px;border-bottom:1px solid #eeeaf3}.panel-section.compact{padding-bottom:18px}.panel-section h2{font-size:13px;margin:0 0 10px}.section-title-row{display:flex;align-items:center;justify-content:space-between;gap:8px}.section-title-row h2{margin:0}.hint{font-size:10px;color:var(--muted)}
.page-list{display:flex;flex-direction:column;gap:7px;margin-top:10px}.page-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 9px;border:1px solid var(--line);border-radius:10px;background:#fcfbff}.page-item.active{border-color:#8c77d0;background:#f1edff;box-shadow:0 0 0 2px rgba(128,111,189,.08)}.page-name{font-size:11px;font-weight:700;color:#544c61;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.page-thumb{font-size:9px;color:#8d8398}
.preset-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px}.preset-card{border:1px solid var(--line);border-radius:11px;overflow:hidden;background:#fff;padding:0;text-align:left;min-width:0}.preset-card:hover{border-color:#b7acd5;box-shadow:0 4px 12px rgba(70,55,95,.08)}.preset-card.active{border-color:#8c77d0;box-shadow:0 0 0 2px rgba(128,111,189,.08)}.preset-preview{height:48px;display:block;position:relative;overflow:hidden}.preset-preview::before,.preset-preview::after{content:"";position:absolute;border-radius:999px;background:rgba(255,255,255,.72)}.preset-preview::before{width:16px;height:16px;right:10px;top:8px}.preset-preview::after{width:7px;height:7px;right:30px;top:27px}.preset-name{display:block;padding:7px 8px 8px;font-size:10px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#4a4253}
.asset-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-top:10px}.asset-btn{aspect-ratio:1;border:1px solid var(--line);border-radius:10px;background:#fbfafe;padding:5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0}.asset-btn:hover{border-color:#b8abd9;background:#f5f1ff}.asset-btn.active{border-color:#8572c4;background:#eee8ff;box-shadow:0 0 0 2px rgba(128,111,189,.12)}.asset-btn svg{width:42px;height:32px;overflow:visible}.asset-btn span{font-size:9px;color:#70677d;line-height:1.12;text-align:center;word-break:keep-all}
.segmented{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--line);border-radius:9px;overflow:hidden}.segmented button{border:0;border-radius:0}.segmented button.active{background:#ece6fb;color:#6554a4;font-weight:700}.tool-subpanel,.stamp-settings{margin-top:10px;padding:10px;background:#faf9fc;border:1px solid #ebe6f2;border-radius:10px}.stamp-settings{background:#fbf9ff;border-color:#e1d9f3}.stamp-tool-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.stamp-tool-head strong{font-size:12px}.tool-tip{font-size:10px;line-height:1.5;color:#81778d;margin:8px 0 0}
label{font-size:11px;color:#6d6578;display:block;margin:8px 0}input[type="number"],select{width:100%;margin-top:5px;border:1px solid var(--line);border-radius:7px;padding:7px;background:#fff;color:var(--ink)}input[type="color"]{display:block;width:100%;height:32px;border:1px solid var(--line);border-radius:7px;padding:2px;background:#fff;margin-top:5px}input[type="range"]{width:100%;accent-color:var(--accent);margin-top:5px}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:8px}.three-col{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.check-label{display:flex;align-items:center;gap:5px;margin:0;font-size:11px;color:#675f72}.inline-check{height:100%;justify-content:center;border:1px solid var(--line);border-radius:8px;margin-top:8px}.effect-check{margin-top:12px}.value-readout{float:right;color:#5d5269;font-weight:700}.small-copy{font-size:10px;color:var(--muted);line-height:1.45;margin:7px 0 10px}.small-copy.no-top{margin-top:6px}.size-readout{padding:7px 9px;background:#f8f6fb;border:1px solid #ebe6f2;border-radius:8px;font-size:10px;color:#766c82;margin:8px 0}.compact-top{margin-top:8px}.inline-note{display:block;font-size:9px;color:#91879d;margin-top:7px;line-height:1.4}
.stage-area{min-width:0;display:flex;flex-direction:column;background:linear-gradient(135deg,#f6f5f8,#edeaf1)}.stage-toolbar{height:48px;display:flex;align-items:center;justify-content:center;gap:13px;padding:0 10px;border-bottom:1px solid var(--line);background:rgba(255,255,255,.75);backdrop-filter:blur(10px);flex-wrap:wrap}.zoom-controls{display:flex;align-items:center;gap:6px}.zoom-controls input{width:120px;margin:0}.zoom-controls span{width:42px;font-size:11px;color:var(--muted)}.stage-viewport{flex:1;min-height:0;overflow:auto;display:flex;align-items:center;justify-content:center;padding:40px}.stage-wrap{position:relative;background:#fff;box-shadow:0 12px 40px rgba(52,42,67,.18),0 0 0 1px rgba(70,55,90,.1);transform-origin:center center}.stage-wrap.pen-cursor,.stage-wrap.stamp-cursor{cursor:crosshair}.stage-wrap.drag-cursor{cursor:grabbing}#stage{display:block;touch-action:none;user-select:none}.statusbar{height:34px;border-top:1px solid var(--line);background:rgba(255,255,255,.8);display:flex;align-items:center;justify-content:space-between;padding:0 14px;font-size:10px;color:var(--muted)}.statusbar b{color:#62586c}
.empty-inspector{padding:40px 24px;text-align:center;color:var(--muted)}.empty-icon{font-size:30px;margin-bottom:8px}.empty-inspector h3{font-size:13px;color:#625969;margin:0 0 6px}.empty-inspector p{font-size:11px;line-height:1.6;margin:0}.badge{font-size:9px;background:#eee9f8;color:#6d5ea7;border-radius:99px;padding:4px 7px}.object-actions,.quick-align{display:flex;gap:6px;flex-wrap:wrap}.stroke-list{display:flex;flex-direction:column;gap:7px}.stroke-row{display:grid;grid-template-columns:22px minmax(72px,1fr) 58px 26px 26px 26px;gap:5px;align-items:center;background:#faf9fc;border:1px solid #ebe7f1;border-radius:8px;padding:6px}.stroke-row input[type="color"]{height:30px;margin:0;padding:1px}.stroke-row input[type="number"]{margin:0;padding:5px}.stroke-index{font-size:9px;text-align:center;color:#8a8194}.stroke-row button{padding:3px;width:26px;height:26px;font-size:10px;border-radius:6px}.canvas-section{position:sticky;top:0;background:#fff;z-index:2}.image-import-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px}
.toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);background:#473f52;color:#fff;padding:9px 13px;border-radius:9px;font-size:11px;opacity:0;pointer-events:none;transition:.2s;z-index:20;box-shadow:var(--shadow)}.toast.show{opacity:1;transform:translate(-50%,0)}
#selectionLayer{pointer-events:none}.select-box{fill:none;stroke:#7565b3;stroke-width:1;vector-effect:non-scaling-stroke}.resize-handle,.rotate-handle{fill:#fff;stroke:#7565b3;stroke-width:1;vector-effect:non-scaling-stroke;pointer-events:all;cursor:nwse-resize}.resize-handle[data-handle="n"],.resize-handle[data-handle="s"]{cursor:ns-resize}.resize-handle[data-handle="e"],.resize-handle[data-handle="w"]{cursor:ew-resize}.resize-handle[data-handle="ne"],.resize-handle[data-handle="sw"]{cursor:nesw-resize}.rotate-handle{fill:#f4f0ff;cursor:grab}.rotate-stem{stroke:#7565b3;stroke-width:1;vector-effect:non-scaling-stroke;pointer-events:none}.safe-guide{fill:none;stroke:#a99bcf;stroke-width:.6;stroke-dasharray:3 2;opacity:.75}.grid-line{stroke:#786f83;stroke-width:.25;opacity:.1}.stamp-ghost{opacity:.46;pointer-events:none}
@media(max-width:1320px){.workspace{grid-template-columns:330px minmax(390px,1fr) 300px}.asset-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:1100px){.workspace{grid-template-columns:300px minmax(340px,1fr) 285px}.top-actions .ghost:nth-child(3),.top-actions .file-button,.top-actions #exportSvgBtn{display:none}.stage-toolbar{gap:8px}.zoom-controls input{width:88px}}
