/* Shared reading surfaces for guides and document routes. */
body.document-page .use-case-figure { margin: 2rem 0 0; }
body.document-page .use-case-figure img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; border: 1px solid var(--line); border-radius: .6rem; }

body.document-page .document-hero,
body.document-page .document-content {
  font-size: 17px;
  line-height: 1.7;
}

body.document-page .document-hero .button,
body.document-page .document-content .button {
  font-size: 1.05rem;
  line-height: 1.45;
}

body.document-page .document-shell {
  width: min(1040px, calc(100% - 2 * var(--pad)));
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(5rem, 10vw, 8rem);
}

body.document-page .document-hero {
  max-width: 75ch;
  margin: 0 auto;
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

body.document-page .document-hero .crumb,
body.document-page .crumb {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: .9rem;
}

body.document-page .crumb a {
  color: var(--ink);
}

body.document-page .document-hero h1,
body.document-page .document-content h1 {
  max-width: 48rem;
  margin: 0;
  font-size: clamp(2.35rem, 5vw, 3rem);
  line-height: 1.05;
}

body.document-page .document-hero .lede,
body.document-page .lede {
  max-width: 68ch;
  margin: 1.35rem 0 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.45;
}

body.document-page .document-content {
  max-width: 75ch;
  margin: 0 auto;
}

body.document-page .document-content > * + * {
  margin-top: 1.35rem;
}

body.document-page .document-content p,
body.document-page .document-content li,
body.document-page .document-content blockquote {
  max-width: 75ch;
}

body.document-page .document-content p {
  margin-bottom: 0;
}

body.document-page .document-content a:not(.button):not(.gcard) {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: .08em;
  text-underline-offset: .18em;
}

body.document-page .document-content a:not(.button):not(.gcard):hover {
  text-decoration-thickness: .14em;
}

body.document-page .document-content h2,
body.document-page .document-content h3,
body.document-page .document-content h4 {
  font-family: Sora, Arial, sans-serif;
  font-weight: 620;
  scroll-margin-top: 1.5rem;
}

body.document-page .document-content h2 {
  margin-top: clamp(2.8rem, 6vw, 4.4rem);
  font-size: clamp(1.65rem, 3.2vw, 2.15rem);
  line-height: 1.15;
}

body.document-page .document-content h3 {
  margin-top: 2.4rem;
  font-size: 1.35rem;
  line-height: 1.25;
}

body.document-page .document-content h4 {
  margin-top: 2rem;
  font-size: 1.1rem;
}

body.document-page .document-content ul,
body.document-page .document-content ol {
  margin: 1rem 0 0 1.5rem;
  padding: 0;
}

body.document-page .document-content li + li {
  margin-top: .45rem;
}

body.document-page .document-content blockquote {
  margin: 1.8rem 0 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  background: #fff1ed;
  color: var(--ink);
}

body.document-page .document-content hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

body.document-page .document-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .84em;
}

body.document-page .document-content :not(pre) > code {
  padding: .12em .35em;
  border: 1px solid var(--line);
  border-radius: .2rem;
  background: var(--soft);
  color: var(--ink);
}

body.document-page .document-content pre {
  max-width: none;
  margin: 1.8rem 0 0;
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--soft);
  color: var(--ink);
  white-space: pre;
  tab-size: 2;
}

body.document-page .document-content pre code {
  display: block;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}

/* Static build-time tokens stay readable on the light code surface. */
body.document-page .tok-com { color: #676762; font-style: italic; }
body.document-page .tok-str { color: #8a321e; }
body.document-page .tok-num { color: #7a4e00; }
body.document-page .tok-kw { color: #17663a; font-weight: 650; }
body.document-page .tok-bi { color: #155e75; }
body.document-page .tok-var { color: #7a4e00; }
body.document-page .tok-key { color: #5b3d8b; }
body.document-page .tok-sec { color: #17663a; font-weight: 650; }
body.document-page .tok-flag { color: #676762; }

body.document-page .table-wrap,
body.document-page .matrix-wrap {
  max-width: none;
  margin: 1.8rem 0 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--paper);
}

body.document-page .document-wide {
  max-width: none;
}

body.document-page table,
body.document-page .matrix {
  width: 100%;
  min-width: 38rem;
  border-collapse: collapse;
  font-size: .95rem;
  line-height: 1.45;
}

body.document-page th,
body.document-page td {
  padding: .8rem .9rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

body.document-page th {
  background: var(--soft);
  font-weight: 650;
}

body.document-page .doc-callout,
body.document-page .cta,
body.document-page .card {
  margin-top: clamp(3rem, 7vw, 5rem);
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--soft);
}

body.document-page .doc-callout h2,
body.document-page .cta h3,
body.document-page .card h2,
body.document-page .card h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

body.document-page .doc-callout p,
body.document-page .cta p,
body.document-page .card p {
  margin-top: .8rem;
}

body.document-page .doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.2rem;
}

body.document-page .gwrap {
  display: grid;
  gap: 0;
  margin-top: 0;
  border-top: 1px solid var(--line);
}

body.document-page .gcard {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 1.3rem;
  align-items: start;
  padding: 1.35rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
}

body.document-page .gcard:hover {
  background: var(--soft);
  transform: none;
}

body.document-page .gart {
  display: grid;
  place-items: center;
  min-height: 5.5rem;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--red-dark);
}

body.document-page .gart svg {
  width: 3rem;
  height: 3rem;
}

body.document-page .gbody {
  padding: 0;
}

body.document-page .gchip {
  display: inline-block;
  margin-bottom: .45rem;
  padding: .1rem .45rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
}

body.document-page .gchip--security { color: var(--red-dark); }
body.document-page .gchip--cost { color: #7a4e00; }
body.document-page .gchip--routing { color: #155e75; }
body.document-page .gchip--efficiency { color: #17663a; }

body.document-page .gcard h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

body.document-page .gcard p {
  margin: .45rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

body.document-page .gcard .go {
  display: inline-block;
  margin-top: .65rem;
  color: var(--ink);
  font-size: .95rem;
  font-weight: 650;
  text-decoration: underline;
}

@media (max-width: 700px) {
  body.document-page .document-shell {
    padding-top: 3rem;
  }

  body.document-page .gcard {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 1rem;
  }

  body.document-page .gart {
    min-height: 4.5rem;
  }

  body.document-page .gart svg {
    width: 2.5rem;
    height: 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.document-page .gcard:hover {
    transform: none;
  }
}
