body.editor main { grid-template-columns: 340px 1fr; }
body.editor aside { overflow: auto; }
body.editor .controls select { width: 100%; font: inherit; padding: 4px; margin: 4px 0 8px; }
body.editor .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
body.editor button { font: inherit; padding: 5px 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; color: var(--ink); }
body.editor button:hover { background: #efe7da; }
body.editor button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
body.editor button.primary:hover { background: #9a3814; }
body.editor #status { margin-top: 8px; }
body.editor #status.ok { color: #2a6b2a; }
body.editor #status.err { color: #a12020; }
#rect-list { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; min-height: 60px; font-size: 12px; }
#rect-list li { padding: 4px 16px; border-bottom: 1px solid var(--line); cursor: pointer; font-family: ui-monospace, Consolas, monospace; color: var(--muted); }
#rect-list li.selected { background: #efe7da; color: var(--ink); }

.stage-wrap { position: relative; overflow: auto; background: #2b2118; min-width: 0; }
#stage { position: relative; display: inline-block; margin: 16px; user-select: none; touch-action: none; }
#stage img { display: block; max-width: calc(100vw - 340px - 32px); max-height: calc(100vh - 80px); }
#rects { position: absolute; inset: 0; cursor: crosshair; }
.rect {
  position: absolute;
  border: 2px solid #ffe14d;
  background: rgba(255, 225, 77, .12);
  box-sizing: border-box;
  cursor: move;
}
.rect.selected { border-color: #ff6a3d; background: rgba(255, 106, 61, .18); }
.rect .n { position: absolute; left: 0; top: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; padding: 0 4px; pointer-events: none; }
.rect .handle { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: #ffe14d; border: 1px solid #000; cursor: nwse-resize; }
.rect.selected .handle { background: #ff6a3d; }
.rect.drawing { pointer-events: none; }

#review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 12px; padding: 12px; }
#review-grid .cell { position: relative; background: #000; }
#review-grid .cell img { display: block; width: 100%; }
#review-grid .cell .rect { border-width: 2px; cursor: default; }
#review-grid .cell .cap { position: absolute; left: 0; top: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; padding: 2px 6px; }
