body {
  display: grid;
  grid-template-rows: var(--topbar-height) 1fr;
  height: 100vh;
}

#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

#app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  overflow: hidden;
  min-height: 0;
}

#sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

#chapter-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
}

.scene-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px;
}

#sidebar > .btn-block {
  margin: 12px;
  flex-shrink: 0;
}

#editor-area {
  overflow-y: auto;
  padding: 24px;
  background: var(--color-bg);
  min-height: 0;
}

#scene-editor {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 920px;
  margin: 0 auto;
}

.empty-state {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
}
