.foreground-photo[hidden],.foreground-workspace[hidden],.foreground-controls [hidden]{display:none!important}
.foreground-controls{margin:24px 0 0}.foreground-controls summary{min-height:44px;cursor:pointer;font-size:1rem;line-height:1.6}.foreground-controls p{max-width:44rem;margin:8px 0;font-size:.8125rem;line-height:1.5;color:var(--platform-muted)}.foreground-actions{display:flex;flex-wrap:wrap;align-items:center;gap:4px 16px;margin:8px 0}.foreground-actions button{min-height:44px;min-width:44px;padding:8px 0;border:0;border-radius:0;background:transparent;font-size:.8125rem;color:var(--amvia-accent-text,var(--platform-accent));cursor:pointer}.foreground-actions button[aria-pressed=true]{color:var(--amvia-interaction-current,#66ffcc);text-decoration:underline;text-underline-offset:6px}.foreground-actions button:disabled{cursor:default;opacity:.45}.foreground-size{display:grid;grid-template-columns:1fr auto;align-items:center;gap:4px 12px;font-size:.8125rem;max-width:44rem}.foreground-size input{grid-column:1/-1;width:100%;min-height:44px}.foreground-size output{grid-column:2;grid-row:1;font-variant-numeric:tabular-nums}.foreground-actions button:focus-visible,.foreground-controls summary:focus-visible,.foreground-size input:focus-visible{outline:2px solid var(--amvia-interaction-current,#66ffcc);outline-offset:4px}.foreground-controls .foreground-draft-note{color:var(--amvia-accent-text,var(--platform-accent))}.foreground-workspace{position:absolute;inset:0;width:100%;height:100%;z-index:7;overflow:hidden;pointer-events:auto;background:var(--platform-surface,#292727)}.foreground-selection{display:block;width:100%;height:100%;touch-action:none}.foreground-selection:focus-visible{outline:2px solid var(--amvia-interaction-current,#66ffcc);outline-offset:-3px}.foreground-zoom{font-size:.8125rem;line-height:1.5;font-variant-numeric:tabular-nums}.foreground-editing .art-handle,.foreground-editing .art-move-target,.foreground-editing .comparison-resize-handle{visibility:hidden}.foreground-editing #wall-art,.foreground-editing .comparison-art{pointer-events:none}
@media(forced-colors:active){.foreground-actions button[aria-pressed=true],.foreground-controls .foreground-draft-note{color:Highlight}.foreground-actions button:focus-visible,.foreground-controls summary:focus-visible,.foreground-size input:focus-visible,.foreground-selection:focus-visible{outline-color:Highlight}}

/* The selection uses the original large photo viewport. Its small control rail
   stays focused on this draft, with the commit actions and tools always in reach. */
.foreground-panel-active>.foreground-controls{margin-top:0}.foreground-panel-active>:not(.foreground-controls){display:none!important}.foreground-panel-active .foreground-pinned{position:sticky;top:-1px;z-index:2;background:var(--platform-bg);padding:1px 0 8px}.foreground-panel-active .foreground-controls summary{min-height:32px}.foreground-panel-active .foreground-commit,.foreground-panel-active .foreground-tools{margin:0;gap:0 14px}.foreground-panel-active .foreground-status{margin:4px 0}.foreground-panel-active .foreground-help{margin-bottom:0}
@media(max-width:760px){#wall-editor.editing #wall-controls.foreground-panel-active{max-height:42dvh}#wall-editor.editing:has(.foreground-panel-active){grid-template-rows:minmax(120px,1fr) auto}#wall-editor.editing:has(.foreground-panel-active) #room-preview{max-height:48dvh}.foreground-panel-active .foreground-controls summary{display:none}.foreground-panel-active .foreground-pinned{padding-top:0}.foreground-panel-active .foreground-status{font-size:12px}}

/* Editing exposes the complete source photograph, even when the artwork view
   has a bottom crop. Removing this class restores the existing inline crop. */
#room-stage:has(.foreground-selecting){height:auto!important;overflow:visible!important}
/* Selection displays the current photo and passive live artwork copies. Keep the composition beneath it
   from protruding beyond that viewport; Preview restores these same layers. */
.foreground-selecting #wall-art,.foreground-selecting .comparison-art,.foreground-selecting .foreground-photo{visibility:hidden}

.foreground-scene-photo,.foreground-draft-photo{position:absolute;inset:0;display:block;width:100%;height:100%;pointer-events:none}.foreground-scene-photo{z-index:0}.foreground-scene-art{position:absolute;left:0;top:0;z-index:1;transform-origin:0 0;pointer-events:none}.foreground-draft-photo{z-index:2}.foreground-selection{position:relative;z-index:3}.foreground-art-copy,.foreground-art-copy *{pointer-events:none!important}.foreground-art-copy.has-physical-frame{overflow:visible;box-shadow:none;isolation:isolate}.foreground-art-copy.has-physical-frame[data-artwork-shape="circle"]{background:transparent}
/* The room comparison action describes the underlying wall view, not this
   foreground workspace. Restore it unchanged for Preview artwork and on exit. */
body:has(.foreground-selecting) #compare-room{visibility:hidden;pointer-events:none}
/* Foreground actions use one thin underline, without the shared lower stripe. */
@layer amvia-layout{body[data-amvia-unboxed-controls] .foreground-actions button:is([aria-pressed=true],:focus-visible,:active){box-shadow:none!important;border-bottom:0!important;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:6px}}
