*{box-sizing:border-box}html,body{height:100%;margin:0;font-family:system-ui,-apple-system,"Yu Gothic UI","Meiryo",sans-serif;color:#1d2938;background:#edf1f5}button,input{font:inherit}.topbar{height:64px;background:#17263a;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 18px;box-shadow:0 2px 8px #14223630}.brand{display:flex;align-items:center;gap:10px}.brand-mark{width:34px;height:34px;border:1px solid #91a6bd;border-radius:8px;display:grid;place-items:center;font-weight:800;font-size:20px}.brand strong{display:block;letter-spacing:.08em;font-size:14px}.brand small{display:block;color:#aebdce;font-size:10px;letter-spacing:.06em}.file-actions{display:flex;gap:8px}.button{border:1px solid #cbd4df;background:#fff;color:#243449;padding:8px 13px;border-radius:6px;cursor:pointer;font-size:13px}.button:hover,.tool:hover{background:#eaf1f8}.button.primary{background:#2472bd;color:white;border-color:#2472bd}.button.primary:hover{background:#1c609f}.button.subtle{background:#f6f8fa}.button.danger{background:#fff5f4;color:#b33a32;border-color:#edc7c3}.button.full{width:100%;margin-top:12px}.app{height:calc(100% - 112px);min-height:440px;display:grid;grid-template-columns:150px minmax(300px,1fr) 245px;gap:0}.toolbar,.properties{background:#f8fafc;border-right:1px solid #d9e0e8;overflow:auto}.properties{border-right:0;border-left:1px solid #d9e0e8}.tool-group{padding:12px 10px;border-bottom:1px solid #e0e6ed}.group-label{font-size:10px;color:#7a8797;font-weight:700;letter-spacing:.08em;margin:0 4px 7px}.tool{width:100%;height:34px;border:1px solid transparent;background:transparent;border-radius:5px;text-align:left;padding:0 8px;margin:2px 0;color:#34465b;cursor:pointer;font-size:15px}.tool span{font-size:12px;margin-left:8px}.tool.active{background:#e3effb;border-color:#b6d2ee;color:#145b9e;font-weight:700}.workspace{min-width:0;display:flex;flex-direction:column;background:#fff}.canvas-wrap{position:relative;flex:1;min-height:0;background:#fff;overflow:hidden}canvas{width:100%;height:100%;display:block;touch-action:none}.canvas-hint{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);color:#9aa7b6;font-size:13px;pointer-events:none;text-align:center;max-width:80%}.canvas-hint.hidden{display:none}.coords,.zoom-label{position:absolute;bottom:10px;background:#17263ad9;color:#fff;padding:5px 9px;border-radius:4px;font:11px ui-monospace,monospace;pointer-events:none}.coords{left:10px}.zoom-label{right:10px}.commandbar{height:42px;border-top:1px solid #d9e0e8;display:flex;align-items:center;gap:8px;padding:5px 9px;background:#f8fafc}.command-prompt{font-size:11px;color:#758397;white-space:nowrap}.commandbar input{min-width:80px;flex:1;border:1px solid #d4dce5;border-radius:4px;padding:6px 8px;font-size:12px}.commandbar #statusText{font-size:11px;color:#7c8998;white-space:nowrap;max-width:180px;overflow:hidden;text-overflow:ellipsis}.panel{padding:13px;border-bottom:1px solid #e0e6ed}.panel h2{font-size:12px;margin:0 0 12px;color:#42546a}.info-row{display:flex;justify-content:space-between;margin:7px 0;font-size:12px;color:#718094}.info-row strong{color:#26384d}.layer-list{display:flex;flex-direction:column;gap:4px}.layer-item{display:flex;align-items:center;gap:7px;font-size:12px;padding:5px;border-radius:4px}.layer-item:hover{background:#edf2f7}.layer-item input{margin:0}.layer-color{width:10px;height:10px;border-radius:2px;border:1px solid #8895a4}.layer-add{display:flex;gap:5px;margin-top:9px}.layer-add input{width:100%;min-width:0;border:1px solid #d4dce5;border-radius:4px;padding:6px;font-size:11px}.layer-add .button{padding:5px 8px;font-size:11px}.check{display:flex;align-items:center;gap:7px;font-size:12px;margin:8px 0;color:#526276}.muted{font-size:11px;color:#8491a0;line-height:1.6}.prop-row{font-size:11px;display:flex;justify-content:space-between;padding:5px 0;border-bottom:1px solid #edf0f4}.prop-row span{color:#8290a0}.prop-row strong{font-weight:600;color:#34465b;max-width:130px;overflow-wrap:anywhere}.footer{height:48px;background:#f8fafc;border-top:1px solid #d9e0e8;display:flex;justify-content:space-between;align-items:center;padding:0 16px;color:#7c8998;font-size:10px}.footer span:first-child{font-weight:700;letter-spacing:.06em;color:#536479}@media(max-width:850px){.app{grid-template-columns:112px minmax(240px,1fr)}.properties{display:none}.tool{padding:0 5px}.tool span{font-size:11px;margin-left:4px}.footer span:nth-child(2){display:none}}@media(max-width:560px){.topbar{padding:0 8px;height:58px}.brand small{display:none}.button{padding:7px 8px;font-size:11px}.app{height:calc(100% - 98px);grid-template-columns:88px minmax(0,1fr)}.tool{font-size:13px}.tool span{font-size:10px}.footer{height:40px}.footer span:last-child{display:none}}

.snap-config{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:8px 0;font-size:11px;color:#65758a}.snap-config select{max-width:105px;border:1px solid #d4dce5;border-radius:4px;padding:4px;background:white;font-size:11px}

/* Prominent history controls */
.history-actions{display:flex;gap:6px;margin-left:auto;margin-right:12px}
.history-button{font-weight:700;min-width:104px;border-color:#60758d;background:#263b53;color:#fff}
.history-button:hover{background:#38516d;color:#fff}
.xy-panel{position:absolute;top:14px;left:14px;z-index:5;width:220px;padding:11px 12px;background:#fff;border:1px solid #9eb2c8;border-radius:8px;box-shadow:0 5px 20px #17263a24}
.xy-panel[hidden]{display:none}
.xy-panel-title{display:flex;justify-content:space-between;align-items:center;font-size:12px;font-weight:750;color:#26384d;margin-bottom:8px}
.xy-panel-title small{font-size:10px;font-weight:500;color:#8794a3}
.xy-panel label{display:flex;align-items:center;gap:9px;margin:6px 0}
.xy-panel label span{width:14px;font-size:12px;font-weight:800;color:#2777c8}
.xy-panel input{width:100%;min-width:0;padding:6px 8px;border:1px solid #cbd6e1;border-radius:5px;font:13px ui-monospace,monospace}
.xy-panel input:focus{outline:2px solid #9bc8ef;border-color:#2777c8}
.xy-panel-help{font-size:10px;color:#8794a3;margin-top:7px}
@media(max-width:760px){.topbar{gap:6px}.history-actions{margin:0 4px}.history-button{min-width:0;padding:6px;font-size:10px}.history-button{white-space:nowrap}}
@media(max-width:560px){.brand strong{font-size:11px}.history-actions{gap:3px}.history-button{padding:5px 6px;font-size:9px}.file-actions{gap:4px}}

.operation-hint{height:26px;flex:0 0 26px;display:flex;align-items:center;padding:0 10px;background:#eef3f8;border-top:1px solid #d9e0e8;color:#526276;font-size:11px}.commandbar{flex-shrink:0}
