/* Scoped to the super-admin item editor. Existing rooms and mobile chrome stay unchanged. */
#items-view.item-editor { width: 100%; min-width: 0; max-width: 1120px; margin: 0 auto; padding: 24px; box-sizing: border-box; }
#items-view [hidden] { display: none !important; }
#items-view *, #items-view *::before, #items-view *::after { box-sizing: border-box; }
#items-view .item-editor-header, #items-view .item-editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
#items-view .item-editor-header { justify-content: space-between; }
#items-view h2, #items-view h3 { margin: 0 0 12px; }
#items-view button, #items-view input, #items-view select, #items-view textarea, #items-view summary { font: inherit; color: inherit; }
#items-view button, #items-view input:not([type=checkbox]), #items-view select, #items-view summary { min-height: 44px; }
#items-view button { cursor: pointer; padding: 10px 14px; border: 1px solid #d6c4af; border-radius: 12px; background: #fffaf3; }
#items-view button:disabled { cursor: default; opacity: .55; }
#items-view :focus-visible { outline: 3px solid #72533f; outline-offset: 3px; }
#items-view .item-editor-body { display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr); gap: 24px; align-items: start; }
#items-view .item-editor-list { display: grid; gap: 8px; max-height: 72vh; overflow-y: auto; padding: 4px; }
#items-view .item-editor-list button { text-align: left; min-width: 0; }
#items-view .item-editor-list strong, #items-view .item-editor-list small { display: block; overflow-wrap: anywhere; }
#items-view small { font-size: .8rem; }
#items-view .item-editor-status { min-height: 24px; margin: 12px 0 20px; overflow-wrap: anywhere; }
#items-view .item-editor-error { color: #8b3026; }
#items-view form { min-width: 0; }
#items-view .item-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
#items-view .item-editor-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: .9rem; }
#items-view .item-editor-field > input, #items-view .item-editor-field > select, #items-view .item-editor-field > textarea { width: 100%; min-width: 0; padding: 10px; border: 1px solid #d6c4af; border-radius: 10px; background: #fffdf9; }
#items-view .item-editor-field > input[type=checkbox] { width: 44px; height: 44px; margin: 0; }
#items-view input[readonly] { background: #eee5d9; }
#items-view textarea { resize: vertical; min-height: 130px; font-family: ui-monospace, monospace; font-size: .8rem; }
#items-view .item-editor-art { border: 1px solid #d6c4af; border-radius: 14px; padding: 14px; margin: 22px 0; min-width: 0; }
#items-view legend { padding: 0 6px; }
#items-view .item-editor-help { font-size: .85rem; line-height: 1.5; margin: 8px 0 14px; }
#items-view .item-editor-previews { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
#items-view .item-editor-angle { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 6px; }
#items-view .item-editor-angle[aria-pressed=true] { border: 2px solid #72533f; background: #f3e5d1; }
#items-view .item-editor-angle svg { width: 100%; height: auto; aspect-ratio: 480 / 380; display: block; }
#items-view .item-editor-angle small { line-height: 1.3; margin-top: 4px; }
#items-view .item-editor-art-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 14px 0; }
#items-view .item-editor-upload { display: flex; flex-direction: column; align-items: start; gap: 10px; }
#items-view .item-editor-upload .item-editor-field { width: 100%; }
#items-view .item-editor-advanced { border-top: 1px solid #d6c4af; padding: 14px 0 20px; }
#items-view summary { cursor: pointer; padding: 12px 0; }
#items-view input[type=file] { overflow: hidden; }
@media (max-width: 720px) {
  #items-view.item-editor { padding: 16px; }
  #items-view .item-editor-body { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  #items-view .item-editor-list { max-height: 220px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #items-view .item-editor-art-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #items-view .item-editor-art-row > :first-child { grid-column: 1 / -1; }
  #items-view .item-editor-previews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  #items-view.item-editor { padding: 12px; }
  #items-view .item-editor-grid { grid-template-columns: minmax(0, 1fr); }
  #items-view .item-editor-list { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { #items-view * { transition: none !important; animation: none !important; } }

/* The visual footprint workbench stays local to Items. */
#items-view .item-editor-footprint { min-width: 0; margin: 22px 0; padding: 16px; border: 1px solid #d6c4af; border-radius: 18px; background: #f6ecdd; }
#items-view .item-editor-footprint legend { font-weight: 600; }
#items-view .item-editor-footprint-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#items-view .item-editor-footprint-fields > :first-child { grid-column: 1 / -1; }
#items-view .item-editor-footprint-fields > :first-child, #items-view .item-editor-footprint-fields > :last-child { flex-direction: row-reverse; align-items: center; justify-content: flex-end; }
#items-view .item-editor-footprint-fields input[type=checkbox] { accent-color: #775e44; flex-shrink: 0; }
#items-view .item-editor-footprint-stage { position: relative; height: 360px; width: 100%; margin-top: 16px; overflow: hidden; border: 1px solid #dfccb4; border-radius: 14px; background: #fff9f0; }
#items-view .item-editor-footprint-stage > svg { width: 100%; height: 100%; display: block; }
#items-view .item-editor-footprint-grid { stroke: #e9dcc9; stroke-width: 1; opacity: .65; }
#items-view .item-editor-footprint-area { fill: #bd976758; stroke: #755535; stroke-width: 2; vector-effect: non-scaling-stroke; }
#items-view .item-editor-footprint-anchor { fill: none; stroke: #42372c; stroke-width: 2; vector-effect: non-scaling-stroke; }
#items-view .item-editor-footprint-leader { stroke: #775e44; stroke-width: 1.5; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
#items-view button.item-editor-footprint-handle { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; padding: 0; min-height: 44px; border-radius: 50%; border: 2px solid #775e44; background: #fffaf2; color: #604326; font-size: 22px; touch-action: none; user-select: none; cursor: nwse-resize; box-shadow: 0 2px 5px #644a2822; }
#items-view button.item-editor-footprint-centre { background: #fffaf24d; color: #604326; border-style: dashed; cursor: move; }
#items-view .item-editor-footprint-stage.is-dragging { box-shadow: inset 0 0 0 2px #b3936b; }
@media (max-width: 720px) { #items-view .item-editor-footprint { padding: 12px; } #items-view .item-editor-footprint-stage { height: 320px; } }
@media (max-width: 360px) { #items-view .item-editor-footprint { padding: 10px; } #items-view .item-editor-footprint-fields { gap: 10px; } #items-view .item-editor-footprint-fields > :last-child { grid-column: 1 / -1; } #items-view .item-editor-footprint-stage { height: 300px; } }

/* One save action stays within reach without moving fields or captured drag frames. */
#items-view #item-editor-save { position: fixed; top: max(12px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); z-index: 20; min-height: 44px; background: #72533f; color: #fffaf3; border-color: #72533f; box-shadow: 0 4px 18px #44302230; font-weight: 700; }
.th-mobile #items-view #item-editor-save { top: calc(var(--mobile-top-height, 56px) + 8px); right: max(12px, env(safe-area-inset-right, 0px)); }
