/* Same stage treatment as the 2D map — see tools/seed-map/seed-map.css for why
   `contain: layout paint` is the line that matters. The 3D viewer draws into a canvas it
   sizes from the window, so it also needs the canvas pinned to the stage. */

#tool-root .sm-stage {
  contain: layout paint;
  position: relative;
  height: min(82vh, 860px);
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}
@media (max-width: 900px) { #tool-root .sm-stage { height: 78vh; min-height: 440px; } }

#tool-root .sm-stage #world-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* The viewer's own floating panels sit above the canvas. */
#tool-root .sm-stage .sm-sidebar { z-index: 30; }

#tool-root .sm-back {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  padding: 5px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--fg);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}
#tool-root .sm-back:hover { border-color: var(--grass); color: var(--grass); }

#tool-root .sm-note {
  margin-top: 10px;
  color: var(--fg-muted);
  font-size: 0.82rem;
  line-height: 1.65;
}
#tool-root .sm-note a { color: var(--grass); }
