/* Developer guide — a typeset technical manual. The tide pool stays in the hero;
   the document below is quiet: one reading column, a sticky contents rail, code
   that can be copied, and callouts that say what kind of note they are. */

/* ── hero ────────────────────────────────────────────────────────────── */

.gd-hero.page-hero {
  min-height: clamp(420px, 52svh, 560px);
}

.gd-hero .page-hero__plate {
  object-position: 50% 38%;
}

.gd-hero::before {
  background:
    linear-gradient(to top, color-mix(in oklab, var(--bg-deep) 94%, transparent) 0%, color-mix(in oklab, var(--bg-deep) 52%, transparent) 52%, color-mix(in oklab, var(--bg-deep) 16%, transparent) 100%),
    linear-gradient(90deg, color-mix(in oklab, var(--bg-deep) 80%, transparent), transparent 70%);
}

.gd-hero__inner {
  grid-template-columns: minmax(0, 6.4fr) minmax(0, 5.6fr);
  align-items: end;
}

.gd-hero__copy {
  gap: 16px;
}

.gd-hero__copy .crumbs {
  color: var(--ink-2);
}

.gd-hero__title {
  max-width: none;
}

.gd-hero__note {
  max-width: 58ch;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.gd-hero__term {
  justify-self: stretch;
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--r-panel);
  background: var(--surface-glass);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-float), 0 0 0 1px color-mix(in oklab, var(--line) 60%, transparent) inset;
}

.gd-hero__term-label {
  font-size: 0.875rem;
  font-weight: 620;
}

.gd-hero__term .cmd code {
  white-space: normal;
  overflow-wrap: break-word;
}

.gd-hero__safety {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.gd-hero__safety code {
  white-space: nowrap;
}

@media (max-width: 900px) {
  .gd-hero__inner {
    grid-template-columns: 1fr;
  }

  .gd-hero.page-hero {
    min-height: 0;
  }

  .gd-hero__term .cmd {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px 12px 10px 16px;
  }

  .gd-hero__term .cmd .copy-btn {
    justify-self: start;
  }
}

/* ── layout: contents rail + reading column ─────────────────────────── */

.gd-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(32px, 4.4vw, 80px);
  align-items: start;
  padding-top: clamp(40px, 5vw, 72px);
  padding-bottom: var(--section);
}

.gd-toc {
  position: sticky;
  top: calc(var(--header-h) + var(--tank-inset) + 32px);
  max-height: calc(100svh - var(--header-h) - 72px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.gd-toc__summary {
  display: none;
}

.gd-toc__nav.toc {
  position: static;
}

.gd-toc__list {
  display: grid;
  gap: 2px;
}

.gd-toc__sub {
  display: grid;
  gap: 0;
  margin: 2px 0 6px;
}

.gd-toc__sub a {
  padding-left: 26px;
  font-size: 0.8125rem;
}

.gd-toc__sub a.is-active {
  padding-left: 25px;
}

.gd-toc__list > li > a {
  font-weight: 560;
}

.gd-doc {
  min-width: 0;
  max-width: 860px;
}

/* ── type for the document ───────────────────────────────────────────── */

.gd-sec + .gd-sec {
  margin-top: clamp(56px, 6vw, 88px);
  padding-top: clamp(40px, 4vw, 56px);
  border-top: 1px solid var(--line);
}

.gd-sec--chapter + .gd-sec--chapter,
.gd-sec + .gd-sec--chapter {
  margin-top: clamp(72px, 8vw, 120px);
}

.gd-kicker {
  margin-bottom: 10px;
  font-size: 0.875rem;
  font-weight: 620;
  color: var(--current);
}

[data-theme="dark"] .gd-kicker {
  color: var(--link);
}

.gd-h2 {
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  line-height: 1.12;
  font-weight: 650;
  font-stretch: 90%;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.gd-h2--chapter {
  font-size: clamp(2.1rem, 3.4vw, 3rem);
  font-stretch: 86%;
  line-height: 1.04;
}

.gd-h3 {
  margin-top: 36px;
  font-size: 1.25rem;
  font-weight: 640;
  letter-spacing: -0.012em;
}

.gd-h4 {
  margin-top: 28px;
  font-size: 1.0625rem;
  font-weight: 640;
}

.gd-h4 code {
  font-size: 0.9em;
}

.gd-p {
  margin-top: 12px;
  max-width: 68ch;
  color: var(--ink-2);
  line-height: 1.68;
  text-wrap: pretty;
}

.gd-p--lede {
  font-size: var(--fs-body-l);
  line-height: 1.55;
}

.gd-small {
  margin-top: 14px;
  max-width: 70ch;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-3);
}

.gd-doc :not(pre) > code {
  font-size: 0.84em;
  white-space: nowrap;
}

.gd-money {
  font-weight: 640;
  color: var(--ok);
}

/* ── code blocks ─────────────────────────────────────────────────────── */

.gd-code {
  margin-top: 16px;
  border-radius: var(--r-card);
  background: #0b2230;
  overflow: hidden;
}

[data-theme="dark"] .gd-code {
  background: #041018;
  box-shadow: 0 0 0 1px var(--line) inset;
}

.gd-code__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 8px 6px 16px;
  border-bottom: 1px solid rgb(255 255 255 / 0.07);
  font-size: 0.8125rem;
}

.gd-code__lang {
  flex: none;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgb(108 198 200 / 0.14);
  color: #8fd8d9;
  font-weight: 640;
  font-size: 0.75rem;
}

.gd-code__title {
  min-width: 0;
  color: #9db0b8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gd-code__copy {
  margin-left: auto;
}

.gd-code__pre.code {
  margin: 0;
  padding: 16px 18px 18px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: 0.8125rem;
  line-height: 1.65;
  tab-size: 2;
}

[data-theme="dark"] .gd-code__pre.code {
  box-shadow: none;
}

.gd-code__pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  font-weight: 400;
  color: #d8e6e8;
}

/* token colours: sea-glass for strings, lilac for keys, coral for numbers */
.tk-c { color: #6f8a93; font-style: italic; }
.tk-s { color: #9fe0c8; }
.tk-k { color: #c9bcf2; }
.tk-n { color: #ffb0a6; }
.tk-x { color: #8fd8d9; }
.tk-f { color: #f2c98a; }
.tk-p { color: #7f97a0; }

/* ── callouts ────────────────────────────────────────────────────────── */

.gd-callout {
  --tone: var(--held);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 14px;
  background: color-mix(in oklab, var(--tone) 10%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--tone) 22%, transparent) inset;
}

.gd-callout__k {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: color-mix(in oklab, var(--tone) 78%, var(--ink));
  white-space: nowrap;
}

.gd-callout__k::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}

.gd-callout__b {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.gd-callout--note {
  --tone: var(--data-3);
}

.gd-callout--important {
  --tone: var(--warn);
}

.gd-callout--key {
  --tone: var(--accent-ink);
}

.gd-callout--retry {
  --tone: var(--data-5);
}

/* ── start: checklist and the three parts ────────────────────────────── */

.gd-check {
  margin-top: 22px;
  border-radius: var(--r-card);
  background: var(--surface);
}

.gd-check__summary {
  list-style: none;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  cursor: pointer;
}

.gd-check__summary::-webkit-details-marker {
  display: none;
}

.gd-check__title {
  font-weight: 640;
}

.gd-check__count {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.gd-check[open] .qa__icon {
  background: var(--ink);
  box-shadow: none;
}

.gd-check[open] .qa__icon::before,
.gd-check[open] .qa__icon::after {
  background: var(--ink-inverse);
}

.gd-check[open] .qa__icon::after {
  transform: rotate(0deg);
}

.gd-check__list {
  display: grid;
  padding: 0 20px;
}

.gd-check__list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-2);
}

.gd-check__n,
.gd-steps__n {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong) inset;
  font-size: 0.75rem;
  font-weight: 660;
  color: var(--ink);
}

.gd-check__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px 20px;
}

.gd-parts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.gd-part {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 18px 20px;
  border-radius: var(--r-card);
  box-shadow: 0 0 0 1px var(--line) inset;
  transition: box-shadow var(--t-med), background-color var(--t-med), transform var(--t-med) var(--ease-out);
}

.gd-part:hover {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-strong) inset;
  transform: translateY(-2px);
}

.gd-part__title {
  font-weight: 640;
}

.gd-part__body {
  font-size: 0.875rem;
  color: var(--ink-2);
}

@media (max-width: 760px) {
  .gd-parts {
    grid-template-columns: 1fr;
  }
}

/* ── quick start ─────────────────────────────────────────────────────── */

.gd-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.gd-pair__item {
  min-width: 0;
  padding: 20px;
  border-radius: var(--r-card);
  background: var(--surface);
}

.gd-pair__item .gd-h3 {
  margin-top: 0;
  font-size: 1.0625rem;
}

.gd-pair__item .gd-p {
  margin-top: 6px;
  font-size: 0.9375rem;
}

.gd-flowline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.gd-flowline li {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding-inline: 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2);
}

.gd-flowline li:last-child {
  background: var(--ok-soft);
  color: color-mix(in oklab, var(--ok) 80%, var(--ink));
}

.gd-steps {
  display: grid;
  margin-top: 14px;
}

.gd-steps li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.9375rem;
}

.gd-ladder {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
}

.gd-ladder li {
  display: grid;
  gap: 2px;
  padding: 12px 14px 12px;
  border-radius: 12px;
  background: var(--surface);
  border-bottom: 3px solid var(--rung, var(--line));
}

.gd-ladder li:nth-child(1) { --rung: var(--line-strong); }
.gd-ladder li:nth-child(2) { --rung: var(--data-1); }
.gd-ladder li:nth-child(3) { --rung: var(--data-3); }
.gd-ladder li:nth-child(4) { --rung: var(--data-4); }
.gd-ladder li:nth-child(5) { --rung: var(--accent); }

.gd-ladder__name {
  font-weight: 640;
  font-size: 0.9375rem;
}

.gd-ladder__pts {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

@media (max-width: 760px) {
  .gd-pair {
    grid-template-columns: 1fr;
  }

  .gd-ladder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── endpoints ───────────────────────────────────────────────────────── */

.gd-eps {
  display: grid;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.gd-ep {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
}

.gd-ep__path.gd-ep__path {
  padding: 0;
  background: none;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
}

.gd-ep__desc {
  grid-column: 2 / -1;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.gd-ep__desc code {
  white-space: normal !important;
  overflow-wrap: anywhere;
}

.gd-ep--feature {
  margin-top: 14px;
  padding: 16px 18px;
  border: 0;
  border-radius: var(--r-card);
  background: var(--surface);
}

.gd-method {
  justify-self: start;
  min-width: 52px;
  padding: 4px 0;
  border-radius: 8px;
  text-align: center;
  font-family: var(--font-code);
  font-size: 0.71875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gd-method--post {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.gd-method--get {
  background: var(--held-soft);
  color: color-mix(in oklab, var(--held) 82%, var(--ink));
}

.gd-auth,
.gd-ep__badge {
  justify-self: end;
}

.gd-auth {
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 640;
  white-space: nowrap;
}

.gd-auth--cph {
  background: color-mix(in oklab, var(--data-3) 16%, transparent);
  color: color-mix(in oklab, var(--data-3) 72%, var(--ink));
}

.gd-auth--pub {
  background: var(--surface-2);
  color: var(--ink-2);
}

.gd-auth--jwt {
  background: var(--warn-soft);
  color: color-mix(in oklab, var(--warn) 76%, var(--ink));
}

/* ── categories ──────────────────────────────────────────────────────── */

.gd-cats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.gd-cat {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--r-card);
  background: var(--surface);
}

.gd-cat__pic {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

.gd-cat__pic img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gd-cat__dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--cat, var(--lilac)) 62%, color-mix(in oklab, var(--cat, var(--lilac)) 70%, #0b2230));
}

.gd-cat--frontend { --cat: #f3a597; }
.gd-cat--backend { --cat: #8fd0c6; }
.gd-cat--devops { --cat: #9ec5e6; }
.gd-cat--ml { --cat: #c9bcec; }
.gd-cat--security { --cat: #e8c98a; }
.gd-cat--data { --cat: #a9d7b9; }

.gd-cat__name {
  font-weight: 640;
}

.gd-cat__stack {
  font-size: 0.8125rem;
  color: var(--ink-3);
}

@media (max-width: 760px) {
  .gd-cats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── figures (big thin numerals) ─────────────────────────────────────── */

.gd-figs {
  display: grid;
  gap: 0;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.gd-figs--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gd-figs--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.gd-fig {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 8px;
  padding: 20px 18px 18px 0;
}

.gd-fig + .gd-fig {
  padding-left: 18px;
  border-left: 1px solid var(--line-soft);
}

.gd-fig dt {
  font-size: 0.875rem;
  color: var(--ink-2);
}

.gd-fig__v {
  margin: 0;
  font-size: clamp(2.2rem, 3.6vw, 3.2rem);
  font-weight: 340;
  font-stretch: 82%;
  letter-spacing: -0.04em;
  line-height: 0.95;
}

.gd-fig__v span {
  font-size: 0.42em;
  font-weight: 600;
  font-stretch: 100%;
  letter-spacing: 0;
  color: var(--ink-3);
}

.gd-fee-promo {
  position: relative;
  margin-top: 12px;
  padding-left: 16px;
  font-size: 0.875rem;
  color: var(--ink-2);
}

.gd-fee-promo::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.gd-pay__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-top: 18px;
}

.gd-pay__foot .gd-small {
  margin-top: 0;
  max-width: 56ch;
}

@media (max-width: 760px) {
  .gd-figs--3,
  .gd-figs--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gd-fig + .gd-fig {
    padding-left: 0;
    border-left: 0;
  }

  .gd-fig:nth-child(even) {
    padding-left: 16px;
    border-left: 1px solid var(--line-soft);
  }

  .gd-figs--3 .gd-fig:nth-child(3) {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line-soft);
  }
}

/* ── onboarding ──────────────────────────────────────────────────────── */

.gd-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 28px;
}

.gd-rail::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 18px;
  right: 18px;
  height: 1px;
  background: var(--line-strong);
}

.gd-rail a {
  position: relative;
  display: grid;
  gap: 10px;
  justify-items: start;
  padding-right: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: color var(--t-fast);
}

.gd-rail a:hover {
  color: var(--ink);
}

.gd-rail__n {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line-strong) inset;
  font-size: 0.8125rem;
  font-weight: 680;
  color: var(--ink);
  transition: background-color var(--t-med), color var(--t-med), box-shadow var(--t-med);
}

.gd-rail a:hover .gd-rail__n,
.gd-rail a.is-active .gd-rail__n {
  background: var(--ink);
  color: var(--ink-inverse);
  box-shadow: none;
}

.gd-step {
  margin-top: 40px;
  padding: clamp(20px, 2.6vw, 32px);
  border-radius: var(--r-panel);
  background: var(--surface);
}

.gd-step__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.014em;
}

.gd-step__n {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--ink-inverse);
  font-size: 0.875rem;
  font-weight: 700;
}

.gd-step .gd-code {
  max-width: 100%;
}

.gd-fields {
  display: grid;
  margin-top: 14px;
}

.gd-fields > div {
  display: grid;
  grid-template-columns: minmax(150px, 2.2fr) minmax(0, 5fr);
  gap: 4px 20px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}

.gd-fields dt {
  font-weight: 620;
  font-size: 0.9375rem;
}

.gd-fields dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.gd-fields--tight > div {
  padding: 9px 0;
}

.gd-fields--ok dt {
  position: relative;
  padding-left: 24px;
}

.gd-fields--ok dt::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.22em;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ok);
}

.gd-fields--ok dt::after {
  content: "";
  position: absolute;
  left: 4.6px;
  top: calc(0.22em + 4.4px);
  width: 6.4px;
  height: 3.6px;
  border-left: 1.6px solid #fff;
  border-bottom: 1.6px solid #fff;
  transform: rotate(-45deg);
}

.gd-tokens {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  vertical-align: middle;
}

.gd-probe {
  margin-top: 26px;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}

.gd-score__title {
  margin-top: 18px;
  font-size: 0.875rem;
  font-weight: 640;
}

.gd-score {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.gd-score li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 4px 0 11px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  font-size: 0.8125rem;
  font-weight: 560;
}

.gd-score li code {
  padding: 0;
  background: none;
}

.gd-score li b {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 22px;
  padding-inline: 6px;
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ok);
}

.gd-score__total {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-weight: 620;
}

.gd-pits {
  display: grid;
  margin-top: 12px;
}

.gd-pits > div {
  position: relative;
  display: grid;
  grid-template-columns: minmax(170px, 2.4fr) minmax(0, 5fr);
  gap: 4px 20px;
  padding: 12px 0 12px 26px;
  border-top: 1px solid var(--line-soft);
}

.gd-pits > div::before,
.gd-pits > div::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 21px;
  width: 11px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--bad);
  transform: rotate(45deg);
}

.gd-pits > div::after {
  transform: rotate(-45deg);
}

.gd-pits dt {
  font-weight: 620;
  font-size: 0.9375rem;
}

.gd-pits dd {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.gd-pits dd code {
  white-space: normal !important;
}

.gd-table-wrap {
  margin-top: 16px;
  box-shadow: 0 0 0 1px var(--line-soft) inset;
}

.gd-table th[scope="row"] {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9rem;
  white-space: normal;
}

.gd-table td {
  color: var(--ink-2);
}

.gd-step--ref {
  background: transparent;
  padding-inline: 0;
}

.gd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}

@media (max-width: 760px) {
  .gd-rail {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gd-rail::before {
    top: 17px;
    bottom: 17px;
    left: 17px;
    right: auto;
    width: 1px;
    height: auto;
  }

  .gd-rail a {
    grid-auto-flow: column;
    justify-content: start;
    align-items: center;
    gap: 14px;
  }

  .gd-fields > div,
  .gd-pits > div {
    grid-template-columns: 1fr;
  }
}

/* ── platform flow ───────────────────────────────────────────────────── */

.gd-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 26px;
}

.gd-strip li {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 620;
}

.gd-strip li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -6px;
  width: 6px;
  height: 1px;
  background: var(--line-strong);
}

.gd-strip__n {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 0.75rem;
  font-weight: 700;
}

.gd-strip li:nth-child(2) .gd-strip__n { background: var(--held-soft); color: var(--held); }
.gd-strip li:nth-child(5) .gd-strip__n { background: var(--ok-soft); color: var(--ok); }

.gd-phases {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.gd-phase {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: var(--r-panel);
  background: var(--surface);
}

.gd-phase__n {
  font-size: 1.75rem;
  font-weight: 340;
  font-stretch: 82%;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink-3);
}

.gd-phase__title {
  font-size: 1.1875rem;
  font-weight: 650;
}

.gd-phase .gd-p:first-of-type {
  margin-top: 6px;
}

.gd-bullets {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.gd-bullets li {
  position: relative;
  padding-left: 20px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.gd-bullets li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--held);
}

.gd-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 4px;
}

.gd-split > div {
  display: flex;
  flex-direction: column-reverse;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-2);
}

.gd-split dt {
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.gd-split dd {
  margin: 0;
  font-size: 2rem;
  font-weight: 360;
  font-stretch: 84%;
  letter-spacing: -0.035em;
  line-height: 1;
}

.gd-tier {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 50%;
  vertical-align: 0.05em;
}

.gd-tier--1 { background: var(--line-strong); }
.gd-tier--2 { background: var(--data-1); }
.gd-tier--3 { background: var(--data-3); }
.gd-tier--4 { background: var(--data-4); }
.gd-tier--5 { background: var(--accent); }

.gd-roles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.gd-role {
  padding: 18px 20px;
  border-radius: var(--r-card);
  box-shadow: 0 0 0 1px var(--line) inset;
}

.gd-role--both {
  background: var(--surface);
  box-shadow: none;
}

.gd-role__title {
  font-weight: 640;
}

.gd-role__body {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--ink-2);
}

@media (max-width: 860px) {
  .gd-strip {
    grid-template-columns: 1fr;
  }

  .gd-strip li {
    grid-template-columns: 26px 1fr;
    align-items: center;
  }

  .gd-strip li:not(:last-child)::after {
    top: auto;
    bottom: -6px;
    left: 26px;
    right: auto;
    width: 1px;
    height: 6px;
  }

  .gd-roles {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .gd-phase {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* ── API reference ───────────────────────────────────────────────────── */

.gd-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 20px;
  padding: 14px 16px 14px 18px;
  border-radius: var(--r-card);
  background: var(--surface);
}

.gd-base__url {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.gd-base__k {
  font-size: 0.875rem;
  font-weight: 620;
  color: var(--ink-2);
}

.gd-base__url code {
  font-size: 0.9375rem;
}

.gd-authcards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.gd-authcard {
  padding: 20px;
  border-radius: var(--r-card);
  background: var(--surface);
  border-top: 3px solid var(--data-3);
}

.gd-authcard--user {
  border-top-color: var(--warn);
}

.gd-authcard__title {
  font-weight: 640;
}

.gd-authcard__body {
  margin-top: 6px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.gd-authcard__body code {
  white-space: normal !important;
}

@media (max-width: 760px) {
  .gd-authcards {
    grid-template-columns: 1fr;
  }

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

  .gd-auth,
  .gd-ep__badge {
    grid-column: 2;
    justify-self: start;
  }

  .gd-ep__desc {
    grid-column: 1 / -1;
  }
}

/* ── contents rail on small screens: a collapsible "On this page" ───── */

@media (max-width: 1000px) {
  .gd-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .gd-toc {
    position: relative;
    top: auto;
    max-height: none;
    overflow: visible;
    border-radius: var(--r-card);
    background: var(--surface);
  }

  .gd-toc__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    font-weight: 640;
    cursor: pointer;
    list-style: none;
  }

  .gd-toc__summary::-webkit-details-marker {
    display: none;
  }

  .gd-toc[open] .gd-toc__caret {
    transform: rotate(180deg);
  }

  .gd-toc__caret {
    transition: transform var(--t-med) var(--ease-out);
  }

  .gd-toc__nav.toc {
    padding: 0 18px 16px;
  }
}

.gd-toc a.is-parent {
  color: var(--ink);
}

/* 中文 headings: keep phrases together; break at punctuation or a zero-width hint */
:lang(zh) .gd-hero__title,
:lang(zh) .gd-h2,
:lang(zh) .gd-h3,
:lang(zh) .gd-step__title,
:lang(zh) .gd-phase__title {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
