/* Pixel Creator stage: view bar, tools, canvas, overlays and footer. */
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stage-bar, .toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.stage-bar .segmented { flex-wrap: nowrap; }
.stage-bar .segmented button, .toolbar button { padding: 6px 10px; }
.toolbar { background: #fbfafc; }
.separator { width: 1px; height: 28px; background: var(--line); margin: 0 2px; }
.canvas-area { position: relative; flex: 1; min-height: 0; background: #9d9ca0; box-shadow: inset 0 0 0 1px #0000000f; overflow: hidden; }
.canvas-area canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: crosshair; }
.canvas-area canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.canvas-area[data-tool=hand] canvas, .canvas-area[data-view=wall] canvas, .canvas-area[data-view=compare] canvas { cursor: grab; }
.canvas-area[data-view=wall] { background: #d8d4cf; }
.canvas-area[data-busy] canvas { opacity: .9; }
.overlay { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100% - 32px)); display: grid; gap: 12px; padding: 22px; text-align: center; background: #fffffff2; border-radius: 14px; box-shadow: 0 10px 30px #20192d33; }
.overlay h1 { font-size: 1.3rem; }
.overlay .actions { justify-content: center; }
.notice { top: auto; bottom: 16px; transform: translateX(-50%); padding: 14px 16px; }
.canvas-area input.split { position: absolute; left: 16px; bottom: 12px; width: calc(100% - 32px); }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 12px; background: #fdf8e6; border-top: 1px solid #ead9a0; }
.confirm p { flex: 1 1 240px; font-weight: 600; }
.stage-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 6px 12px; min-height: 30px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); }
.message { margin: 0 12px 8px; color: #9b2436; font-size: .86rem; }
.message:empty { display: none; }
.message[data-tone=info] { color: var(--muted); }
.hint { padding: 0 12px 8px; font-size: .74rem; color: var(--muted); }

@media (max-width: 860px) {
  .stage { min-height: 0; }
  .canvas-area { flex: none; height: min(60vh, 520px); min-height: 300px; }
  .toolbar { gap: 6px; }
  .toolbar button { flex: 1 1 auto; padding: 6px 8px; }
  .toolbar .separator { display: none; }
  .stage-bar { gap: 6px; }
  .stage-bar .segmented { flex: 1 1 100%; }
  .stage-bar .segmented button { flex: 1 1 0; padding: 6px 4px; }
  .hint { display: none; }
}
/* While the confirm bar asks a question, everything else is inert; show it. */
.stage-bar[inert], .toolbar[inert], .panel[inert] { opacity: .55; }
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
