.map-editor{position:fixed;inset:0;z-index:5000;background:#e9eddf;color:#253740;display:grid;grid-template-rows:auto 1fr auto;font:14px/1.35 system-ui,sans-serif;isolation:isolate}
.map-editor *{box-sizing:border-box}.map-editor [hidden]{display:none!important}
.map-editor button,.map-editor select{font:inherit;min-height:42px;border:2px solid #334b54;border-radius:8px;background:#fffdf0;color:#253740;padding:8px 12px;cursor:pointer;box-shadow:none;transform:none}
.map-editor button:hover{background:#e3eedd;transform:none}.map-editor button:disabled{opacity:.48;cursor:default}.map-editor button:focus-visible,.map-editor select:focus-visible{outline:3px solid #f3ba37;outline-offset:2px}
.map-editor header{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:10px 16px;background:#344f66;border-bottom:4px solid #7c9caa;color:#fff4d5}
.map-editor header h1{font:700 18px/1.2 system-ui;margin:0;margin-right:auto}.map-editor header small{display:block;font-size:11px;font-weight:400;margin-top:3px}
.map-editor .me-publish{background:#f4d565;font-weight:700}.map-editor .me-close{width:44px;padding:0;font:24px/1 system-ui}
.map-editor .me-layout{min-height:0;display:grid;grid-template-columns:230px 1fr}
.map-editor aside{overflow:auto;padding:14px;background:#fff9e9;border-right:3px solid #9ba99d;display:flex;flex-direction:column;gap:16px}
.map-editor h2{font:700 14px/1.3 system-ui;margin:0 0 8px}.map-editor label{display:block;margin:0}.map-editor label span{display:block;font-size:12px;margin-bottom:5px}.map-editor select{width:100%;min-width:0}
.map-editor .me-palette{display:grid;grid-template-columns:1fr 1fr;gap:6px}.map-editor .me-palette button{display:flex;align-items:center;gap:7px;text-align:left;font-size:12px;padding:8px}
.map-editor [aria-pressed=true]{background:#cbe3c1;border-color:#335d38;box-shadow:inset 0 0 0 1px #335d38}.map-editor .me-swatch{width:20px;height:20px;border:1px solid #486068;border-radius:4px;flex-shrink:0}
.map-editor .me-row{display:flex;gap:6px}.map-editor .me-row>*{flex:1;min-width:0}.map-editor .me-secondary{font-size:12px;color:#58665c;margin:0}
.map-editor .me-stage{position:relative;min-height:0;min-width:0;background:#183c3d;overflow:hidden}
.map-editor .me-canvas{display:block;width:100%;height:100%;touch-action:none;image-rendering:pixelated;cursor:crosshair}
.map-editor .me-stage[data-tool=hand] .me-canvas{cursor:grab}.map-editor .me-zoom{position:absolute;right:12px;top:12px;display:flex;gap:5px}.map-editor .me-zoom button{width:44px;padding:5px;background:#fff9e9}
.map-editor .me-position{position:absolute;left:12px;bottom:10px;background:#142c36e8;color:#fff8df;padding:5px 9px;border-radius:5px;font:12px/1.3 monospace;pointer-events:none}
.map-editor .me-mini{display:block;width:100%;aspect-ratio:1;image-rendering:pixelated;border:2px solid #6b8791;border-radius:8px;touch-action:none;cursor:crosshair}
.map-editor footer{display:flex;align-items:center;gap:12px;padding:10px 16px;border-top:2px solid #9ba99d;min-height:48px;background:#fff9e9}.map-editor .me-status{flex:1;margin:0}.map-editor .me-status[data-error=true]{color:#a12726}
.map-editor .me-confirm{padding:14px;background:#fff2be;border-bottom:2px solid #b19546;display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;grid-column:1/-1}
.map-editor .me-confirm p{margin:0}.map-editor .me-main{display:grid;grid-template-rows:auto minmax(0,1fr);min-height:0}.map-editor .me-options{display:none}
.map-editor .me-layout{grid-template-columns:290px 1fr}
.map-editor .me-thumb{width:32px;height:32px;flex-shrink:0;image-rendering:pixelated;border-radius:3px}
.map-editor details>summary{cursor:pointer;font-weight:700;padding:8px 0;min-height:40px}
.map-editor details[open]{display:flex;flex-direction:column;gap:8px}
.map-editor input[type=search]{width:100%;min-width:0;border:2px solid #71867a;border-radius:7px;padding:10px;font:inherit;background:#fff;color:#253740}
.map-editor .me-asset-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;max-height:292px;overflow:auto;padding:2px}
.map-editor .me-asset-list button{display:flex;flex-direction:column;align-items:center;padding:5px;gap:2px;font-size:10px;min-width:0}
.map-editor [data-page-label]{display:flex;align-items:center;justify-content:center;white-space:nowrap;font-size:11px}
.map-editor .me-houses{display:grid;grid-template-columns:1fr 1fr;gap:6px;max-height:220px;overflow:auto}
.map-editor .me-houses button{padding:4px;height:94px;display:grid;place-items:center}
.map-editor .me-houses canvas{max-width:100%;max-height:80px;object-fit:contain;image-rendering:pixelated}
.map-editor .me-selection{display:flex;align-items:center;gap:10px;background:#e7efd9;border:1px solid #9aab86;border-radius:8px;padding:8px;font-size:12px}
.map-editor .me-selection canvas{width:48px;height:48px;flex-shrink:0;image-rendering:pixelated}
@media(max-width:700px){.map-editor header{padding:8px;gap:6px}.map-editor header h1{font-size:15px;flex-basis:45%}.map-editor header button{font-size:12px;padding:8px}.map-editor .me-layout{grid-template-columns:165px 1fr}.map-editor aside{padding:8px;gap:12px}.map-editor .me-palette{grid-template-columns:1fr}.map-editor .me-options{display:block}.map-editor .me-layout[data-collapsed=true]{grid-template-columns:1fr}.map-editor .me-layout[data-collapsed=true] aside{display:none}.map-editor footer{font-size:12px;padding:8px}.map-editor .me-mini{max-height:150px}.map-editor .me-position{max-width:calc(100% - 24px)}}
@media(max-width:700px){.map-editor header{position:relative;padding-right:60px}.map-editor .me-close{position:absolute;right:8px;top:8px}.map-editor header h1{flex-basis:calc(100% - 80px)}}
@media(max-width:700px){.map-editor .me-asset-list{grid-template-columns:repeat(2,minmax(0,1fr))}.map-editor .me-row{flex-wrap:wrap}.map-editor .me-row button{font-size:11px;padding:7px}.map-editor .me-houses{grid-template-columns:1fr}}
