.deepdoc-hero {
  padding-top: clamp(48px, 7vw, 88px);
  padding-bottom: clamp(48px, 7vw, 82px);
}

.deepdoc-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  align-items: end;
  gap: clamp(32px, 6vw, 72px);
}

.deepdoc-hero-copy h1 {
  max-width: 16em;
  margin-top: 24px;
}

.deepdoc-lede {
  max-width: 48em;
  margin-bottom: 28px;
  color: var(--color-text-muted);
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.75;
}

.deepdoc-lede strong {
  color: var(--color-text);
}

.deepdoc-scope {
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: var(--radius-card-large);
  background: var(--color-stage);
  color: var(--color-stage-text);
  box-shadow: var(--shadow-stage);
}

.deepdoc-scope-label {
  color: var(--color-stage-text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.deepdoc-scope strong {
  color: var(--color-stage-text);
  font-size: 20px;
  line-height: 1.35;
}

.deepdoc-scope p {
  margin: 0;
  color: var(--color-stage-text);
  opacity: 0.76;
  font-size: 14px;
}

.deepdoc-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-border);
}

.deepdoc-fact {
  padding: 22px;
  background: var(--color-bg);
  color: var(--color-text);
}

.deepdoc-fact span {
  display: block;
  margin-bottom: 5px;
  color: var(--color-accent-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.deepdoc-fact strong {
  display: block;
  font-size: 16px;
}

.reference-layout {
  min-width: 0;
}

.reference-layout .jump-nav {
  top: 10px;
}

.doc-chapter {
  scroll-margin-top: 88px;
  margin-bottom: clamp(64px, 8vw, 104px);
}

.doc-chapter:last-child {
  margin-bottom: 0;
}

.chapter-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  margin-bottom: 30px;
}

.chapter-number {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--color-accent);
  color: var(--color-stage-text);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
}

.chapter-heading h2 {
  margin-bottom: 8px;
}

.chapter-heading p {
  max-width: 52em;
  margin: 0;
  color: var(--color-text-muted);
}

.doc-chapter h3 {
  margin-top: 42px;
}

.doc-chapter p,
.doc-chapter li {
  color: var(--color-text-muted);
}

.doc-chapter strong {
  color: var(--color-text);
}

.doc-chapter ul,
.doc-chapter ol {
  padding-left: 1.35em;
}

.doc-chapter li + li {
  margin-top: 10px;
}

.doc-chapter a:not(.button) {
  color: var(--color-accent-dark);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.doc-chapter a:not(.button):hover {
  color: var(--color-accent);
}

.manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0;
}

.manual-note {
  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
}

.manual-note h3,
.manual-note h4 {
  margin-top: 0;
}

.manual-note p {
  margin-bottom: 0;
}

.table-scroll {
  max-width: 100%;
  margin: 28px 0;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  -webkit-overflow-scrolling: touch;
}

.table-scroll .data-table {
  min-width: 720px;
}

.config-caption {
  margin: 32px 0 10px;
  color: var(--color-text);
  font-size: 14px;
  font-weight: 800;
}

.code-key {
  color: var(--color-stage-text);
}

.chapter-checklist {
  margin-top: 32px;
  padding: 26px;
  border-radius: var(--radius-card);
  background: var(--color-panel);
  color: var(--color-text);
}

.chapter-checklist h3 {
  margin-top: 0;
  font-size: 20px;
}

.chapter-checklist ol {
  margin-bottom: 0;
}

.deepdoc-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
}

.deepdoc-next p {
  max-width: 48em;
  color: var(--color-text-muted);
}

@media (max-width: 860px) {
  .deepdoc-hero-grid,
  .deepdoc-next {
    grid-template-columns: minmax(0, 1fr);
  }

  .deepdoc-scope {
    max-width: 520px;
  }

  .deepdoc-facts {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .chapter-heading {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .chapter-number {
    width: 42px;
    height: 42px;
  }

  .manual-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .reference-layout .jump-nav {
    position: relative;
    top: auto;
    align-items: stretch;
    flex-direction: column;
    border-radius: var(--radius-card);
  }

  .reference-layout .jump-nav a {
    width: 100%;
    white-space: normal;
  }

  .table-scroll .data-table {
    min-width: 640px;
  }
}