:root {
  color-scheme: light;
  --ink: #151917;
  --muted: #68716d;
  --line: #dfe5e2;
  --soft: #f5f7f6;
  --surface: #ffffff;
  --mint: #118665;
  --mint-soft: #e6f7f1;
  --blue: #3269b0;
  --amber: #8c590c;
  --amber-soft: #fff3db;
  --coral: #b64b38;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  letter-spacing: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #46504b;
  font-size: 12px;
  font-weight: 680;
}

.nav-links a:hover,
.doc-nav a:hover {
  color: var(--mint);
}

.docs-container,
.doc-layout {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.docs-container {
  padding: 54px 0 76px;
}

.docs-hero {
  max-width: 760px;
  padding-bottom: 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.12;
}

.lead {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.docs-list {
  border-top: 1px solid var(--line);
}

.doc-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.method {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--mint-soft);
  color: var(--mint);
  font-size: 9px;
  font-weight: 850;
}

.doc-row h2 {
  margin: 0;
  font-size: 17px;
}

.doc-row p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.endpoint {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: var(--blue);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
}

.row-link {
  min-width: 92px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 760;
  text-align: right;
}

.related-products {
  margin-top: 38px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}

.related-products-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.related-products-header .eyebrow {
  margin-bottom: 8px;
}

.related-products-header h2 {
  margin: 0;
  font-size: 22px;
}

.related-products-link {
  color: var(--mint);
  font-size: 11px;
  font-weight: 760;
}

.related-products-link:hover {
  color: var(--ink);
}

.related-product-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 38px;
}

.related-product-group {
  min-width: 0;
}

.related-product-group h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.related-product-group-count {
  margin-left: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.related-product-list {
  border-top: 1px solid var(--line);
}

.related-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.related-product-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 680;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-product-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.related-product-stock.is-out {
  color: var(--coral);
}

.related-product-stock.is-ready {
  color: var(--mint);
}

.related-product-price {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.related-product-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--mint);
  font-size: 9px;
  font-weight: 760;
  white-space: nowrap;
}

.related-product-buy:hover {
  border-color: var(--mint);
  background: var(--mint-soft);
}

.related-loading,
.related-empty {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.doc-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 52px;
  padding: 42px 0 78px;
}

.doc-nav {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 6px;
}

.doc-nav-title {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.doc-nav a {
  padding: 9px 10px;
  border-left: 2px solid transparent;
  color: #515a56;
  font-size: 11px;
  line-height: 1.45;
}

.doc-nav a.is-active {
  border-left-color: var(--mint);
  background: var(--mint-soft);
  color: var(--mint);
  font-weight: 760;
}

.doc-main {
  min-width: 0;
}

.breadcrumbs {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 10px;
}

.breadcrumbs a {
  color: var(--mint);
}

.doc-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.doc-main h1 {
  font-size: 34px;
}

.doc-main > section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.doc-main h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.doc-main h3 {
  margin: 20px 0 10px;
  font-size: 13px;
}

.doc-main p,
.doc-main li {
  color: #525c57;
  font-size: 12px;
  line-height: 1.75;
}

.doc-main ol,
.doc-main ul {
  margin: 0;
  padding-left: 20px;
}

.endpoint-bar {
  margin: 22px 0 30px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--mint);
  border-radius: 5px;
  background: var(--surface);
}

.endpoint-bar code {
  overflow-wrap: anywhere;
  color: var(--blue);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
}

.field-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 11px;
}

.field-table th,
.field-table td {
  padding: 11px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.field-table th {
  background: #edf1ef;
  color: #48514d;
  font-weight: 760;
}

.field-table code {
  color: var(--blue);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.code-wrap {
  position: relative;
}

.code-wrap pre {
  margin: 0;
  overflow: auto;
  padding: 46px 16px 18px;
  border-radius: 5px;
  background: #171b19;
  color: #e9f4ef;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  line-height: 1.7;
  white-space: pre;
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 78px;
  min-height: 28px;
  border: 1px solid #4c5752;
  border-radius: 4px;
  background: #252b28;
  color: #eef7f3;
  cursor: pointer;
  font-size: 9px;
  font-weight: 720;
}

.copy-button:hover {
  border-color: #70c9aa;
  color: #8ce0c1;
}

.notice {
  padding: 14px 16px;
  border-left: 3px solid var(--coral);
  background: #fff7f5;
  color: #755048;
  font-size: 11px;
  line-height: 1.7;
}

.purchase-band {
  margin-top: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--mint);
  border-radius: 6px;
  background: var(--surface);
}

.purchase-band strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.purchase-band p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.purchase-button {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 760;
}

.purchase-button:hover {
  background: var(--mint);
}

footer {
  border-top: 1px solid var(--line);
  background: #edf1ef;
}

.footer-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 80px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 760px) {
  .topbar-inner,
  .docs-container,
  .doc-layout,
  .footer-inner {
    width: min(100% - 28px, 1120px);
  }

  .nav-links a:not(:first-child) {
    display: none;
  }

  .docs-container {
    padding-top: 38px;
  }

  h1 {
    font-size: 34px;
  }

  .doc-row {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .row-link {
    grid-column: 2;
    text-align: left;
  }

  .doc-layout {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .doc-nav {
    position: static;
    grid-template-columns: 1fr 1fr;
  }

  .doc-nav-title {
    grid-column: 1 / -1;
  }

  .doc-title-row {
    flex-direction: column;
  }

  .field-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .purchase-band,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .purchase-button {
    width: 100%;
  }

  .related-products-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .related-product-groups {
    grid-template-columns: 1fr;
    gap: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.token-tool-container {
  width: min(1180px, calc(100% - 40px));
}

.token-tool-hero {
  max-width: 820px;
  padding-bottom: 28px;
}

.local-only-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  padding: 13px 16px;
  border: 1px solid #bfe3d5;
  border-radius: 5px;
  background: var(--mint-soft);
  color: #295e4d;
}

.local-only-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(17, 134, 101, 0.12);
}

.local-only-notice div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11px;
  line-height: 1.55;
}

.local-only-notice strong {
  color: #174f3e;
}

.token-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  min-height: 540px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.token-input-panel,
.token-result-panel {
  min-width: 0;
  padding: 26px;
}

.token-input-panel {
  border-right: 1px solid var(--line);
  background: #fbfcfb;
}

.token-panel-heading {
  min-height: 46px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.token-panel-heading h2 {
  margin: 3px 0 0;
  font-size: 17px;
}

.token-step {
  margin: 0;
  color: var(--mint);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  font-weight: 800;
}

.token-input-count {
  color: var(--muted);
  font-size: 9px;
}

.token-source-label {
  display: block;
  margin-bottom: 8px;
  color: #49524e;
  font-size: 10px;
  font-weight: 720;
}

.token-source {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  padding: 14px;
  border: 1px solid #ccd4d0;
  border-radius: 5px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0;
}

.token-source:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(17, 134, 101, 0.11);
}

.token-source::placeholder {
  color: #9ca6a1;
}

.token-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.token-primary-button,
.token-secondary-button,
.token-copy-all,
.token-value-actions button {
  min-height: 36px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 760;
}

.token-primary-button {
  flex: 1;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
}

.token-primary-button:hover {
  border-color: var(--mint);
  background: var(--mint);
}

.token-secondary-button {
  min-width: 74px;
  border: 1px solid var(--line);
  background: #fff;
  color: #505a55;
}

.token-secondary-button:hover,
.token-value-actions button:hover {
  border-color: var(--mint);
  color: var(--mint);
}

.token-error {
  margin: 12px 0 0;
  color: var(--coral);
  font-size: 10px;
  line-height: 1.6;
}

.token-copy-all {
  min-width: 90px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--mint);
}

.token-copy-all:disabled {
  cursor: not-allowed;
  color: #9ca6a1;
  background: #f1f3f2;
}

.token-empty {
  min-height: 372px;
  display: grid;
  place-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
}

.token-empty[hidden],
.token-error[hidden] {
  display: none;
}

.token-empty strong {
  color: #444d49;
  font-size: 13px;
}

.token-empty span {
  font-size: 10px;
}

.token-results {
  display: grid;
  gap: 14px;
}

.token-result {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.token-result-header,
.token-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.token-result-index {
  display: block;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 8px;
}

.token-result h3 {
  margin: 3px 0 0;
  font-size: 13px;
}

.token-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 3px;
  font-size: 8px;
  font-weight: 800;
}

.token-status.is-valid {
  background: var(--mint-soft);
  color: var(--mint);
}

.token-status.is-expired {
  background: #fff0ed;
  color: var(--coral);
}

.token-status.is-neutral {
  background: #eef1f0;
  color: #69736e;
}

.token-value-row {
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #f5f7f6;
}

.token-value {
  min-width: 0;
  overflow: hidden;
  color: #245744;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-value-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}

.token-value-actions button {
  min-width: 48px;
  min-height: 26px;
  padding: 0 7px;
  border: 1px solid #ccd4d0;
  background: #fff;
  color: #4f5954;
  font-size: 8px;
}

.token-metadata {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 14px 0 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.token-meta-item {
  min-width: 0;
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.token-meta-item dt {
  color: var(--muted);
  font-size: 8px;
}

.token-meta-item dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #303935;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  line-height: 1.45;
}

.token-payload-details {
  margin-top: 12px;
  color: #4f5954;
  font-size: 9px;
}

.token-payload-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--mint);
  font-weight: 720;
}

.token-payload-details pre {
  max-height: 260px;
  margin: 10px 0 0;
  overflow: auto;
  padding: 12px;
  border-radius: 4px;
  background: #171b19;
  color: #e9f4ef;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.token-safety {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 30px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.token-safety h2 {
  margin: 0;
  font-size: 14px;
}

.token-safety p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

@media (max-width: 820px) {
  .token-workspace {
    grid-template-columns: 1fr;
  }

  .token-input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .token-source {
    min-height: 240px;
  }
}

@media (max-width: 560px) {
  .token-tool-container {
    width: min(100% - 28px, 1180px);
  }

  .token-tool-hero h1 {
    font-size: 30px;
    line-height: 1.18;
  }

  .token-input-panel,
  .token-result-panel {
    padding: 18px;
  }

  .token-panel-heading,
  .token-result-header,
  .token-value-row {
    align-items: flex-start;
  }

  .token-value-row {
    flex-direction: column;
  }

  .token-value {
    width: 100%;
  }

  .token-value-actions {
    width: 100%;
  }

  .token-value-actions button {
    flex: 1;
  }

  .token-metadata {
    grid-template-columns: 1fr;
  }

  .token-actions,
  .token-safety {
    grid-template-columns: 1fr;
  }

  .token-safety {
    display: grid;
    gap: 8px;
  }
}
