/* Billing integration docs. The same design system as the service's own
   pages — tokens, top bar, side navigation, cards — reduced to what a reading
   surface needs. Light only. Ships in the integration package, so it stands
   alone and does not import the service stylesheet. */
:root {
  --brand: #0f6b4f;
  --brand-hover: #0c5b43;
  --brand-text: #0c5b43;
  --brand-soft: #edf6f1;
  --brand-line: #c6e1d4;
  --page: #f3f4f2;
  --surface: #ffffff;
  --sunken: #f6f7f5;
  --code-bg: #f4f5f3;
  --line: #e2e4e0;
  --line-soft: #eceeea;
  --text: #151816;
  --body: #2e3330;
  --muted: #59605b;
  --faint: #646b66;
  --warn-bg: #fcedb9;
  --warn-text: #983705;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm:
    0 0 0 1px rgba(21, 24, 22, 0.08), 0 1px 3px rgba(21, 24, 22, 0.08);
  --topbar: 56px;
  --sidebar: 232px;

  color-scheme: light;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    sans-serif;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--body);
  background: var(--page);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding-top: var(--topbar);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--brand-text);
  text-decoration: none;
}
a:hover {
  color: var(--brand);
  text-decoration: underline;
}
/* Links in running text are underlined: colour alone barely sets them apart
   from the body text. */
article :is(p, li, td) a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: from-font;
}
/* An outline, not a box-shadow: forced-colors mode drops shadows. */
:where(a, summary):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
/* The skip link's landing spot only receives focus from it. */
[tabindex="-1"]:focus {
  outline: none;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--surface);
  color: var(--brand-text);
  padding: 10px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}
/* Small caps tracking is for Latin; spread over Chinese it reads as single
   characters, and Chinese strokes need at least 12px. */
:lang(zh) :is(.eyebrow, .docs-nav > span, article th) {
  letter-spacing: 0;
  font-size: max(0.8571rem, 12px);
}

/* ---------------------------------------------------------------- top bar */
.docs-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
  color: var(--text);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}
.docs-tag {
  margin-left: 2px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: 11.5px;
  font-weight: 600;
}
.docs-topbar .spacer {
  flex: 1;
}
.docs-topbar a:not(.brand):not(.button) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.docs-topbar a:not(.brand):not(.button):hover {
  color: var(--text);
  background: var(--sunken);
  text-decoration: none;
}
.docs-topbar .button {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
}
.docs-topbar .button:hover {
  background: var(--brand-hover);
  color: #fff;
  text-decoration: none;
}
.docs-version {
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
}

/* -------------------------------------------------------------- side nav */
.docs-shell {
  display: flex;
  min-height: calc(100vh - var(--topbar));
}
.docs-nav {
  position: sticky;
  top: var(--topbar);
  align-self: flex-start;
  height: calc(100vh - var(--topbar));
  overflow-y: auto;
  flex: 0 0 var(--sidebar);
  padding: 16px 12px 24px;
  border-right: 1px solid var(--line);
  background: var(--page);
}
.docs-nav > span {
  display: block;
  margin: 14px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.docs-nav > span:first-child {
  margin-top: 0;
}
.docs-nav a {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  margin-bottom: 1px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--body);
}
.docs-nav a:hover {
  background: var(--sunken);
  color: var(--text);
  text-decoration: none;
}
.docs-nav a.current {
  background: var(--brand-soft);
  color: var(--brand-text);
}

.docs-lang {
  margin: 18px 10px 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  line-height: 1.6;
  color: var(--faint);
}
.docs-lang a {
  color: var(--muted);
}

/* ----------------------------------------------------------------- content */
main {
  flex: 1;
  min-width: 0;
  max-width: 880px;
  padding: 28px 28px 80px;
}
main > article,
main > .docs-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 8px 32px 32px;
}
h1 {
  margin: 20px 0 8px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 + p {
  color: var(--muted);
}
h2 {
  margin: 44px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
}
h3 {
  margin: 28px 0 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
}
h4 {
  margin: 20px 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}
p,
ul,
ol {
  margin: 0 0 14px;
}
li {
  margin: 4px 0;
}
hr {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 28px 0;
}
blockquote {
  margin: 0 0 16px;
  padding: 10px 16px;
  border-left: 3px solid var(--brand-line);
  background: var(--brand-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--body);
}
blockquote p:last-child {
  margin-bottom: 0;
}
.eyebrow {
  display: block;
  margin: 20px 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.note {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--sunken);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}
strong {
  color: var(--text);
  font-weight: 600;
}

/* ------------------------------------------------------------------- code */
code {
  font-family:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 1.5px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--text);
  overflow-wrap: anywhere;
}
pre {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  border: 1px solid var(--line);
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
}
pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  color: inherit;
}

/* ------------------------------------------------------------------ tables */
/* A wide table scrolls inside its own box instead of widening the page. */
article .table-wrap {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
}
article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
article th {
  text-align: left;
  padding: 9px 12px;
  background: var(--sunken);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
article td {
  padding: 10px 12px;
  vertical-align: top;
  border-bottom: 1px solid var(--line-soft);
}
article tr:last-child td {
  border-bottom: 0;
}

/* --------------------------------------------------- landing-page choices */
main > .docs-card > nav,
main > nav {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin: 0 0 22px;
}
main nav a {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--body);
}
main nav a:hover {
  border-color: var(--brand-line);
  background: var(--brand-soft);
  text-decoration: none;
}
main nav strong {
  color: var(--text);
  font-size: 14px;
}
main nav span {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}
.docs-foot {
  margin: 20px 4px 0;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.7;
}
.docs-foot a {
  color: var(--muted);
}

@media (max-width: 820px) {
  .docs-shell {
    display: block;
  }
  .docs-nav {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 2px 4px;
    padding: 8px 12px;
  }
  .docs-nav > span {
    flex-basis: 100%;
    margin: 6px 10px 2px;
  }
  main {
    padding: 16px 16px 48px;
  }
  main > article,
  main > .docs-card {
    padding: 4px 18px 20px;
  }
  .docs-version {
    display: none;
  }
}
/* On a phone the top bar keeps the brand and the console button; the two
   links back to the guide give way, as the console's own bar sheds its
   conveniences at this width. */
@media (max-width: 620px) {
  .docs-topbar {
    gap: 8px;
    padding: 0 12px;
  }
  .docs-topbar a:not(.brand):not(.button) {
    display: none;
  }
}
