:root {
  --doc-hero-max: 940px;
  --doc-section-gap: clamp(68px, 8vw, 104px);
  --doc-copy-size: 16px;
  --doc-rule-width: 52px;
}

.doc-hero {
  padding-top: clamp(64px, 8vw, 104px);
  padding-bottom: clamp(44px, 6vw, 76px);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.doc-hero .reading-wrap {
  max-width: var(--doc-hero-max);
  text-align: center;
}

.doc-hero h1 {
  margin-right: auto;
  margin-left: auto;
}

.doc-lead {
  max-width: 780px;
  margin-right: auto;
  margin-bottom: 0;
  margin-left: auto;
  color: var(--color-muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.8;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.doc-intro-note {
  max-width: 820px;
  margin: 32px auto 0;
  text-align: left;
}

.doc-intro-note a {
  color: var(--color-accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-shell {
  padding-top: 34px;
  padding-bottom: var(--section-space);
}

.doc-shell .toc-tabs {
  margin: 0 auto;
}

.handbook-body {
  width: 100%;
  max-width: var(--reading-max);
  margin: 0 auto;
  font-size: var(--doc-copy-size);
}

.doc-section {
  position: relative;
  padding-top: var(--doc-section-gap);
  padding-bottom: 10px;
}

.doc-section + .doc-section {
  margin-top: 16px;
  border-top: 1px solid var(--color-border);
}

.doc-section > .section-number {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  color: var(--color-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
}

.doc-section > .section-number::after {
  width: var(--doc-rule-width);
  height: 1px;
  background: var(--color-accent);
  content: "";
}

.handbook-body h2 {
  margin-top: 0;
  margin-bottom: 32px;
}

.handbook-body h3 {
  margin-top: 42px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--color-border);
  font-size: clamp(20px, 2.2vw, 25px);
}

.handbook-body p {
  color: var(--color-muted);
  line-height: 1.9;
}

.handbook-body p + p {
  margin-top: 1.15em;
}

.handbook-body .callout {
  margin-top: 30px;
  margin-bottom: 30px;
}

.handbook-body .table-scroll {
  margin-top: 32px;
  margin-bottom: 38px;
}

.handbook-body .comparison-table {
  min-width: 680px;
}

.handbook-body pre {
  margin-top: 24px;
  margin-bottom: 28px;
  line-height: 1.7;
}

.ticket-checklist {
  margin-top: 36px;
  margin-bottom: 40px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-m);
  background: var(--color-panel);
  box-shadow: var(--shadow-card);
}

.ticket-checklist h3 {
  margin-top: 0;
}

.ticket-checklist pre {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .doc-hero {
    padding-top: 48px;
  }

  .doc-shell {
    padding-top: 22px;
  }

  .doc-section {
    padding-top: 62px;
  }

  .handbook-body h3 {
    margin-top: 34px;
  }
}

@media (max-width: 640px) {
  .doc-meta {
    align-items: center;
    flex-direction: column;
  }

  .doc-meta .badge,
  .doc-meta .chip {
    justify-content: center;
  }

  .handbook-body {
    font-size: 15.5px;
  }

  .doc-section > .section-number::after {
    flex: 1;
    width: auto;
  }

  .ticket-checklist {
    padding: 18px;
  }
}