*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1a1a1a;
  background: #ffffff;
}

/* ── Sidebar ── */

#sidebar {
  width: 240px;
  flex-shrink: 0;
  height: 100vh;
  background: #2b2b2b;
  color: #f0f0f0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px 16px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #3d3d3d;
}

.language-group {
  margin-top: 8px;
}

.language-toggle {
  width: 100%;
  background: none;
  border: none;
  color: #f0f0f0;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.language-toggle::before {
  content: '▶';
  font-size: 0.65rem;
  transition: transform 0.15s ease;
  display: inline-block;
}

.language-toggle.expanded::before {
  transform: rotate(90deg);
}

.language-toggle:hover {
  background: #363636;
}

.topic-list {
  list-style: none;
  padding: 0;
}

.topic-link {
  display: block;
  padding: 7px 16px 7px 32px;
  color: #c8c8c8;
  text-decoration: none;
  font-size: 0.875rem;
}

.topic-link:hover {
  background: #363636;
  color: #f0f0f0;
}

.topic-link.active {
  background: #4a90d9;
  color: #ffffff;
  font-weight: 500;
}

/* ── Content area ── */

#content {
  flex: 1;
  overflow-y: auto;
  background: #ffffff;
  padding: 48px 40px;
}

.topic-content {
  max-width: 860px;
}

.topic-title {
  font-size: 1.9rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 16px;
}

.topic-description {
  font-size: 1rem;
  line-height: 1.6;
  color: #333333;
  margin-bottom: 32px;
}

/* ── Best practices ── */

.best-practices h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555555;
  margin-bottom: 10px;
}

.best-practices ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.best-practices li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #1a1a1a;
}

.best-practices li::before {
  content: '✓';
  color: #4a90d9;
  font-weight: 700;
  flex-shrink: 0;
}

.best-practices code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875em;
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 3px;
}

/* ── Code block ── */

.code-section pre {
  background: #f4f4f4;
  border-left: 4px solid #4a90d9;
  border-radius: 0 4px 4px 0;
  padding: 20px 24px;
  overflow-x: auto;
}

.code-section pre code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  color: #2d2d2d;
  white-space: pre;
}

/* ── JS utilities ── */

.hidden {
  display: none;
}

.loading {
  padding: 7px 16px 7px 32px;
  font-size: 0.875rem;
  color: #888888;
  list-style: none;
}

/* ── Welcome state (used later by JS) ── */

.welcome-message {
  color: #888888;
  font-size: 1.1rem;
  margin-top: 80px;
  text-align: center;
}
