.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 40px 48px 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.topbar-title .kicker {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.topbar-title h1 {
  font-family: 'Special Elite', var(--font-mono), monospace;
  font-size: 2.7rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text);
  margin: 4px 0 6px;
}
.topbar-title .subtitle {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.save-status {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.save-status.is-local::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning-bg);
  margin-right: 6px;
}
.save-status.is-saved::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--badge-green);
  margin-right: 6px;
}

.app-main {
  display: flex;
  flex: 1;
  min-height: 0;
}

.side-pane {
  width: 340px;
  min-width: 300px;
  flex: none;
  overflow-y: auto;
  padding: 32px 28px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.side-section {
  margin-bottom: 36px;
}
.side-section h2 {
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.005em;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.side-footnote {
  margin-top: auto;
  padding-top: 20px;
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.side-footnote a {
  color: var(--text-muted);
}

.tree-pane {
  position: relative;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.empty-state-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  padding: 40px;
  color: var(--canvas-text-muted);
  background: var(--canvas-bg);
}
.sample-data-btn {
  border: none;
  background: none;
  color: var(--canvas-text-muted);
  text-decoration: underline;
  font-size: 0.8rem;
}
.sample-data-btn:hover {
  color: var(--accent-light);
}

.empty-state-pane p {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  max-width: 420px;
  color: var(--canvas-text);
}

/* Work area: the family-chart tree canvas. Pinned to the dedicated --canvas-* tokens
   (not the chrome --bg/--border tokens) so it keeps its own greige look independent
   of the surrounding white chrome. */
#FamilyChart {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background-color: var(--canvas-bg);
  background-image: radial-gradient(circle, var(--canvas-border) 1px, transparent 1px);
  background-size: 24px 24px;
}

.viewport-hint {
  font-size: 0.72rem;
  color: var(--canvas-text-muted);
  padding: 8px 16px;
  background: var(--canvas-bg-elevated);
  border-top: 1px solid var(--canvas-border);
}

@media (max-width: 900px) {
  .topbar {
    padding: 28px 24px 24px;
  }
  .topbar-title h1 {
    font-size: 2.2rem;
  }
  .app-main {
    flex-direction: column;
  }
  .side-pane {
    width: 100%;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .tree-pane {
    height: 60vh;
  }
}
