:root {
  --bg: #f5fbf7;
  --bg-soft: #eef8f2;
  --surface: #ffffff;
  --surface-2: #f7fbf8;
  --text: #123122;
  --muted: #4e6a59;
  --border: #d7e6db;
  --brand: #137a46;
  --brand-2: #0f5f38;
  --brand-soft: rgba(19, 122, 70, 0.12);
  --accent: #8dd8a8;
  --warning: #b26a00;
  --warning-bg: #fff4e5;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --success: #127a46;
  --success-bg: #ebf9f0;
  --shadow: 0 18px 50px rgba(10, 44, 24, 0.08);
  --radius: 20px;
  --radius-sm: 14px;
  --sidebar-width: 290px;
  --content-width: 1080px;
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: "Manrope", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(141, 216, 168, 0.28), transparent 28%),
    radial-gradient(circle at top right, rgba(19, 122, 70, 0.14), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, #ffffff 48%, #f8fcf9 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-2);
}

p {
  line-height: 1.7;
  color: var(--muted);
}

code,
pre {
  font-family: var(--font-mono);
}

[data-doc-section] {
  scroll-margin-top: 110px;
}

.site {
  position: relative;
  min-height: 100vh;
}

.site,
.docs-shell,
.content,
.content-inner,
.section-card,
.hero,
.page-hero,
.doc-card,
.endpoint-card,
.alert,
.table-card,
.code-block,
.sidebar {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid rgba(215, 230, 219, 0.9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand img {
  width: clamp(140px, 20vw, 220px);
  height: auto;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

.brand span {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.button,
.button-ghost,
.menu-toggle,
.sidebar-close,
.copy-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font: inherit;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.button,
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, #159150 100%);
  box-shadow: 0 12px 28px rgba(19, 122, 70, 0.22);
}

.button:hover,
.menu-toggle:hover {
  transform: translateY(-1px);
  color: #fff;
}

.button-ghost,
.sidebar-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-weight: 700;
  color: var(--brand-2);
  background: rgba(19, 122, 70, 0.08);
}

.button-ghost:hover,
.sidebar-close:hover {
  background: rgba(19, 122, 70, 0.14);
  color: var(--brand-2);
}

.menu-toggle {
  display: none;
}

.docs-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 24px;
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 24px;
}

.sidebar {
  position: sticky;
  top: 90px;
  align-self: start;
  max-height: calc(100vh - 114px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

body.sidebar-open {
  overflow: hidden;
}

body.sidebar-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(247, 250, 248, 0.96);
  backdrop-filter: blur(2px);
}

.sidebar-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.sidebar-title {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 800;
}

.nav-section + .nav-section {
  margin-top: 16px;
}

.nav-section-title {
  margin: 0 0 10px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
}

.nav-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--text);
  font-weight: 600;
  border: 1px solid transparent;
}

.nav-link:hover {
  background: rgba(19, 122, 70, 0.06);
  border-color: rgba(19, 122, 70, 0.08);
}

.nav-link.active,
.nav-link[aria-current="page"] {
  background: linear-gradient(135deg, rgba(19, 122, 70, 0.12), rgba(141, 216, 168, 0.18));
  border-color: rgba(19, 122, 70, 0.16);
  color: var(--brand-2);
}

.nav-link small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.content {
  min-width: 0;
  max-width: 100%;
}

.content-inner {
  width: 100%;
  max-width: var(--content-width);
  min-width: 0;
  margin: 0 auto;
}

main,
.docs-main,
.docs-content {
  min-width: 0;
  max-width: 100%;
}

.hero,
.page-hero,
.section-card,
.doc-card,
.endpoint-card,
.alert,
.table-card,
.callout,
.code-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  margin-bottom: 20px;
}

.hero::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(141, 216, 168, 0.22), transparent 28%),
    radial-gradient(circle at left bottom, rgba(19, 122, 70, 0.14), transparent 24%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 24px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--brand-2);
  background: rgba(19, 122, 70, 0.1);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1 {
  margin: 14px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  color: var(--text);
}

.hero p,
.page-hero p {
  font-size: 1.02rem;
  max-width: 62ch;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.hero-panel {
  position: relative;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(19, 122, 70, 0.92), rgba(15, 95, 56, 0.96));
  color: #fff;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
}

.hero-panel img,
.feature-art img {
  width: 100%;
  height: auto;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 18px 36px rgba(6, 32, 18, 0.28);
}

.hero-panel .panel-note {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
}

.page-hero {
  position: relative;
  padding: 24px;
  margin-bottom: 20px;
}

.page-hero .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.grid-quicklinks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 0;
}

.quicklink,
.doc-card,
.endpoint-card {
  padding: 18px;
}

.quicklink {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.quicklink:hover {
  transform: translateY(-2px);
  color: var(--text);
  border-color: rgba(19, 122, 70, 0.2);
}

.quicklink .eyebrow {
  margin-bottom: 12px;
}

.docs-card-grid,
.merchant-url-grid,
.feature-grid,
.api-grid,
.cards,
.cards-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  width: 100%;
  max-width: 100%;
}

.doc-card h3,
.endpoint-card h3,
.section-card h2,
.section-card h3,
.callout h3 {
  margin: 0 0 10px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.doc-card p,
.endpoint-card p,
.callout p {
  margin: 0;
}

.docs-card-grid > *,
.merchant-url-grid > *,
.feature-grid > *,
.api-grid > *,
.cards > *,
.cards-3 > *,
.doc-card,
.endpoint-card,
.table-card,
.alert,
.code-block {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.section-card {
  padding: 22px;
  margin-bottom: 18px;
}

.section-card + .section-card {
  margin-top: 18px;
}

.section-card h2 {
  font-size: 1.45rem;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head p {
  margin: 0;
  max-width: 70ch;
}

.alert {
  padding: 16px 18px;
  margin: 16px 0;
}

.alert.note {
  background: rgba(19, 122, 70, 0.08);
  border-color: rgba(19, 122, 70, 0.16);
}

.alert.warning {
  background: var(--warning-bg);
  border-color: rgba(178, 106, 0, 0.18);
}

.alert.danger {
  background: var(--danger-bg);
  border-color: rgba(180, 35, 24, 0.18);
}

.alert.success {
  background: var(--success-bg);
  border-color: rgba(18, 122, 70, 0.18);
}

.alert strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

.code-block {
  overflow: hidden;
  margin: 16px 0;
  border: 1px solid #d9e8dd;
  border-radius: 18px;
  background: #0f1f17;
  box-shadow: 0 20px 38px rgba(8, 27, 17, 0.18);
  min-width: 0;
  max-width: 100%;
}

.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-bar span {
  color: #9cc9ad;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.copy-button {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 700;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  max-width: 100%;
  min-width: 0;
  color: #e8f4ec;
  font-size: 0.94rem;
  line-height: 1.6;
}

.code-block code {
  display: block;
  white-space: pre;
  max-width: 100%;
  word-break: normal;
}

code:not(pre code) {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-card {
  overflow: hidden;
  margin: 16px 0;
}

table.docs-table {
  width: 100%;
  border-collapse: collapse;
  max-width: 100%;
}

.docs-table th,
.docs-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}

.docs-table th {
  background: var(--surface-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.docs-table tbody tr:hover {
  background: rgba(19, 122, 70, 0.04);
}

.inline-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(19, 122, 70, 0.1);
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
}

.endpoint-card .endpoint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(19, 122, 70, 0.08);
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 800;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.feature-art {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #f7fbf8);
  box-shadow: var(--shadow);
}

.list-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.list-grid li {
  position: relative;
  padding-left: 24px;
  color: var(--muted);
}

.list-grid li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(19, 122, 70, 0.1);
}

.footer {
  width: min(100%, var(--content-width));
  margin: 30px auto 0;
  padding: 18px 6px 40px;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.muted {
  color: var(--muted);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}

.faq-answer {
  display: none;
  padding: 0 18px 16px;
}

.faq-item.open .faq-answer {
  display: block;
}

.label-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.doc-block {
  margin-bottom: 18px;
}

.doc-list {
  display: grid;
  gap: 12px;
  padding-left: 20px;
}

.doc-list li {
  line-height: 1.65;
  color: var(--muted);
}

.doc-kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 76px 16px 16px 16px;
    z-index: 50;
    transform: translateX(calc(-100% - 20px));
    transition: transform 0.25s ease;
    max-height: none;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-head {
    display: flex;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .top-actions .button-ghost {
    display: none;
  }

  .hero-grid,
  .two-col,
  .cards,
  .cards-3,
  .grid-quicklinks {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
  }

  .brand {
    min-width: 0;
    flex: 1 1 260px;
  }

  .brand img {
    width: min(48vw, 200px);
  }

  .top-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
  }

  .menu-toggle,
  .button,
  .button-ghost {
    padding: 9px 12px;
    font-size: 14px;
  }

  .docs-shell {
    gap: 18px;
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 10px 12px;
  }

  .brand {
    flex: 1 1 100%;
  }

  .brand img {
    width: min(62vw, 180px);
  }

  .brand span {
    font-size: 14px;
  }

  .top-actions {
    gap: 6px;
  }

  .menu-toggle,
  .button {
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.1;
  }

  .docs-shell {
    padding: 12px;
  }

  .content-inner {
    width: 100%;
  }

  .hero,
  .page-hero,
  .section-card,
  .doc-card,
  .endpoint-card,
  .alert,
  .table-card,
  .callout {
    border-radius: 18px;
  }

  .hero,
  .page-hero {
    padding: 18px;
  }

  .section-card {
    padding: 18px;
  }

  .docs-card-grid,
  .merchant-url-grid,
  .feature-grid,
  .api-grid,
  .cards,
  .cards-3 {
    gap: 16px;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 2rem;
  }

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

@media (max-width: 420px) {
  .topbar {
    padding: 10px;
  }

  .brand img {
    width: min(72vw, 150px);
  }

  .brand span {
    font-size: 13px;
  }

  .top-actions {
    justify-content: stretch;
  }

  .menu-toggle,
  .button {
    flex: 1 1 auto;
    padding: 7px 9px;
    font-size: 12px;
  }

  .button-ghost {
    padding: 7px 9px;
    font-size: 12px;
  }

  .sidebar {
    inset: 70px 10px 10px 10px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(215, 230, 219, 0.95);
    box-shadow: 0 28px 70px rgba(10, 44, 24, 0.2);
  }

  .sidebar-head {
    margin-bottom: 12px;
  }

  .sidebar-close {
    padding: 8px 10px;
    font-size: 12px;
  }

  .section-card,
  .hero,
  .page-hero {
    padding: 16px;
  }

  .code-block pre {
    padding: 12px 14px;
    font-size: 0.84rem;
    line-height: 1.5;
  }

  .code-bar {
    padding: 9px 12px;
  }
}
