/*
 * The editor layout is rendered inside the AppShell's content area.
 * We use a negative margin + full viewport calc to break out of the
 * content padding/max-width constraints for a full-bleed editor experience.
 */
.layout {
  display: flex;
  flex-direction: column;
  /* Fill remaining height below the AppShell header */
  height: calc(100vh - var(--header-height));
  /* Break out of content padding */
  margin: calc(-1 * var(--space-6));
  overflow: hidden;
  background-color: var(--color-bg);
}

@media (min-width: 768px) {
  .layout {
    margin: calc(-1 * var(--space-8));
  }
}

.main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
  height: 100%;
}

.canvasArea {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: relative;
  min-height: 0;
}

.canvasContainer {
  flex: 1;
  overflow: hidden;
  position: relative;
  min-height: 0;
  width: 100%;
}

.saveError {
  padding: var(--space-2) var(--space-4);
  background-color: var(--color-danger-50);
  border-bottom: 1px solid var(--color-danger-100);
  color: var(--color-danger-700);
  font-size: var(--font-size-sm);
  text-align: center;
}

/* ── 3D / 2D View Toggle ── */

.viewToggle {
  display: flex;
  gap: 2px;
  padding: 4px 8px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.viewToggleBtn {
  padding: 4px 14px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-bg-elevated);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.viewToggleBtn:hover {
  background: var(--color-bg-hover);
}

.viewToggleBtnActive {
  background: var(--color-accent-600);
  color: var(--color-text-on-accent);
  border-color: var(--color-accent-700);
}

.viewToggleBtnActive:hover {
  background: var(--color-accent-700);
}

.loading3D {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--color-text-muted);
  font-size: var(--font-size-base);
}
