/* Document body styles (from content pack print CSS, web-tuned) */
.doc-body {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}
.doc-body .part {
  font-family: Georgia, serif;
  color: var(--blue);
  font-size: 1.35rem;
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--gold);
}
.doc-body .topic {
  font-family: Georgia, serif;
  color: var(--blue-mid);
  font-size: 1.1rem;
  margin: 1.25rem 0 0.5rem;
}
.doc-body .block-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin: 1rem 0 0.25rem;
}
.doc-body p { margin: 0.45rem 0; }
.doc-body ul { margin: 0.5rem 0 0.75rem; padding-left: 1.25rem; }
.doc-body li { margin: 0.35rem 0; }
.doc-body .rule { border: none; border-top: 1px solid var(--line); margin: 1.25rem 0; }
.doc-body .topic + p,
.doc-body .block-label + p {
  background: #f8fafc;
  border-left: 4px solid var(--blue-mid);
  padding: 12px 14px;
  font-family: Georgia, serif;
  border-radius: 0 6px 6px 0;
  margin-bottom: 0.65rem;
}
.doc-body code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.88em;
  background: #eef2ff;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.doc-body strong { color: var(--blue); }
.doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.doc-body table tbody,
.doc-body table thead,
.doc-body table tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}
.doc-body td, .doc-body th {
  border: 1px solid var(--line);
  padding: 8px 10px;
  vertical-align: top;
}
.doc-body th { background: #f1f5f9; color: var(--blue); text-align: left; }

.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 28px;
  align-items: start;
}
.doc-main { min-width: 0; }
.doc-toc-rail {
  position: sticky;
  top: 12px;
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f8fafc;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}
.doc-toc-title {
  margin: 0 0 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-mid);
}
.toc-link {
  display: block;
  padding: 5px 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: 8px;
  transition: color 160ms ease, border-color 160ms ease;
}
.toc-link:hover {
  color: var(--blue);
  border-left-color: var(--gold);
}
.toc-link.toc-l1 {
  font-weight: 600;
  color: var(--blue);
  margin-top: 6px;
}
.toc-link.toc-l1:first-of-type { margin-top: 0; }
.toc-link.toc-l2 {
  padding-left: 16px;
  font-size: 0.74rem;
}
.doc-toc-mobile {
  display: none;
  grid-column: 1 / -1;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
}
.doc-toc-mobile summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue);
}
.doc-toc-mobile-nav { margin-top: 10px; }

@media (max-width: 1024px) {
  .doc-layout {
    grid-template-columns: 1fr;
  }
  .doc-toc-rail { display: none; }
  .doc-toc-mobile { display: block; }
}

.doc-body h1.part,
.doc-body h2.topic {
  scroll-margin-top: 88px;
}