/*
 * ynab-mcp site styles. Zero dependencies: system fonts, no imports, no
 * external URLs. Colour tokens are checked for WCAG AA contrast (see
 * site/README.md); change them in both themes together.
 */

:root {
  color-scheme: light dark;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Light theme */
  --bg: #faf9f6;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #1b1c1e;
  --muted: #55595f;
  --border: #e2ded5;
  --border-strong: #8a8579;
  --accent: #9a4321;
  --accent-hover: #7d3518;
  --accent-soft: #f6e9e1;
  --on-accent: #ffffff;
  --code-bg: #f2efe8;
  --code-text: #2a2b2e;
  --focus: #1f5fa8;

  --ok-bg: #e4efe8;
  --ok-text: #24573f;
  --warn-bg: #f8eed8;
  --warn-text: #74500b;
  --danger-bg: #f8e4e1;
  --danger-text: #922b25;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgb(20 20 20 / 0.04), 0 4px 16px rgb(20 20 20 / 0.04);
  --header-h: 3.75rem;
  --measure: 44rem;
  --wide: 72rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131416;
    --surface: #1b1c1f;
    --surface-2: #202125;
    --text: #ebe8e2;
    --muted: #a8a49c;
    --border: #2f3034;
    --border-strong: #74757c;
    --accent: #eba57f;
    --accent-hover: #f3bd9e;
    --accent-soft: #2c211c;
    --on-accent: #1b1c1f;
    --code-bg: #1e1f22;
    --code-text: #e3e0da;
    --focus: #8ab8ff;

    --ok-bg: #1d2b24;
    --ok-text: #9fd5b6;
    --warn-bg: #2d2617;
    --warn-text: #e8c57a;
    --danger-bg: #321e1d;
    --danger-text: #f2a39b;

    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 16px rgb(0 0 0 / 0.2);
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

img,
svg {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  margin: 0 0 0.6em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.015em;
}

h1 {
  font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.4rem);
}

h2 {
  font-size: clamp(1.6rem, 1.3rem + 1.4vw, 2.1rem);
  margin-top: 2.2em;
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.8em;
}

h4 {
  font-size: 1rem;
  margin-top: 1.4em;
}

p,
ul,
ol,
dl,
table,
pre,
figure,
blockquote {
  margin: 0 0 1.1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li + li {
  margin-top: 0.3rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}

kbd {
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 0.35em;
  font-size: 0.85em;
}

strong {
  font-weight: 600;
}

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

/* ---------- Skip link ---------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
  color: var(--on-accent);
}

/* ---------- Header and nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .site-header {
    background: var(--bg);
  }
}

.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1rem;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  margin-right: auto;
  padding: 0.25rem 0;
}

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

.brand svg {
  width: 26px;
  height: 26px;
  flex: none;
}

.brand-sub {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9rem;
}

.nav-toggle {
  display: none;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.25rem;
}

.nav-list li + li {
  margin-top: 0;
}

.nav-list a {
  display: block;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-list a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav-list a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
  font-weight: 600;
}

.nav-list .nav-gh svg {
  width: 1em;
  height: 1em;
  vertical-align: -0.12em;
  margin-right: 0.3em;
}

/* Narrow screens: with JS the list collapses behind a Menu button; without
   JS it wraps onto its own row. */
@media (max-width: 52rem) {
  .site-nav {
    flex-basis: 100%;
  }

  .js .nav-toggle {
    display: inline-block;
  }

  .js .site-nav {
    display: none;
    padding-bottom: 0.75rem;
  }

  .js .site-nav.is-open {
    display: block;
  }

  .js .nav-list {
    flex-direction: column;
  }

  .nav-list a {
    padding: 0.55rem 0.65rem;
  }
}

/* ---------- Layout ---------- */

main {
  display: block;
}

.wrap {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1rem;
}

.prose {
  max-width: var(--measure);
}

.page-head {
  padding-top: 3.5rem;
  padding-bottom: 1.5rem;
}

.page-head .lede {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 40rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.section {
  padding-top: 1rem;
  padding-bottom: 2.5rem;
}

.section > h2:first-child {
  margin-top: 1.5rem;
}

.with-toc {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
}

@media (min-width: 64rem) {
  .with-toc {
    grid-template-columns: 13rem minmax(0, 1fr);
  }
}

.toc {
  font-size: 0.92rem;
}

.toc h2 {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--border);
}

.toc li + li {
  margin-top: 0;
}

.toc a {
  display: block;
  padding: 0.3rem 0 0.3rem 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
}

@media (min-width: 64rem) {
  .toc > div {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
  }
}

/* ---------- Hero ---------- */

.hero {
  padding-top: 4.5rem;
  padding-bottom: 3rem;
}

.hero h1 {
  max-width: 18ch;
  margin-bottom: 1.2rem;
}

.hero .lede {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  color: var(--muted);
  max-width: 38rem;
  margin-bottom: 2rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1.2;
}

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button-primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
  text-decoration: none;
}

.button-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}

.button-secondary:hover {
  color: var(--text);
  border-color: var(--text);
  text-decoration: none;
}

.hero-cmd {
  margin-top: 2.25rem;
  max-width: 34rem;
}

/* ---------- Cards and grids ---------- */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  margin: 0 0 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.97rem;
}

.card .icon {
  width: 28px;
  height: 28px;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: block;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.card-link:hover {
  color: inherit;
}

.card-link:hover .card {
  border-color: var(--border-strong);
}

.card-link .more {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 1rem;
  margin: 0 0 2rem;
}

.stat {
  border-top: 2px solid var(--accent);
  padding-top: 0.75rem;
}

.stat .num {
  display: block;
  font-family: var(--font-serif);
  font-size: 2.2rem;
  line-height: 1.1;
}

.stat .label {
  color: var(--muted);
  font-size: 0.95rem;
}

/* Prompt chips on the home page */
.asks {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

.asks li + li {
  margin-top: 0;
}

.asks li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
}

.asks q {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  quotes: "\201C" "\201D";
}

.asks .via {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Callouts ---------- */

.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.25rem;
}

.callout > :last-child {
  margin-bottom: 0;
}

.callout-title {
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}

.callout.note {
  border-left-color: var(--focus);
}

.callout.warn {
  border-left-color: var(--warn-text);
}

/* ---------- Code blocks ---------- */

.code {
  position: relative;
  margin: 0 0 1.25rem;
}

.code-label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

pre {
  background: var(--code-bg);
  color: var(--code-text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1rem;
  overflow-x: auto;
  line-height: 1.55;
  font-size: 0.875rem;
  tab-size: 2;
}

.code pre {
  margin: 0;
}

.js .code pre {
  padding-right: 4.75rem;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.6rem;
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--text);
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
  margin: 0;
}

caption {
  text-align: left;
  padding: 0.75rem 0.9rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

thead th {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface-2);
}

tbody tr:last-child > * {
  border-bottom: 0;
}

td code,
th code {
  white-space: nowrap;
}

.env-table td:first-child code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.env-table td:first-child {
  min-width: 12rem;
}

/* Narrow screens: each variable becomes a small card instead of a squeezed row. */
@media (max-width: 40rem) {
  .env-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .env-table,
  .env-table tbody,
  .env-table tr,
  .env-table td {
    display: block;
    width: 100%;
  }

  .env-table tr {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border);
  }

  .env-table tbody tr:last-child {
    border-bottom: 0;
  }

  .env-table td {
    border: 0;
    padding: 0.1rem 0;
  }

  .env-table td:first-child {
    min-width: 0;
    font-weight: 600;
  }

  .env-table td:nth-child(2) {
    font-size: 0.88rem;
    color: var(--muted);
  }

  .env-table td:nth-child(2)::before {
    content: "Default: ";
  }
}

/* ---------- Tabs (progressively enhanced) ---------- */

.tabs [role="tablist"] {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.tabs [role="tab"] {
  font: inherit;
  font-size: 0.95rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
}

.tabs [role="tab"]:hover {
  color: var(--text);
}

.tabs [role="tab"][aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tab-panel > h3:first-child {
  margin-top: 0;
}

.js .tabs .tab-panel > .tab-title {
  display: none;
}

.tabs .tab-panel {
  margin-bottom: 1.5rem;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: 0.1em;
}

.badge-read {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.badge-write {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.badge-destructive {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.badge-neutral {
  background: var(--surface-2);
  color: var(--muted);
}

/* ---------- Tool reference ---------- */

.tool-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin: 0 0 1.25rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tool-controls label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.tool-controls .field {
  flex: 1 1 14rem;
  min-width: 0;
}

.tool-controls .field-narrow {
  flex: 0 1 12rem;
}

.tool-controls input,
.tool-controls select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
}

.tool-count {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.group-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.group-index li + li {
  margin-top: 0;
}

.group-index a {
  display: inline-block;
  font-size: 0.9rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
}

.group-index a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tool-group {
  margin-bottom: 2.5rem;
}

.tool-group > h2 {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.tool-group > h2 .n {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
}

.tool-group > p {
  color: var(--muted);
  max-width: var(--measure);
}

.tool-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}

.tool-list > li + li {
  margin-top: 0;
}

.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.tool:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.tool-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin-bottom: 0.35rem;
}

.tool-head h3 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-mono);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tool-head h3 a {
  color: var(--text);
  text-decoration: none;
}

.tool-head h3 a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.tool-title {
  color: var(--muted);
  font-size: 0.92rem;
}

.tool-badges {
  margin-left: auto;
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.tool p {
  margin: 0 0 0.5rem;
}

.tool .ask-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tool .ask-list li + li {
  margin-top: 0;
}

.tool .ask-list li {
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
}

.tool details {
  font-size: 0.92rem;
}

.tool summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  width: fit-content;
}

.tool details[open] summary {
  margin-bottom: 0.6rem;
}

.tool .notes {
  white-space: pre-line;
  color: var(--muted);
}

.params {
  font-size: 0.88rem;
}

.params td:first-child {
  white-space: nowrap;
}

.params .req {
  color: var(--danger-text);
  font-weight: 600;
  font-size: 0.8rem;
}

.no-results {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

/* ---------- Conversations (examples) ---------- */

.convo {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.25rem;
  margin: 0 0 2rem;
  box-shadow: var(--shadow);
}

.convo > h2 {
  margin-top: 0;
  font-size: 1.5rem;
}

.convo .intro {
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.msg {
  margin: 0 0 1rem;
  padding: 0.9rem 1.05rem;
  border-radius: var(--radius);
  max-width: 46rem;
}

.msg > :last-child {
  margin-bottom: 0;
}

.msg-who {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.msg-user {
  background: var(--accent-soft);
  margin-left: auto;
  max-width: 38rem;
}

.msg-user p {
  font-size: 1.05rem;
}

.msg-claude {
  background: var(--surface-2);
}

.calls {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.4rem;
}

.calls li + li {
  margin-top: 0;
}

.calls li {
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.5rem;
  color: var(--muted);
}

.calls li::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  align-self: center;
}

.calls a code {
  color: var(--accent);
}

.sample-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warn-text);
  background: var(--warn-bg);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  margin-left: 0.4rem;
  vertical-align: 0.15em;
}

.msg table {
  font-size: 0.9rem;
  background: transparent;
}

.msg .table-wrap {
  background: var(--surface);
}

.response-json summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
  width: fit-content;
}

.num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Steps ---------- */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 1.25rem;
}

.steps > li + li {
  margin-top: 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  display: grid;
  place-items: center;
}

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.92rem;
  color: var(--muted);
}

.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem 1rem 2.5rem;
  display: grid;
  gap: 1.25rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

.footer-links li + li {
  margin-top: 0;
}

.footer-links a {
  color: var(--text);
}

.disclaimer {
  margin: 0;
  max-width: 48rem;
}

/* ---------- Print ---------- */

@media print {
  .site-header,
  .site-footer .footer-links,
  .copy-btn,
  .nav-toggle,
  .toc,
  .tool-controls {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* ---------- Brand mark ---------- */

.mark .b {
  fill: var(--accent);
}

.mark .l {
  fill: var(--bg);
}

/* ---------- Flow (how it works) ---------- */

.flow {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.flow > li + li {
  margin-top: 0;
}

.flow-node {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.flow-node.is-accent {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.flow-node strong {
  display: block;
  font-size: 1.02rem;
}

.flow-node span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.flow-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.flow-link svg {
  width: 18px;
  height: 18px;
  transform: rotate(90deg);
  flex: none;
}

@media (min-width: 48rem) {
  .flow {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: stretch;
  }

  .flow-link {
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    text-align: center;
    max-width: 8.5rem;
  }

  .flow-link svg {
    transform: none;
  }
}

.arrow-icon {
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
