:root{color-scheme:light;--ink:#182033;--muted:#667085;--line:#dce2ea;--soft:#f3f6fa;--panel:#fff;--navy:#162033;--blue:#2f6df6;--blue-soft:#edf3ff;--danger:#c83f4d;--shadow:0 12px 40px rgba(23,35,58,.12)}
*{box-sizing:border-box}html,body{margin:0;min-height:100%}body{min-width:1024px;background:#edf1f6;color:var(--ink);font-family:Inter,"Noto Sans JP","Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;font-size:14px;line-height:1.5;overflow:hidden}button,input,textarea{font:inherit}button{color:inherit;-webkit-tap-highlight-color:transparent}button:focus-visible,input:focus-visible,textarea:focus-visible,canvas:focus-visible{outline:3px solid rgba(47,109,246,.28);outline-offset:2px}
.app-header{height:68px;display:flex;align-items:center;justify-content:space-between;padding:0 22px;background:var(--navy);color:#fff;box-shadow:0 2px 16px rgba(0,0,0,.15);position:relative;z-index:5}.brand{display:flex;align-items:center;gap:12px}.brand h1{margin:0;font-size:18px;line-height:1.2;letter-spacing:.04em}.brand p{margin:3px 0 0;color:#aeb9cc;font-size:12px}.brand-mark{width:36px;height:36px;border:1px solid #4b5870;border-radius:9px;position:relative}.brand-mark span{position:absolute;width:8px;height:8px;border:2px solid #fff;border-radius:50%;left:13px;top:5px}.brand-mark i:before,.brand-mark i:after{content:"";position:absolute;background:#fff;height:2px;transform-origin:left center;border-radius:2px}.brand-mark i:before{width:20px;transform:rotate(24deg);left:9px;top:20px;box-shadow:5px 9px 0 #fff}.brand-mark i:after{width:15px;transform:rotate(112deg);left:18px;top:14px;box-shadow:9px -7px 0 #fff}.header-actions{display:flex;align-items:center;gap:14px}.save-status{color:#bac4d6;font-size:12px}.save-status:before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:#52d39a;margin-right:7px}.icon-button{border:1px solid #4d5870;background:#202b40;color:#fff;width:34px;height:34px;border-radius:9px;cursor:pointer;font-weight:700}
.workspace{display:grid;grid-template-columns:252px minmax(0,1fr);height:calc(100vh - 68px)}.sidebar{background:var(--panel);border-right:1px solid var(--line);overflow-y:auto;padding:8px 18px 28px}.tool-section{padding:15px 0 18px;border-bottom:1px solid #e6eaf0}.tool-section:last-child{border-bottom:0}.tool-section h2{font-size:12px;color:#7b8496;text-transform:uppercase;letter-spacing:.1em;margin:0 0 11px}.segmented{display:grid;grid-template-columns:1fr 1fr;padding:3px;background:var(--soft);border-radius:9px}.segmented button{border:0;background:transparent;padding:8px 6px;border-radius:7px;cursor:pointer;font-weight:650;font-size:13px}.segmented button.active{background:#fff;color:var(--blue);box-shadow:0 1px 5px rgba(22,32,51,.12)}.compact-section{display:grid;gap:12px}.control-row{display:grid;grid-template-columns:32px 1fr;align-items:center;gap:8px}.control-label{font-weight:700;font-size:13px}.segmented.small button{padding:6px 4px}.button-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.tool-button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:8px 5px;cursor:pointer;font-size:13px}.tool-button span{font-size:16px;margin-right:5px;color:#5e6980}.tool-button:hover{border-color:#aeb9c9;background:#fafbfd}.tool-button.active{color:var(--blue);border-color:#9bb8ff;background:var(--blue-soft)}.tool-button.active span{color:var(--blue)}.tool-button.danger:hover{color:var(--danger);border-color:#efb5bc;background:#fff4f5}.field{display:block;margin-top:14px}.field>span:first-child{display:block;color:#47516a;font-size:12px;margin-bottom:7px}.color-control,.range-control{display:flex;align-items:center;gap:9px}input[type=color]{appearance:none;width:34px;height:30px;border:1px solid var(--line);padding:3px;background:#fff;border-radius:7px;cursor:pointer}input[type=color]::-webkit-color-swatch{border:0;border-radius:4px}.color-control output,.range-control output{font-variant-numeric:tabular-nums;color:var(--muted);font-size:12px}input[type=range]{accent-color:var(--blue);min-width:0;flex:1}.switch-row{display:flex;align-items:center;justify-content:space-between;margin-top:13px;cursor:pointer;color:#3f485c}.switch-row input{position:absolute;opacity:0;pointer-events:none}.switch-row i{width:36px;height:20px;background:#c9d0dc;border-radius:12px;position:relative;transition:.2s}.switch-row i:after{content:"";position:absolute;width:16px;height:16px;background:#fff;border-radius:50%;top:2px;left:2px;box-shadow:0 1px 3px rgba(0,0,0,.2);transition:.2s}.switch-row input:checked+i{background:var(--blue)}.switch-row input:checked+i:after{transform:translateX(16px)}.zoom-row{display:grid;grid-template-columns:28px 1fr 28px 38px;gap:5px;align-items:center;margin-top:13px}.zoom-row button{border:1px solid var(--line);background:#fff;border-radius:7px;height:28px;cursor:pointer}.zoom-row output{font-size:11px;color:var(--muted);text-align:right}
.stage-column{min-width:0;display:grid;grid-template-rows:56px minmax(0,1fr) 36px}.top-toolbar{background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 18px}.history-actions,.file-actions{display:flex;align-items:center;gap:7px}.history-actions button,.subtle-button{border:1px solid var(--line);background:#fff;border-radius:8px;padding:7px 10px;cursor:pointer}.history-actions button:hover,.subtle-button:hover{background:var(--soft)}button:disabled{opacity:.42;cursor:not-allowed}.primary-button{border:0;color:#fff;background:var(--blue);border-radius:8px;padding:8px 14px;font-weight:700;cursor:pointer;box-shadow:0 3px 10px rgba(47,109,246,.25)}.primary-button:hover{background:#225ee1}.export-wrap{position:relative}.export-menu{position:absolute;right:0;top:calc(100% + 8px);width:224px;padding:6px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:var(--shadow);z-index:12}.export-menu button{width:100%;display:grid;grid-template-columns:48px 1fr;align-items:center;text-align:left;border:0;background:transparent;border-radius:7px;padding:9px;cursor:pointer}.export-menu button:hover{background:var(--soft)}.export-menu b{color:var(--blue)}.export-menu small{color:var(--muted)}
.stage-viewport{overflow:auto;padding:28px;background-color:#e8edf3;background-image:radial-gradient(#cbd3df 1px,transparent 1px);background-size:18px 18px}.canvas-shell{width:794px;height:1123px;margin:0 auto;transform-origin:top center;transition:width .15s,height .15s}#editorCanvas{display:block;width:100%;height:100%;background:#fff;box-shadow:0 8px 30px rgba(32,45,66,.18);touch-action:none;cursor:default;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.status-bar{display:flex;justify-content:space-between;align-items:center;padding:0 18px;color:#646f82;background:#fff;border-top:1px solid var(--line);font-size:12px}.status-dot{display:inline-block;width:7px;height:7px;background:#3abf86;border-radius:50%;margin-right:7px}
.dialog{border:0;border-radius:14px;width:min(470px,calc(100vw - 32px));padding:0;color:var(--ink);box-shadow:0 22px 80px rgba(18,28,46,.28)}.dialog::backdrop{background:rgba(18,27,43,.45);backdrop-filter:blur(2px)}.dialog form{padding:20px}.dialog-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.dialog-title>div{display:flex;gap:10px;align-items:center}.dialog-title h2{margin:0;font-size:18px}.dialog-title>button{border:0;background:transparent;color:#7d8696;font-size:24px;cursor:pointer}.dialog-icon{display:grid;place-items:center;width:32px;height:32px;background:var(--blue-soft);color:var(--blue);border-radius:8px;font-weight:800}.dialog label>span{display:block;font-weight:700;font-size:13px;margin-bottom:6px}.dialog textarea,.dialog input[type=number]{width:100%;border:1px solid var(--line);border-radius:8px;padding:9px;resize:vertical}.dialog-options{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:14px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}.help-dialog ol{margin:0;padding-left:24px}.help-dialog li{margin:12px 0;padding-left:5px}.help-dialog li span{display:block;color:var(--muted);margin-top:2px}.shortcut-note{background:var(--soft);border-radius:9px;padding:11px;margin-top:17px;color:#586276;font-size:12px}.toast{position:fixed;left:50%;bottom:52px;transform:translate(-50%,15px);background:#182033;color:#fff;padding:10px 16px;border-radius:9px;box-shadow:var(--shadow);opacity:0;pointer-events:none;transition:.22s;z-index:30}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-height:760px){.app-header{height:58px}.workspace{height:calc(100vh - 58px)}.brand p{display:none}.tool-section{padding:11px 0 13px}.sidebar{padding-top:4px}}
@media(max-width:900px){
 body{min-width:0;overflow:hidden}.app-header{height:56px;padding:0 max(14px,env(safe-area-inset-right)) 0 max(14px,env(safe-area-inset-left))}.brand p{display:none}.brand-mark{width:34px;height:34px}.workspace{display:flex;flex-direction:column;height:calc(100dvh - 56px)}
 .sidebar{flex:0 0 188px;width:100%;display:flex;gap:0;overflow-x:auto;overflow-y:hidden;padding:0 8px;border-right:0;border-bottom:1px solid var(--line);scroll-snap-type:x proximity;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
 .tool-section{flex:0 0 212px;height:100%;overflow-y:auto;padding:10px 12px;border-bottom:0;border-right:1px solid #e6eaf0;scroll-snap-align:start}.tool-section:last-child{border-right:0}.tool-section h2{margin-bottom:8px}.field{margin-top:9px}.switch-row{margin-top:9px}
 .stage-column{flex:1;min-height:0;grid-template-rows:54px minmax(0,1fr) 34px}.top-toolbar{overflow-x:auto;justify-content:flex-start;gap:16px;padding:0 10px;overscroll-behavior-x:contain}.history-actions,.file-actions{flex:none}.history-actions button,.subtle-button,.primary-button{min-height:40px}.stage-viewport{padding:12px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.status-bar{padding:0 12px}.dialog{max-height:calc(100dvh - 24px);overflow:auto}.toast{bottom:calc(42px + env(safe-area-inset-bottom))}
}
@media(max-width:600px){
 .app-header{height:52px}.workspace{height:calc(100dvh - 52px)}.brand{gap:8px}.brand h1{font-size:16px}.brand-mark{display:none}.header-actions{gap:9px}.sidebar{flex-basis:164px}.tool-section{flex-basis:196px;padding:8px 10px}.stage-column{grid-template-rows:52px minmax(0,1fr) 32px}.top-toolbar{gap:12px;padding:0 8px}.history-actions button span{display:none}.history-actions button{min-width:42px;padding:7px}.file-actions{gap:5px}.subtle-button,.primary-button{padding:7px 9px}.stage-viewport{padding:8px}.status-bar{font-size:11px}.status-bar>span:last-child,#toolHint{display:none}.dialog form{padding:16px}.dialog textarea,.dialog input[type=number]{font-size:16px}.dialog-options{grid-template-columns:1fr}.shortcut-note{display:none}
}
