/* In-app documentation.
   
   Same tokens as the workspace, but a reading layout rather than a working one:
   a measure that stays comfortable, generous spacing, and screenshots at the width
   of the text so the page can be read straight through. */

.guide-body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-ui);
}

.guide-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  background: var(--surface);
  border-block-end: 1px solid var(--line-strong);
}

.guide-heading {
  flex: 1 1 auto;
  min-inline-size: 0;
}

.guide-heading h1 {
  margin: 1px 0 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.guide-layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 32px;
  max-inline-size: 1180px;
  margin-inline: auto;
  padding: 26px 20px 60px;
}

/* The contents list stays put: this page is long, and scrolling back to navigate is
   the reason long documentation goes unread. */
.guide-toc {
  position: sticky;
  inset-block-start: 76px;
  align-self: start;
}

.guide-toc ol {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.guide-toc li {
  counter-increment: toc;
  margin-block: 2px;
}

.guide-toc a {
  display: block;
  padding: 4px 8px;
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  font-size: 13px;
  text-decoration: none;
}

.guide-toc a::before {
  content: counter(toc) ". ";
  color: var(--text-subtle);
  font-family: var(--font-data);
  font-size: 11.5px;
}

.guide-toc a:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.guide-main {
  min-inline-size: 0;
  max-inline-size: 760px;
}

.guide-lead {
  margin: 0 0 26px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
}

.guide-main section {
  padding-block: 8px 26px;
}

.guide-main h2 {
  margin: 8px 0 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.012em;
  /* Anchored headings must clear the sticky header when jumped to. */
  scroll-margin-block-start: 84px;
}

.guide-main section {
  scroll-margin-block-start: 84px;
}

.guide-main p,
.guide-main li {
  font-size: 14.5px;
  line-height: 1.6;
}

.guide-main ul,
.guide-main ol {
  padding-inline-start: 22px;
}

.guide-main li {
  margin-block: 6px;
}

.guide-main code {
  padding: 1px 5px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-family: var(--font-data);
  font-size: 12.5px;
}

.guide-main figure {
  margin: 16px 0 20px;
}

.guide-main img {
  display: block;
  inline-size: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.guide-main figcaption {
  margin-block-start: 7px;
  color: var(--text-subtle);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Reserved for the one thing on this page that must not be skimmed past. */
.guide-callout {
  margin: 16px 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-inline-start: 4px solid var(--danger);
  border-radius: var(--radius-sm);
}

.guide-callout p {
  margin: 0;
}

.guide-footer {
  margin-block-start: 30px;
  padding-block-start: 18px;
  border-block-start: 1px solid var(--line);
}

@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding-inline: 14px;
  }

  .guide-toc {
    position: static;
    padding-block-end: 10px;
    border-block-end: 1px solid var(--line);
  }

  .guide-toc ol {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
  }
}
