.subpage {
  position: relative;
  isolation: isolate;
  padding-block-end: clamp(52px, 7vw, 100px);
  color: var(--tp-ink-primary);
}

.subpage [id] { scroll-margin-top: calc(var(--tp-nav-height, 64px) + 24px); }
.subpage a { text-underline-offset: .2em; }
.subpage code, .subpage pre { font-family: var(--tp-font-mono); }

.sub-hero {
  padding-block: clamp(48px, 7.5vw, 105px) clamp(35px, 5.5vw, 72px);
}

.sub-hero-split {
  display: grid;
  align-items: center;
  gap: clamp(30px, 6vw, 98px);
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
}

.sub-hero h1,
.sub-section h2,
.sub-doc-content h2 {
  margin: 0;
  letter-spacing: -.015em;
  text-wrap: balance;
}

.sub-hero h1 {
  max-width: 17ch;
  font-size: clamp(39px, 5vw, 70px);
  font-weight: 720;
  line-height: 1.13;
}

.sub-lead {
  max-width: 47ch;
  margin: 20px 0 0;
  color: var(--tp-ink-secondary);
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.75;
  text-wrap: pretty;
}

.sub-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 26px; }
.sub-actions .button { min-height: 44px; white-space: nowrap; }

.sub-detail {
  margin: 18px 0 0;
  color: var(--tp-ink-secondary);
  font-size: 14px;
  line-height: 1.72;
}

.sub-detail a, .sub-doc-content a:not(.button), .sub-disclosure a { color: var(--tp-accent); }

.sub-section { margin-block-start: clamp(43px, 6.5vw, 90px); }
.sub-section-first { margin-block-start: 0; }
.sub-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-block-end: 20px;
}

.sub-section-heading h2, .sub-feature h2, .sub-doc-content h2 {
  font-size: clamp(26px, 3.2vw, 37px);
  font-weight: 670;
  line-height: 1.25;
}

.sub-section-heading p { margin: 0; color: var(--tp-ink-secondary); font-size: 14px; }
.sub-grid { display: grid; gap: 16px; margin: 0; padding: 0; }
.sub-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sub-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sub-grid-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.sub-card, .sub-brief {
  min-width: 0;
  padding: clamp(18px, 2.5vw, 29px);
  border-top: var(--bp-hairline-w) solid var(--tp-border-strong);
}

.sub-card h3, .sub-feature h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.sub-card p, .sub-feature p { margin: 8px 0 0; color: var(--tp-ink-secondary); line-height: 1.7; overflow-wrap: anywhere; }
.sub-card > :first-child { margin-block-start: 0; }
.sub-card > .sub-inline-link { margin-block-start: 10px; }
.sub-card code { font-size: 13px; }

.sub-inline-link {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  min-height: 44px;
  color: var(--tp-accent);
  font-weight: 550;
  white-space: nowrap;
}

.sub-steps { list-style: none; counter-reset: sub-step; }
.sub-steps li { counter-increment: sub-step; }
.sub-steps li::before {
  display: grid;
  width: 36px;
  height: 36px;
  margin-block-end: 14px;
  place-items: center;
  border: 1px solid var(--tp-border-accent);
  border-radius: 10px;
  background: var(--tp-accent-soft);
  color: var(--tp-accent);
  font: 600 12px/1 var(--tp-font-mono);
  content: counter(sub-step, decimal-leading-zero);
}

.sub-disclosures { border-block-end: 1px solid var(--tp-border-strong); }
.sub-disclosure { border-block-start: 1px solid var(--tp-border-strong); }
.sub-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 55px;
  padding-block: 13px;
  color: var(--tp-ink-primary);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.sub-disclosure summary::-webkit-details-marker { display: none; }
.sub-disclosure summary::after {
  width: 12px;
  height: 12px;
  flex: none;
  background:
    linear-gradient(currentColor, currentColor) center / 12px 1px,
    linear-gradient(currentColor, currentColor) center / 1px 12px;
  background-repeat: no-repeat;
  color: var(--tp-ink-secondary);
  transition: transform 180ms ease;
  content: "";
}

.sub-disclosure[open] summary::after { transform: rotate(45deg); }
.sub-disclosure > div { padding-block-end: 15px; }
.sub-disclosure p { margin: 0 0 4px; color: var(--tp-ink-secondary); line-height: 1.72; }
.sub-disclosure pre { margin: 0 0 12px; padding: 16px; overflow: auto; background: var(--tp-bg-surface-2); border-radius: var(--tp-radius-md); }

.sub-brief h2 { margin: 0; font-size: 19px; }
.sub-facts { margin: 13px 0 0; }
.sub-facts div { display: flex; flex-wrap: wrap; gap: 5px 18px; justify-content: space-between; padding-block: 12px; border-bottom: 1px solid var(--tp-border-hairline); }
.sub-facts dt { font-weight: 600; }
.sub-facts dd { margin: 0; color: var(--tp-ink-secondary); }

.sub-contact-id { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; margin-block: 12px; }
.sub-contact-id strong { font: 600 clamp(20px, 3.2vw, 31px)/1.25 var(--tp-font-mono); }
.sub-contact-id .button { min-height: 44px; }
.sub-qr { margin-block-start: 12px; }
.sub-qr img { display: block; max-width: min(240px, 100%); height: auto; border: 1px solid var(--tp-border-strong); border-radius: 12px; }

.sub-feature {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: clamp(18px, 4vw, 50px);
  padding: clamp(23px, 4vw, 49px);
  border-block: var(--bp-hairline-w) solid var(--tp-border-hairline);
  background: var(--tp-bg-surface-2);
}

.sub-feature .section-kicker { margin: 0 0 10px; }
.sub-feature .button { margin-block-start: 20px; }
.sub-feature .sub-steps { gap: 18px; }
.sub-feature li { position: relative; padding-inline-start: 47px; }
.sub-feature li::before { position: absolute; inset: 0 auto auto 0; }

.sub-docs { display: grid; align-items: start; grid-template-columns: 190px minmax(0, 800px); gap: clamp(20px, 5vw, 64px); }
.sub-doc-sidebar {
  position: sticky;
  top: calc(var(--tp-nav-height, 64px) + 25px);
  padding: 10px;
  border: 1px solid var(--tp-border-strong);
  border-radius: var(--tp-radius-md);
  background: var(--tp-bg-surface-1);
}

.sub-doc-sidebar nav { display: grid; }
.sub-doc-sidebar a { display: flex; align-items: center; min-height: 44px; padding-inline: 12px; border-radius: 8px; color: var(--tp-ink-secondary); font-size: 14px; text-decoration: none; }
.sub-doc-sidebar a:hover, .sub-doc-sidebar a:focus-visible { background: var(--tp-accent-soft); color: var(--tp-accent); }
.sub-doc-content { min-width: 0; }
.sub-doc-content > section { padding: 26px 0 32px; border-bottom: 1px solid var(--tp-border-strong); }
.sub-doc-content > section:first-child { padding-block-start: 2px; }
.sub-doc-content p, .sub-doc-content li { color: var(--tp-ink-secondary); line-height: 1.75; }
.sub-doc-content strong { color: var(--tp-ink-primary); }
.sub-doc-list { margin-block: 13px; padding-inline-start: 1.35em; }
.sub-doc-list li + li { margin-top: 5px; }
.sub-doc-content p code, .sub-doc-content li code { overflow-wrap: anywhere; }
.sub-code-group { display: grid; gap: 7px; margin-block: 16px; }
.sub-copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--tp-border-hairline);
  border-radius: var(--tp-radius-md);
  background: var(--tp-bg-surface-2);
}

.sub-copy-row strong { display: block; margin-bottom: 4px; font-size: 13px; }
.sub-copy-row code { color: var(--tp-ink-secondary); font-size: 13px; overflow-wrap: anywhere; }
.sub-copy-row .button { flex: 0 0 auto; min-height: 44px; white-space: nowrap; }
.sub-code-panel { margin-block: 17px; overflow: hidden; border: 1px solid #39393d; border-radius: var(--tp-radius-md); background: var(--tp-bg-terminal, #0b111e); color: #e4e4e7; }
.sub-code-panel > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 12px; border-bottom: 1px solid #39393d; background: var(--tp-bg-terminal-bar, #111a2c); }
.sub-doc-content .sub-code-panel strong { color: #e4e4e7; font: 13px/1.5 var(--tp-font-mono); }
.sub-code-panel .button { min-height: 44px; border-color: #465775; background: #18263c; color: #f1f5ff; }
.sub-code-panel pre { margin: 0; padding: 16px; overflow: auto; color: #e4e4e7; font: 13px/1.7 var(--tp-font-mono); }

@media (max-width: 900px) {
  .sub-hero-split { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 24px; }
  .sub-grid-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sub-docs { grid-template-columns: 160px minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 767px) {
  .sub-hero-split, .sub-feature, .sub-docs, .sub-grid-three { grid-template-columns: minmax(0, 1fr); }
  .sub-hero { padding-block: 38px 34px; }
  .sub-hero h1 { font-size: clamp(34px, 7vw, 53px); }
  .sub-lead { margin-top: 14px; }
  .sub-doc-sidebar { position: static; }
  .sub-doc-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .sub-hero .sub-actions { display: grid; grid-template-columns: 1fr; }
  .sub-hero .sub-actions .button { justify-content: center; width: 100%; }
  .sub-grid-two, .sub-grid-four { grid-template-columns: minmax(0, 1fr); }
  .sub-copy-row { padding-inline: 11px; }
  .sub-copy-row code { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .sub-disclosure summary::after { transition: none; }
}
