.stage-editor{margin:0;min-width:0}.stage-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:18px}.stage-heading h3{font-size:18px;margin:0 0 8px}.stage-heading p{font-size:14px;line-height:1.6;max-width:570px}.stage-tools{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 20px}.stage-tool{display:flex;align-items:center;gap:6px;padding:8px 10px;background:#fff;border:1px solid #ddd;border-radius:3px;font:inherit;font-size:11px;cursor:pointer;color:#292929}.stage-tool:hover{background:#fffbd2;border-color:#b8ad00}.stage-tool svg{width:22px;height:22px;flex-shrink:0}.stage-workspace{display:grid;grid-template-columns:minmax(0,1fr) 215px;gap:20px;align-items:start}.stage-map-wrap{min-width:0;border:1px solid #dedede;border-radius:3px;overflow:hidden;background:#fff}.stage-back-label,.stage-front-label{font-size:9px;letter-spacing:1.5px;text-align:center;color:#888;padding:11px;background:#fafafa}.stage-front-label{border-top:3px solid #feed00}.stage-map{position:relative;aspect-ratio:1.5;min-height:265px;overflow:hidden;background-image:radial-gradient(#e2e2e2 1px,transparent 1px);background-size:20px 20px;touch-action:none;user-select:none}.stage-object{position:absolute;width:12%;max-width:86px;min-width:36px;min-height:42px;transform:translate(-50%,-50%);background:transparent;border:1px solid transparent;border-radius:3px;padding:3px;color:#292929;cursor:grab;touch-action:none;font:inherit;font-size:9px;line-height:1.25;text-align:center}.stage-object:active{cursor:grabbing}.stage-object:hover{background:#f7f7f7dd}.stage-object.selected{background:#fffbd9;border-color:#d0bf00;z-index:2}.stage-object:focus-visible{outline:2px solid #f91b24;outline-offset:2px}.stage-symbol{display:block;width:100%;max-width:58px;margin:auto;transform-origin:50% 50%;pointer-events:none}.stage-symbol svg{width:100%;display:block;max-height:58px}.stage-object-tag{display:block;overflow-wrap:anywhere;line-height:1.2;pointer-events:none;margin:3px -8px 0;max-height:24px;overflow:hidden;font-size:9px;background:#ffffffb8}.stage-note-dot{position:absolute;top:0;right:0;color:#f91b24;font-size:20px;line-height:12px;pointer-events:none}.stage-inspector{display:block!important;width:auto!important;padding:17px!important;margin:0!important;background:#fafafa!important;border:1px solid #e4e4e4!important;min-height:215px}.stage-inspector-title{display:flex;align-items:center;gap:8px;margin-bottom:18px}.stage-inspector-title svg{width:28px;height:28px}.stage-inspector h4{margin:0;font-size:13px}.stage-inspector label{display:block;color:#666;font-size:11px;margin-top:14px}.stage-inspector input,.stage-inspector textarea,.stage-inspector select{display:block;width:100%;margin-top:6px;padding:9px;border:1px solid #d7d7d7;border-radius:3px;font:inherit;font-size:14px;background:#fff;box-sizing:border-box;color:#292929}.stage-inspector textarea{resize:vertical;max-height:180px}.stage-position{font-size:10px;color:#888;line-height:1.7;margin:15px 0}.stage-delete{font-size:11px!important;color:#b51b22!important}.stage-no-selection p{font-size:14px;line-height:1.7;margin:12px 0;color:#777}.stage-bottom{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-top:15px}.stage-bottom p{font-size:10px;max-width:620px;color:#888;line-height:1.7}.stage-reset{white-space:nowrap;font-size:11px!important}.stage-announcement{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.stage-editor[data-stage-readonly=true] .stage-workspace{grid-template-columns:1fr}.stage-editor[data-stage-readonly=true] .stage-object{cursor:default}.stage-editor[data-stage-readonly=true] .stage-object:hover{background:transparent}@media(max-width:1000px){.stage-workspace{grid-template-columns:1fr}.stage-inspector{min-height:0;display:grid!important;grid-template-columns:1fr 1fr;gap:0 16px}.stage-inspector-title,.stage-no-selection{grid-column:1/-1}.stage-inspector-title{margin-bottom:0}.stage-delete{align-self:end;justify-self:start;margin-top:10px}.stage-position{margin-bottom:0}}@media(max-width:560px){.stage-tools{gap:6px}.stage-tool{font-size:10px;padding:7px 8px;flex:1 1 calc(50% - 6px)}.stage-tool svg{width:20px;height:20px}.stage-map{min-height:280px;aspect-ratio:1.1}.stage-object{width:15%;min-width:34px}.stage-object-tag{font-size:8px}.stage-symbol svg{max-height:44px}.stage-inspector{padding:15px!important;grid-template-columns:1fr!important}.stage-inspector-title{margin-bottom:0}.stage-bottom{display:block}.stage-reset{margin-top:12px}.stage-heading{gap:8px}.stage-heading h3{font-size:16px}.stage-heading p{font-size:11px}.stage-front-label,.stage-back-label{font-size:8px}}
/* Natural instrument footprints: only the artwork rotates, while its label stays readable. */
.stage-tool svg{width:30px;height:28px;object-fit:contain}
.stage-object{box-sizing:content-box;width:auto;max-width:none;min-width:0;min-height:0;padding:0;border:0;border-radius:2px;outline:1px solid transparent;overflow:visible}
.stage-object::after{content:"";position:absolute;inset:-6px;min-width:28px;min-height:28px}
.stage-object.selected{outline-color:#c7b700;background:#fffbd9cc}
.stage-symbol{position:absolute;display:block;left:50%;top:50%;width:var(--symbol-width);height:var(--symbol-height);max-width:none;margin:0;transform:translate(-50%,-50%) rotate(var(--stage-rotation));transform-origin:center;pointer-events:none}
.stage-symbol svg{display:block;width:100%;height:100%;max-height:none;overflow:visible}
.stage-object-tag{position:absolute;top:100%;left:50%;transform:translateX(-50%);width:max-content;min-width:44px;max-width:102px;max-height:24px;box-sizing:border-box;margin:5px 0 0;padding:1px 3px;border-radius:2px;line-height:1.2;font-size:9px;background:#ffffffdb;z-index:1}
.stage-note-dot{right:-7px;top:-5px}
.stage-inspector-title svg{width:40px;height:42px;flex-shrink:0;object-fit:contain}
.stage-rotate-buttons{display:flex;gap:6px;margin-top:7px}
.stage-rotate-buttons button{flex:1;min-height:34px;background:#fff;border:1px solid #d7d7d7;border-radius:3px;color:#333;font:inherit;font-size:11px;cursor:pointer}
.stage-rotate-buttons button:hover{background:#fffbd2;border-color:#b8ad00}
.stage-rotate-buttons button:focus-visible{outline:2px solid #b8ad00;outline-offset:2px}
@media(max-width:560px){.stage-tool{min-height:40px}.stage-tool svg{width:28px;height:26px}.stage-object{width:auto;min-width:0}.stage-symbol svg{max-height:none}.stage-object-tag{font-size:8px;max-width:76px;min-width:36px}.stage-rotate-buttons button{min-height:40px}}
/* Direct manipulation: resize inside the corner, rotation just beyond it. */
.stage-tool{touch-action:none;user-select:none;cursor:grab}.stage-tool:active{cursor:grabbing}
.stage-handle{position:absolute;z-index:4;display:block;opacity:0;touch-action:none}
.stage-object:hover .stage-handle,.stage-object.selected .stage-handle,.stage-object:focus-visible .stage-handle{opacity:1}
.stage-resize{right:-5px;bottom:-5px;width:14px;height:14px;border:2px solid #897f00;background:#fff;border-radius:2px;cursor:url("/design/assets/resize-nwse-cursor.svg") 16 16, nwse-resize}
.stage-turn{right:-29px;bottom:-29px;width:22px;height:22px;border:1px solid #c5b900;background:#fffbd9;border-radius:50%;font-size:19px;line-height:20px;color:#665d00;cursor:url("/design/assets/rotate-cursor.svg") 12 12, crosshair}
.stage-drag-ghost{position:fixed;z-index:10000;width:64px;height:64px;transform:translate(-50%,-50%);pointer-events:none;color:#292929;background:#fffbd9cc;border:1px dashed #a89b00;border-radius:4px}.stage-drag-ghost svg{width:100%;height:100%}.stage-drop-active{box-shadow:inset 0 0 0 3px #c5b900}
@media(pointer:coarse){.stage-object.selected .stage-resize{width:22px;height:22px;right:-9px;bottom:-9px}.stage-object.selected .stage-turn{width:28px;height:28px;right:-41px;bottom:-41px;line-height:26px}}

.stage-turn img{display:block;width:20px;height:20px;pointer-events:none}

/* Resize handles surround the rotated artwork's bounding box. */
.stage-resize-nw{left:-5px;top:-5px;right:auto;bottom:auto;cursor:url("/design/assets/resize-nwse-cursor.svg") 16 16, nwse-resize}
.stage-resize-ne{right:-5px;top:-5px;bottom:auto;cursor:url("/design/assets/resize-nesw-cursor.svg") 16 16, nesw-resize}
.stage-resize-sw{left:-5px;bottom:-5px;right:auto;cursor:url("/design/assets/resize-nesw-cursor.svg") 16 16, nesw-resize}
.stage-resize-se{right:-5px;bottom:-5px;cursor:url("/design/assets/resize-nwse-cursor.svg") 16 16, nwse-resize}
.stage-object:not(.selected) .stage-resize{opacity:0;pointer-events:none}

.stage-zoom{display:flex;justify-content:flex-end;margin:0 0 12px;font-size:14px}
.stage-zoom select{margin-left:8px;padding:6px 10px;background:#fff;border:1px solid #ccc;border-radius:3px}
.stage-map-wrap{overflow:auto;max-height:600px;align-self:start}
.stage-map{flex-shrink:0}

/* Captions edit in place, independently of object manipulation. */
.stage-editor[data-stage-readonly=false] .stage-object-tag{pointer-events:auto;cursor:text;touch-action:manipulation;user-select:text;-webkit-user-select:text}
.stage-object-tag[contenteditable=true]{outline:2px solid #b8ad00;background:white;max-height:none;min-height:18px;z-index:5;white-space:pre-wrap}

/* Marquee and group selection. Captions remain independently editable. */
.stage-map{touch-action:none}
.stage-marquee{position:absolute;pointer-events:none;border:1px solid #797200;background:rgba(184,173,0,.16);z-index:20}
.stage-multi-selection .stage-handle{display:none}
.stage-zoom{gap:12px;align-items:center;flex-wrap:wrap}

.stage-map { container-type: inline-size; }
.stage-symbol {
  left: var(--symbol-left, 50%);
  top: var(--symbol-top, 50%);
}

.stage-tool { touch-action: none; user-select: none; -webkit-user-select: none; }
.stage-tool svg { pointer-events: none; }
