/*
 * Ported from Client-Connectivity/nio-developer-portal (rework, base.css +
 * theme.css + layout.css + nav.css + components.css) for the overview page
 * only — docs.css/code.css support endpoint-doc pages not ported yet.
 *
 * The @import below pulls in @hsbc/neo-webcomponents' real vendored CSS
 * (static/vendor/nio/index.min.css, already fetched by F1) into a cascade
 * layer, so our own unlayered rules below automatically win wherever we
 * declare the same property — that's what neutralises the framework's
 * unconditional font-size:62.5%/color-scheme:light on :root (RELEASE_PLAN.md
 * R5) without needing to avoid the file entirely. Its @font-face rules become
 * live this way too, resolving against its own location, so none are
 * hand-copied here anymore.
 */
@import url("../vendor/nio/index.min.css") layer(framework);

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html, body {
  /* Neutralises the framework layer's min-height: 100vh/100dvh, which makes
     the document a topbar taller than the viewport — docs/navigation.html#scrollers. */
  min-height: 0;
  overscroll-behavior-y: none;
}

body {
  font-family: "Univers", system-ui, sans-serif;
  font-size: var(--font-size-5);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  overflow-x: hidden;
}

a {
  color: var(--color-link);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--color-outline);
  outline-offset: 2px;
}

code, pre {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
}

code {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  color: inherit;
  white-space: normal;
  overflow-wrap: anywhere;
}

pre code {
  white-space: inherit;
}

pre:not(.code-block__pre) {
  overflow-x: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 1000;
  padding: var(--space-sm) var(--space-lg);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  border: 2px solid var(--color-brand);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  position: fixed;
  left: var(--space-lg);
  top: var(--space-lg);
  width: auto;
  height: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/*
 * Theming. Every themed value is a single `light-dark()` token, so there is
 * exactly one place a colour is defined. Which side `light-dark()` picks is
 * driven by `color-scheme`: no `data-theme` -> `light dark`, i.e. follow
 * `prefers-color-scheme`; `data-theme="light"`/`"dark"` -> forced.
 */
:root {
  /* Neutralises the framework layer's unconditional font-size: 62.5%. */
  font-size: 100%;
  color-scheme: light dark;

  /* Real references into @hsbc/neo-webcomponents' palette (the "framework"
   * layer above), each with a fallback matching the value used before this
   * import existed — degrades to the same look if the vendor mount is ever
   * absent, rather than losing colour entirely. */
  --color-bg-primary: light-dark(var(--color-grey-1, #f3f3f3), var(--color-grey-dark-6, #101010));
  --color-bg-secondary: light-dark(var(--color-white, #ffffff), var(--color-grey-dark-5, #1d1d1d));
  --color-bg-tertiary: light-dark(#ededed, #212121);
  --color-bg-code: light-dark(#f6f8fa, #0d1117);
  --color-bg-code-header: light-dark(#eef1f5, #161b22);
  --color-bg-code-panel: light-dark(#ffffff, #1d1d1d);

  --color-text-primary: light-dark(var(--color-black, #000000), var(--color-white, #ffffff));
  /* Deliberately NOT the framework's --color-grey-6 (#767676 for both
   * sides): on our light background (#f3f3f3) that value is a 4.09:1
   * contrast ratio, below the WCAG 1.4.3 minimum of 4.5:1 for normal text.
   * Light side here (#595959) is a darker grey that clears the bar at
   * 6.31:1 — see GPSCCSJP-7 / RELEASE_PLAN.md S1. */
  --color-text-secondary: light-dark(#595959, #9b9b9b);
  --color-text-tertiary: light-dark(#545454, #8a8a8a);
  --color-text-code: light-dark(#24292f, #c9d1d9);
  --color-text-code-secondary: light-dark(#57606a, #8b949e);

  --color-code-border: light-dark(#d0d7de, #30363d);

  --color-brand: #db0011;

  --color-link: light-dark(#0066cc, #66b3ff);
  --color-link-hover: light-dark(#004d99, #99ccff);

  /* Matches the framework's own border-primary exactly (color-mix, not a flat
   * hex) — literal keywords, not var(), so this needs no fallback. */
  --color-border-primary: light-dark(
    color-mix(in srgb, white, black 10%),
    color-mix(in srgb, black, white 18%)
  );
  --color-border-secondary: light-dark(#d7d8d6, #656565);

  --color-method-get: light-dark(#007570, #34d399);
  --color-method-get-bg: light-dark(#e5f2f2, #001615);
  --color-method-post: light-dark(#305a85, #60a5fa);
  --color-method-post-bg: light-dark(#ebeff4, #000d1b);
  --color-method-put: light-dark(#b45309, #fbbf24);
  --color-method-put-bg: light-dark(#fff8ea, #221701);
  --color-method-delete: light-dark(#a8000b, #f87171);
  --color-method-delete-bg: light-dark(#f9f2f3, #260005);
  --color-method-patch: light-dark(#7c3aed, #a78bfa);
  --color-method-patch-bg: light-dark(#ede9fe, #1a0d2e);

  --color-success: light-dark(#007570, #34d399);
  --color-warning: light-dark(#b45309, #fbbf24);
  --color-error: light-dark(#a8000b, #f87171);
  --color-info: light-dark(#305a85, #60a5fa);

  --logo-hex-bg: light-dark(#ffffff, transparent);
  --logo-hex-fg: light-dark(#db0011, #ffffff);
  --logo-text: light-dark(#000000, #ffffff);

  --color-hover-overlay: light-dark(rgba(0, 0, 0, 0.066), rgba(255, 255, 255, 0.1));

  --syn-keyword: light-dark(#cf222e, #ff7b72);
  --syn-string: light-dark(#0a3069, #a5d6ff);
  --syn-number: light-dark(#0550ae, #79c0ff);
  --syn-property: light-dark(#116329, #7ee787);
  --syn-comment: light-dark(#6e7781, #8b949e);
  --syn-punctuation: light-dark(#57606a, #8b949e);
  --syn-url: light-dark(#0a3069, #a5d6ff);
  --syn-method: light-dark(#8250df, #d2a8ff);
  --syn-null: light-dark(#cf222e, #ff7b72);
  --syn-boolean: light-dark(#cf222e, #ff7b72);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 48px;

  --font-size-1: 32px;
  --font-size-2: 24px;
  --font-size-3: 20px;
  --font-size-4: 16px;
  --font-size-5: 14px;
  --font-size-6: 13px;
  --font-size-7: 12px;

  /* Real references into @hsbc/neo-webcomponents' radius scale, each with a
   * fallback matching the value used before this bridge existed. The
   * framework's own --br-sm/--br-md resolve to 0 (it ships square corners),
   * so this is a deliberate adoption of that language, not just a
   * safety-net default. */
  --radius-sm: var(--br-sm, 4px);
  --radius-md: var(--br-md, 6px);

  --topbar-height: 56px;
  --nav-width: 260px;
  --code-panel-width: 420px;

  --transition-speed: 250ms;
  --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);

  /* Deliberately NOT the framework's value (#ec7046 for both sides): that
   * value on our light background (#f3f3f3) is a 2.71:1 contrast ratio,
   * below the WCAG 1.4.11 minimum of 3:1 for a focus indicator. Light side
   * here is the same hue darkened to clear that bar. */
  --color-outline: light-dark(#e75618, #ec7046);

  --shadow-md: 0 4px 6px light-dark(rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0.4));
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 var(--space-xl);
  background-color: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border-primary);
  z-index: 100;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  appearance: none;
}

.topbar__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--color-text-primary);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.topbar__menu-btn:hover {
  background-color: var(--color-bg-tertiary);
}

.nav-toggle:focus-visible ~ .topbar .topbar__menu-btn {
  outline: 2px solid var(--color-outline);
  outline-offset: 2px;
}

.app-logo {
  display: flex;
  align-items: center;
}

.app-logo a {
  display: flex;
  text-decoration: none;
}

.hsbc-logo {
  height: 23px;
}

.logo__hex-bg {
  fill: var(--logo-hex-bg);
}

.logo__hex-fg {
  fill: var(--logo-hex-fg);
}

.logo__text {
  fill: var(--logo-text);
}

.app-logo__title {
  margin-left: 14px;
  border-left: 1px solid color-mix(in srgb, var(--color-text-secondary), transparent 50%);
  padding-left: 14px;
  font-weight: 500;
  font-size: var(--font-size-4);
  text-transform: uppercase;
  position: relative;
  top: -1px;
  color: var(--color-text-primary);
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: var(--nav-width) 1fr auto var(--code-panel-width);
  grid-template-rows: 1fr;
  height: calc(100vh - var(--topbar-height));
  height: calc(100dvh - var(--topbar-height));
  margin-top: var(--topbar-height);
  overflow: hidden;
}

/* Only the columns differ: containment, and which element scrolls, is the
   same for both layouts — docs/navigation.html#scrollers. */
.layout--two-panel {
  grid-template-columns: var(--nav-width) 1fr 0 0;
}

.layout--two-panel .layout__code {
  display: none;
}

.layout__nav,
.layout__content,
.layout__code {
  position: relative;
}

.layout__nav {
  overflow: hidden;
  border-right: 1px solid var(--color-border-primary);
  background-color: var(--color-bg-secondary);
}

.layout__content {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: var(--space-2xl) var(--space-3xl);
  outline: none;
  min-width: 0;
}

.layout__content section:has(> .param-table) {
  overflow-x: auto;
}

.layout__code {
  overflow-y: auto;
  overscroll-behavior: contain;
  background-color: var(--color-bg-code-panel);
  color: var(--color-text-code);
  border-left: 1px solid var(--color-border-primary);
}

.layout__resize-handle {
  width: 5px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 10;
  margin-left: -2px;
  margin-right: -3px;
  transition: background-color var(--transition-speed) var(--transition-ease);
}

.layout__resize-handle:hover,
.layout__resize-handle--active {
  background-color: var(--color-border-secondary);
}

.layout--two-panel .layout__resize-handle,
.no-js .layout__resize-handle {
  display: none;
}

.layout__backdrop {
  display: none;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: var(--nav-width) 1fr;
  }

  .layout__code,
  .layout__resize-handle {
    display: none;
  }
}

@media (max-width: 1024px) {
  .topbar__menu-btn {
    display: flex;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .layout__nav {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform var(--transition-speed) var(--transition-ease);
    box-shadow: var(--shadow-md);
  }

  .nav-toggle:checked ~ .layout .layout__nav {
    transform: translateX(0);
  }

  .layout__backdrop {
    position: fixed;
    inset: 0;
    top: var(--topbar-height);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 89;
  }

  .nav-toggle:checked ~ .layout .layout__backdrop {
    display: block;
  }

  .layout--two-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .layout__content {
    padding: var(--space-lg) var(--space-md);
  }

  .topbar {
    padding: 0 var(--space-md);
  }

  .app-logo__title {
    margin-left: var(--space-sm);
    padding-left: var(--space-sm);
    font-size: var(--font-size-5);
  }
}

/* Below this the HSBC logo beside it already says whose site this is. */
@media (max-width: 360px) {
  .app-logo__title {
    display: none;
  }
}

.nav {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.nav__sections {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-md) 0;
}

.nav__section {
  margin-bottom: var(--space-xs);
  interpolate-size: allow-keywords;
}

/* Animates the <details> collapse in Chromium; elsewhere it still snaps. */
.nav__section::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size var(--transition-speed) var(--transition-ease),
              content-visibility var(--transition-speed) allow-discrete;
}

.nav__section[open]::details-content {
  block-size: auto;
}

.nav__section-header::-webkit-details-marker {
  display: none;
}

.nav__section-header {
  list-style: none;
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--space-sm) 15px;
  border: none;
  background: none;
  color: var(--color-text-secondary);
  font-family: inherit;
  font-size: var(--font-size-7);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  user-select: none;
}

.nav__section-header:hover {
  color: var(--color-text-primary);
}

.nav__section-arrow {
  width: 12px;
  height: 12px;
  margin-right: var(--space-sm);
  transform: rotate(-90deg);
  transition: transform var(--transition-speed) var(--transition-ease);
  flex-shrink: 0;
}

.nav__section[open] > .nav__section-header .nav__section-arrow {
  transform: rotate(0deg);
}

.nav__section-items {
  list-style: none;
  display: grid;
  gap: 2px;
  padding: 0 var(--space-sm);
}

.nav__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 5px 15px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-family: inherit;
  font-size: var(--font-size-5);
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  min-height: 40px;
  transition: background-color var(--transition-speed) var(--transition-ease),
              color var(--transition-speed) var(--transition-ease);
}

.nav__item:hover {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-primary);
  text-decoration: none;
}

.nav__item[aria-current="page"] {
  background-color: var(--color-text-primary);
  color: var(--color-bg-secondary);
  font-weight: 500;
}

.nav__method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 100vw;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  height: 18px;
}

.nav__method-badge--get {
  color: var(--color-method-get);
  background-color: var(--color-method-get-bg);
}

.nav__method-badge--post {
  color: var(--color-method-post);
  background-color: var(--color-method-post-bg);
}

.nav__method-badge--put {
  color: var(--color-method-put);
  background-color: var(--color-method-put-bg);
}

.nav__method-badge--delete {
  color: var(--color-method-delete);
  background-color: var(--color-method-delete-bg);
}

.nav__method-badge--patch {
  color: var(--color-method-patch);
  background-color: var(--color-method-patch-bg);
}

.nav__footer {
  padding: var(--space-md) 15px;
  border-top: 1px solid var(--color-border-primary);
  flex-shrink: 0;
}

.theme-switcher {
  border: none;
  padding: 0;
  margin: 0;
  isolation: isolate;
}

.theme-switcher__items {
  display: inline-flex;
  width: 100%;
  padding: 4px;
  border-radius: var(--radius-md);
  background-color: var(--color-bg-primary);
  gap: 4px;
  user-select: none;
}

.theme-switcher__item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-height: 32px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--font-size-5);
  font-weight: 400;
  color: var(--color-text-secondary);
  background-color: transparent;
  text-decoration: none;
  position: relative;
  padding-inline: 15px;
  transition: color var(--transition-speed) var(--transition-ease);
}

.theme-switcher__item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  border-radius: var(--radius-md);
  transition: background-color var(--transition-speed) var(--transition-ease);
}

.theme-switcher__item:hover::before {
  background: var(--color-hover-overlay);
}

.theme-switcher__item:hover {
  color: var(--color-text-primary);
  text-decoration: none;
}

.theme-switcher__item[aria-current="true"],
:root:not([data-theme]) .theme-switcher__item[data-theme-value="light"] {
  background: var(--color-text-primary);
  color: var(--color-bg-secondary);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .theme-switcher__item[data-theme-value="light"] {
    background: transparent;
    color: var(--color-text-secondary);
  }

  :root:not([data-theme]) .theme-switcher__item[data-theme-value="dark"] {
    background: var(--color-text-primary);
    color: var(--color-bg-secondary);
  }
}

.theme-switcher__label {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 2;
  font-weight: 400;
  white-space: nowrap;
  pointer-events: none;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.feature-card {
  padding: var(--space-xl);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition-speed) var(--transition-ease),
              box-shadow var(--transition-speed) var(--transition-ease);
  text-decoration: none;
  color: inherit;
  display: block;
}

.feature-card:hover {
  border-color: var(--color-border-secondary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.feature-card__icon {
  width: 40px;
  height: 40px;
  margin-bottom: var(--space-lg);
  color: var(--color-brand);
}

.feature-card__title {
  font-size: var(--font-size-4);
  font-weight: 400;
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
}

.feature-card__description {
  font-size: var(--font-size-6);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.callout {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-6);
  line-height: 1.6;
}

.callout--info {
  background-color: var(--color-method-post-bg);
  border-left: 3px solid var(--color-info);
  color: var(--color-text-primary);
}

.callout--warning {
  background-color: var(--color-method-put-bg);
  border-left: 3px solid var(--color-warning);
  color: var(--color-text-primary);
}

/* Page header wrapper, shared by every static page. */
.docs {
  overflow-wrap: break-word;
}

.docs__header {
  margin-bottom: var(--space-3xl);
}

.docs__title {
  font-size: var(--font-size-1);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
  text-wrap: balance;
}

.docs__subtitle {
  font-size: var(--font-size-5);
  font-weight: 400;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.docs__base-url {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: var(--font-size-6);
  color: var(--color-text-secondary);
  max-width: 100%;
}

.docs__base-url code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.page-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border-primary);
  margin-bottom: var(--space-xl);
}

.page-toolbar__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border: none;
  background: none;
  color: var(--color-text-tertiary);
  font-family: inherit;
  font-size: var(--font-size-7);
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  min-height: 32px;
  text-decoration: none;
  transition: color var(--transition-speed) var(--transition-ease),
              background-color var(--transition-speed) var(--transition-ease);
}

.page-toolbar__btn:hover {
  color: var(--color-text-primary);
  background-color: var(--color-bg-tertiary);
  text-decoration: none;
}

.page-toolbar__btn--success {
  color: var(--color-success);
}

.no-js .page-toolbar__btn--js {
  display: none;
}

/* Cards (for placeholder pages) */
.card {
  padding: var(--space-xl);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-sm);
}

.card__title {
  font-size: var(--font-size-3);
  font-weight: 400;
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
}

.card__text {
  font-size: var(--font-size-5);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* Parameter table */
.param-table {
  width: 100%;
  border-collapse: collapse;
}

.param-table th {
  text-align: left;
  font-size: var(--font-size-7);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border-primary);
  background-color: var(--color-bg-primary);
}

.param-table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-primary);
  font-size: var(--font-size-6);
  vertical-align: top;
  background-color: var(--color-bg-secondary);
}

.param-table tr:last-child td {
  border-bottom: none;
}

.param-name {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: var(--font-size-6);
  font-weight: 500;
  color: var(--color-text-primary);
}

.param-description {
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.param-required {
  color: var(--color-error);
  font-size: var(--font-size-7);
  font-weight: 500;
  margin-left: var(--space-xs);
}

.param-type {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: var(--font-size-7);
  color: var(--color-text-tertiary);
}

/* Parameters and schema sections */
.docs-section {
  margin-bottom: var(--space-xl);
  overflow-x: auto;
}

.docs-section__title {
  font-size: var(--font-size-6);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border-primary);
}

/* MCP page sections */
.mcp-section {
  margin-bottom: var(--space-3xl);
}

.mcp-section__title {
  font-size: var(--font-size-2);
  font-weight: 400;
  color: var(--color-text-primary);
  margin-bottom: var(--space-lg);
  text-wrap: balance;
}

.mcp-section__text {
  font-size: var(--font-size-5);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.mcp-tool {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border-primary);
}

.mcp-tool__title {
  font-size: var(--font-size-3);
  font-weight: 400;
  color: var(--color-text-primary);
  margin-bottom: var(--space-lg);
  text-wrap: balance;
}

.param-conditional {
  color: var(--color-warning);
  font-size: 10px;
  font-weight: 500;
  margin-left: var(--space-xs);
}

/* Setup tabs (client selector) */
.setup-tabs {
  margin-top: var(--space-xl);
}

.setup-tabs__nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border-primary);
  margin-bottom: var(--space-xl);
  overflow-x: auto;
}

.setup-tab {
  padding: var(--space-sm) var(--space-lg);
  border: none;
  background: none;
  color: var(--color-text-tertiary);
  font-family: inherit;
  font-size: var(--font-size-6);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition-speed) var(--transition-ease);
  flex-shrink: 0;
}

.setup-tab:hover {
  color: var(--color-text-primary);
}

/*
 * Client tabs work like the code-panel language tabs: one screen-reader-only
 * radio per client ahead of the tab strip, with `:checked ~ …` doing the
 * switching. Here the ids are fixed and few, so the rules name them directly
 * rather than counting siblings.
 */
.setup-tabs__panel {
  display: none;
}

#setup-claude-code:checked ~ .setup-tabs__panel--claude-code,
#setup-cursor:checked ~ .setup-tabs__panel--cursor,
#setup-vscode:checked ~ .setup-tabs__panel--vscode,
#setup-other:checked ~ .setup-tabs__panel--other {
  display: block;
}

#setup-claude-code:checked ~ .setup-tabs__nav .setup-tab[for="setup-claude-code"],
#setup-cursor:checked ~ .setup-tabs__nav .setup-tab[for="setup-cursor"],
#setup-vscode:checked ~ .setup-tabs__nav .setup-tab[for="setup-vscode"],
#setup-other:checked ~ .setup-tabs__nav .setup-tab[for="setup-other"] {
  color: var(--color-text-primary);
  border-bottom-color: var(--color-brand);
}

/* Labels cannot take focus, so mirror each radio's focus ring onto its tab. */
#setup-claude-code:focus-visible ~ .setup-tabs__nav .setup-tab[for="setup-claude-code"],
#setup-cursor:focus-visible ~ .setup-tabs__nav .setup-tab[for="setup-cursor"],
#setup-vscode:focus-visible ~ .setup-tabs__nav .setup-tab[for="setup-vscode"],
#setup-other:focus-visible ~ .setup-tabs__nav .setup-tab[for="setup-other"] {
  outline: 2px solid var(--color-outline);
  outline-offset: -2px;
}

/* Code blocks (copy-button single-block variant, used by the MCP page) */
.code-block {
  margin-bottom: var(--space-3xl);
  border: 1px solid var(--color-code-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-bg-code-header);
  border-bottom: 1px solid var(--color-code-border);
}

.code-block__title {
  font-size: var(--font-size-7);
  font-weight: 400;
  color: var(--color-text-code-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.code-block__copy {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-code-border);
  background: transparent;
  color: var(--color-text-code-secondary);
  font-family: inherit;
  font-size: var(--font-size-7);
  cursor: pointer;
  border-radius: var(--radius-md);
  min-height: 28px;
  transition: color var(--transition-speed) var(--transition-ease),
              border-color var(--transition-speed) var(--transition-ease);
}

.code-block__copy:hover {
  color: var(--color-text-code);
  border-color: var(--color-text-code-secondary);
}

.code-block__copy--copied {
  color: var(--color-success);
  border-color: var(--color-success);
}

/* Copying needs the clipboard API, so the button is dead weight without it. */
.no-js .code-block__copy {
  display: none;
}

.code-block__body {
  background-color: var(--color-bg-code);
  overflow-x: auto;
}

.code-block__pre {
  margin: 0;
  padding: var(--space-lg);
  font-size: var(--font-size-6);
  line-height: 1.6;
  color: var(--color-text-code);
  white-space: pre;
  tab-size: 2;
}

.code-block__pre code {
  display: block;
  font-size: inherit;
}

.syn-punctuation {
  color: var(--syn-punctuation);
}

.syn-keyword { color: var(--syn-keyword); }
.syn-string { color: var(--syn-string); }
.syn-number { color: var(--syn-number); }
.syn-property { color: var(--syn-property); }
.syn-comment { color: var(--syn-comment); font-style: italic; }
.syn-url { color: var(--syn-url); text-decoration: underline; }
.syn-method { color: var(--syn-method); }
.syn-null { color: var(--syn-null); }
.syn-boolean { color: var(--syn-boolean); }

/* Endpoint section (accounts/transactions/payments API pages) */
.endpoint {
  padding: var(--space-3xl) 0;
  border-bottom: 1px solid var(--color-border-primary);
}

.endpoint:last-child {
  border-bottom: none;
}

.endpoint__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.endpoint__method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 22px;
  padding: var(--space-xs) var(--space-sm);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  border-radius: 100vw;
  letter-spacing: 0.02em;
}

.endpoint__method--get {
  color: var(--color-method-get);
  background-color: var(--color-method-get-bg);
}

.endpoint__method--post {
  color: var(--color-method-post);
  background-color: var(--color-method-post-bg);
}

.endpoint__method--delete {
  color: var(--color-method-delete);
  background-color: var(--color-method-delete-bg);
}

.endpoint__method--put {
  color: var(--color-method-put);
  background-color: var(--color-method-put-bg);
}

.endpoint__method--patch {
  color: var(--color-method-patch);
  background-color: var(--color-method-patch-bg);
}

.endpoint__path {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: var(--font-size-5);
  font-weight: 500;
  color: var(--color-text-primary);
  overflow-wrap: break-word;
  min-width: 0;
}

.endpoint__name {
  font-size: var(--font-size-2);
  font-weight: 400;
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
  text-wrap: balance;
}

.endpoint__description {
  font-size: var(--font-size-5);
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
}

.endpoint__auth {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background-color: var(--color-bg-tertiary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-6);
  color: var(--color-text-secondary);
}

.endpoint__auth-icon {
  width: 14px;
  height: 14px;
  color: var(--color-warning);
  flex-shrink: 0;
}

.param-location {
  font-size: var(--font-size-7);
  color: var(--color-text-tertiary);
  background-color: var(--color-bg-tertiary);
  padding: 1px var(--space-xs);
  border-radius: var(--radius-sm);
}

/* Response status codes */
.response-list {
  list-style: none;
}

.response-item {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border-primary);
}

.response-item:last-child {
  border-bottom: none;
}

.response-status {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: var(--font-size-6);
  font-weight: 500;
}

.response-status::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: var(--space-xs);
  border-radius: 50%;
  background-color: currentColor;
  vertical-align: middle;
}

.response-status--2xx { color: var(--color-success); }
.response-status--4xx { color: var(--color-warning); }
.response-status--5xx { color: var(--color-error); }

.response-description {
  font-size: var(--font-size-6);
  color: var(--color-text-secondary);
  margin-left: var(--space-md);
}

/* Rendered markdown inside descriptions */
.endpoint__description p,
.param-description p,
.response-description p {
  margin: 0 0 var(--space-sm);
}

.endpoint__description p:last-child,
.param-description p:last-child,
.response-description p:last-child {
  margin-bottom: 0;
}

.endpoint__description ul,
.endpoint__description ol {
  margin: var(--space-sm) 0;
  padding-left: 20px;
}

.endpoint__description li {
  margin-bottom: var(--space-xs);
}

.endpoint__description a,
.param-description a {
  color: var(--color-link);
}

.endpoint__description a:hover,
.param-description a:hover {
  color: var(--color-link-hover);
}

/* Code panel (three-panel API doc pages) */
.code-panel {
  padding: var(--space-xl);
}

.code-block__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  appearance: none;
}

.code-block__content {
  display: none;
}

.code-block__radio:nth-of-type(1):checked ~ .code-block__body .code-block__content:nth-of-type(1),
.code-block__radio:nth-of-type(2):checked ~ .code-block__body .code-block__content:nth-of-type(2),
.code-block__radio:nth-of-type(3):checked ~ .code-block__body .code-block__content:nth-of-type(3),
.code-block__radio:nth-of-type(4):checked ~ .code-block__body .code-block__content:nth-of-type(4) {
  display: block;
}

.code-block__radio:nth-of-type(1):checked ~ .code-tabs .code-tab:nth-of-type(1),
.code-block__radio:nth-of-type(2):checked ~ .code-tabs .code-tab:nth-of-type(2),
.code-block__radio:nth-of-type(3):checked ~ .code-tabs .code-tab:nth-of-type(3),
.code-block__radio:nth-of-type(4):checked ~ .code-tabs .code-tab:nth-of-type(4) {
  color: var(--color-text-code);
  border-bottom-color: var(--color-brand);
}

.code-block__radio:nth-of-type(1):focus-visible ~ .code-tabs .code-tab:nth-of-type(1),
.code-block__radio:nth-of-type(2):focus-visible ~ .code-tabs .code-tab:nth-of-type(2),
.code-block__radio:nth-of-type(3):focus-visible ~ .code-tabs .code-tab:nth-of-type(3),
.code-block__radio:nth-of-type(4):focus-visible ~ .code-tabs .code-tab:nth-of-type(4) {
  outline: 2px solid var(--color-outline);
  outline-offset: -2px;
}

.code-tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--color-code-border);
  padding: var(--space-xs) var(--space-lg) 0;
  background-color: var(--color-bg-code-header);
}

.code-tab {
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: none;
  color: var(--color-text-code-secondary);
  font-family: inherit;
  font-size: var(--font-size-6);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: -1px;
  min-height: 32px;
  transition: color var(--transition-speed) var(--transition-ease);
}

.code-tab:hover {
  color: var(--color-text-code);
}

/* Response section (code panel) */
.response-block {
  margin-top: var(--space-xl);
}

.response-block__status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-md);
  border-radius: 100vw;
  font-size: var(--font-size-7);
  font-weight: 500;
  margin-bottom: var(--space-sm);
}

.response-block__status--success {
  color: var(--color-method-get);
  background-color: var(--color-method-get-bg);
}

.response-block__status--error {
  color: var(--color-error);
  background-color: var(--color-method-delete-bg);
}

/* Connected Banking — partner grid */
.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.partner-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-xl);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  text-decoration: none;
  transition: border-color var(--transition-speed) var(--transition-ease),
              box-shadow var(--transition-speed) var(--transition-ease);
}

.partner-card:hover {
  border-color: var(--color-border-secondary);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.partner-card--active {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 1px var(--color-brand);
}

.partner-card__logo {
  height: 160px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  align-self: center;
}

.partner-card__services {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.partner-card__tag {
  display: inline-block;
  padding: 1px var(--space-sm);
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
  font-size: var(--font-size-7);
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.partner-card__connection {
  display: flex;
  gap: var(--space-xs);
  margin-top: auto;
}

.partner-card__conn-tag {
  display: inline-block;
  padding: 1px var(--space-sm);
  background-color: var(--color-method-post-bg);
  color: var(--color-info);
  font-size: var(--font-size-7);
  font-weight: 500;
  border-radius: var(--radius-sm);
}

/* Connected Banking — partner detail panel */
.partner-detail {
  margin-top: var(--space-xl);
  padding: var(--space-2xl);
  background-color: var(--color-bg-secondary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-sm);
}

.partner-detail__title {
  font-size: var(--font-size-2);
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
}

/* Connected Banking — solution cards */
.solution-card {
  padding: var(--space-xl);
  background-color: var(--color-bg-primary);
  border: 1px solid var(--color-border-primary);
  border-radius: var(--radius-sm);
}

.solution-card__title {
  font-size: var(--font-size-4);
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
}

.solution-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.solution-card__text {
  font-size: var(--font-size-6);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.solution-card__steps {
  margin: var(--space-sm) 0 0;
  padding-left: var(--space-xl);
  font-size: var(--font-size-6);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* Connected Banking — benefits list */
.cb-benefits {
  list-style: none;
  padding: 0;
  margin: var(--space-lg) 0 0;
}

.cb-benefits li {
  position: relative;
  padding-left: var(--space-lg);
  margin-bottom: var(--space-md);
  font-size: var(--font-size-5);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.cb-benefits li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  background-color: var(--color-brand);
  border-radius: 50%;
}
