/* Self-contained on purpose — does not load app.css. app.css has
   structural rules (e.g. a bare `main { display: flex }`) meant only for
   the editor page's toolbar/canvas layout; loading it here let those
   rules leak into this page's <main> and turn the help sections into flex
   row siblings instead of stacked blocks. Duplicating just the color
   variables avoids that coupling entirely. */
:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #666666;
  --border: #d8d8d8;
  --editor-bg: #fafafa;
  --accent: #2f6fed;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --fg: #f0f0f0;
    --muted: #9a9a9a;
    --border: #3a3a3c;
    --editor-bg: #141416;
    --accent: #5b8dfb;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
}

header {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.back-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.back-link:hover {
  text-decoration: underline;
}

.help-content {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

.help-content section {
  margin-bottom: 2rem;
}

.help-content h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

/* format-group is the new outer level — one per diagram type/grammar
   (Flowchart / Sequence) — visually heavier than the per-topic <h3>s
   nested inside it (bigger, bolder, a rule underneath) so the two-level
   hierarchy reads clearly while scrolling. Its own <h2> is intentionally
   larger than the plain top-level <h2>s above it (Philosophy etc.), which
   stay a single flat level. */
.format-group {
  margin-bottom: 2.5rem;
}

.format-group > h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.format-group .group-intro {
  color: var(--muted);
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

.help-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.intro-paragraph {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.help-content ul {
  margin: 0;
  padding-left: 1.25rem;
}

.help-content li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.help-content dl {
  margin: 0 0 0.75rem;
}

.help-content dl > div {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.help-content dt {
  min-width: 180px;
}

.help-content dd {
  margin: 0;
  color: var(--muted);
}

.help-content code {
  font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--editor-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

.tutorial-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tutorial-button {
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: #ffffff;
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
}

.tutorial-button:hover {
  opacity: 0.9;
}
