/* docs.css: the /docs help page. Loaded only by docs.html; reuses app.css's tokens. */

.docs__layout {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

/* The table of contents stays in view while the long page scrolls under it. */
.docs-toc {
  position: sticky;
  top: 1.2rem;
  max-height: calc(100vh - 2.4rem);
  overflow-y: auto;
  font-size: 0.9rem;
  border-left: 2px solid var(--line);
  padding-left: 0.9rem;
}
.docs-toc__title {
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: var(--ink-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.docs-toc__list { list-style: none; margin: 0; padding: 0; }
.docs-toc__list li { margin: 0.3rem 0; }
.docs-toc__list a { color: var(--ink-muted); text-decoration: none; }
.docs-toc__list a:hover, .docs-toc__list a:focus-visible { color: var(--moss); text-decoration: underline; }
.docs-toc__tour { margin: 1rem 0 0; }

.docs__body { max-width: 72ch; min-width: 0; }
.docs-section { padding-bottom: 1.6rem; margin-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.docs-section:last-child { border-bottom: 0; }
/* Anchored jumps land below the top edge instead of flush against it. */
.docs-section, .docs-section [id] { scroll-margin-top: 1.2rem; }
.docs-section h2 { font-size: 1.45rem; margin-top: 0.4rem; }
.docs-section h3 { font-size: 1.1rem; margin-top: 1.4rem; }
.docs-section h4 { font-size: 1rem; margin-top: 1.1rem; }
.docs-section p, .docs-section li, .docs-section dd { line-height: 1.6; }

.docs-steps > li { margin-bottom: 0.5rem; }

.docs-defs dt { font-weight: 700; margin-top: 0.9rem; }
.docs-defs dd { margin: 0.2rem 0 0; color: var(--ink); }
.docs-defs--glossary dt { margin-top: 0.7rem; }

.docs-table__scroll { overflow-x: auto; }
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8rem 0 1rem;
  font-size: 0.92rem;
}
.docs-table th, .docs-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
}
.docs-table th { font-size: 0.8rem; color: var(--ink-muted); font-weight: 600; }
.docs-table--rules td:first-child,
.docs-table--checklist td:first-child { width: 34%; }
.docs-table--keys td:first-child { white-space: nowrap; width: 9rem; }
.docs-table--ladder td:first-child { white-space: nowrap; width: 9rem; }

.docs-id {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
}
.docs-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.docs-tag {
  font-size: 0.72rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-muted);
  white-space: nowrap;
}
.docs-tag--block { border-color: var(--brick); color: var(--brick); }
.docs-tag--required { border-color: var(--moss); color: var(--moss-strong); }

.docs kbd {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-2);
}

@media (max-width: 860px) {
  .docs__layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .docs-toc {
    position: static;
    max-height: none;
    border-left: 0;
    padding: 0.8rem 1rem;
    background: var(--surface-2);
    border-radius: var(--radius-m);
  }
  .docs-toc__list { columns: 2; column-gap: 1.2rem; }
  .docs-table--rules td:first-child,
  .docs-table--checklist td:first-child { width: auto; }
}
@media (max-width: 480px) {
  .docs-toc__list { columns: 1; }
  /* Stack the two columns of the long tables so the prose is not squeezed to a word a line. */
  .docs-table--rules tr, .docs-table--checklist tr { display: block; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
  .docs-table--rules td, .docs-table--checklist td { display: block; border: 0; padding: 0.2rem 0; }
  .docs-table--rules thead, .docs-table--checklist thead { display: none; }
}
