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

:root {
  color-scheme: light;
  --ink: #111;
  --muted: #687078;
  --line: #e6e8eb;
  --surface: #f7f8f9;
  --focus: #075985;
  --ok: #166534;
  --warn: #92400e;
  --bad: #991b1b;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  max-width: 700px;
  margin: 52px auto;
  padding: 0 22px;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

main { width: 100%; }

a {
  color: inherit;
  text-underline-offset: 3px;
}

a:hover { text-decoration: none; }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  z-index: 10;
  top: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  padding: .5rem .8rem;
  background: #fff;
  color: var(--ink);
}

.site-nav,
nav:not(.site-nav) {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 44px;
  margin-bottom: 2.2rem;
  color: var(--muted);
  font-size: .83rem;
}

.site-nav { justify-content: space-between; }
.site-nav a,
nav:not(.site-nav) a { color: var(--muted); }

.brand {
  color: var(--ink) !important;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

h1,
h2,
h3 { text-wrap: balance; }

h1 {
  margin: 0 0 .2rem;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
}

h2 {
  margin: 2.2rem 0 .6rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}

h3 {
  margin: 1.2rem 0 .35rem;
  font-size: 1rem;
}

p {
  margin: .5rem 0;
  text-wrap: pretty;
}

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

.dim,
.microcopy,
.card-sub,
.card-desc {
  color: var(--muted);
  font-size: .85rem;
}

.eyebrow,
.grp-head {
  margin: 1.8rem 0 .35rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.hero .eyebrow,
.account-hero .eyebrow,
.recipe-hero .eyebrow { margin-top: 0; }

.section-title { margin-top: 0; }

.hero,
.account-hero,
.recipe-hero {
  margin: 0 0 1.2rem;
  padding: 0;
}

.hero-copy,
.account-hero > p:last-child,
.recipe-hero > p:last-child {
  max-width: 64ch;
  color: var(--muted);
}

.hero-actions,
.button-row,
.secret-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .5rem .8rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition-property: transform, background-color, border-color, color;
  transition-duration: 120ms;
  transition-timing-function: ease-out;
}

.button:hover { background: var(--surface); }
.button:active:not(:disabled) { transform: scale(.96); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { border-color: var(--ink); background: var(--ink); color: #fff; }
.button-primary:hover { background: #303030; }
.button-secondary { background: #fff; }
.button-quiet { border-color: transparent; color: var(--muted); }
.button-danger { border-color: #fecaca; color: var(--bad); }
.button-danger:hover { background: #fff7f7; }

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.4rem 0 2.4rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.trust-strip span {
  padding: .65rem .8rem;
  color: var(--muted);
  font-size: .78rem;
}

.trust-strip span + span { border-left: 1px solid var(--line); }
.trust-strip strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.task-grid { margin: .4rem 0 2rem; }

.task-card {
  padding: .75rem 0;
  border-top: 1px solid #f0f0f0;
}

.task-card:last-child { border-bottom: 1px solid #f0f0f0; }
.task-card .eyebrow { margin: 0 0 .2rem; }
.task-card h3 { margin: 0 0 .2rem; }
.task-card p { margin: .3rem 0; }
.task-card a,
.card-name { color: var(--ink); }

.route-pill,
.tag,
.state-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 6px;
  border-radius: 3px;
  background: #f0f0f0;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.4;
}

.route-pill { margin-top: .25rem; }

.steps {
  margin: .4rem 0;
  padding-left: 1.25rem;
}

.steps li { margin: .45rem 0; padding-left: .15rem; }
.steps pre { margin: .45rem 0; }

.panel {
  margin: 2.2rem 0 0;
  padding-top: .25rem;
  border-top: 1px solid var(--line);
}

.panel h2:first-of-type { margin-top: .55rem; }

.handoff-panel,
.callout {
  margin: 2rem 0;
  padding: .8rem 1rem;
  border-top: 0;
  border-left: 3px solid var(--ink);
  background: #fafafa;
}

.handoff-panel .eyebrow { margin-top: 0; }

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}

code,
pre,
.ep { font-family: "SFMono-Regular", Consolas, monospace; }

code {
  padding: 1px 5px;
  border-radius: 3px;
  background: #f3f3f3;
  font-size: .87em;
}

pre {
  max-width: 100%;
  padding: 14px 16px;
  overflow-x: auto;
  border-left: 3px solid #cbd5e1;
  border-radius: 0 4px 4px 0;
  background: var(--surface);
  font-size: .83rem;
  line-height: 1.55;
  white-space: pre;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.copyable {
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}

.copy-button { margin: .35rem 0; }
.copy-button[data-copy-state="ok"] { border-color: #bbf7d0; color: var(--ok); }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

table {
  display: block;
  width: 100%;
  min-width: 28rem;
  max-width: 100%;
  margin: .8rem 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: .85rem;
  white-space: normal;
}

th {
  padding: .35rem .6rem;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: .4rem .6rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

td:not(:first-child),
.metric strong { font-variant-numeric: tabular-nums; }

details {
  padding: .45rem 0;
  border-top: 1px solid #f0f0f0;
}

details > summary {
  min-height: 44px;
  padding: .35rem 0;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
}

.provider-showcase { margin-top: 2.8rem; }
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.6rem;
  margin: .4rem 0 1rem;
}

.card {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  min-width: 0;
  padding: .65rem 0;
  border-top: 1px solid #f0f0f0;
}

.grid .card { padding: .5rem 0; border-top: 0; }
.card-body { min-width: 0; }
.card-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: .25rem;
  border-radius: 3px;
  outline: 1px solid rgb(0 0 0 / 10%);
  outline-offset: -1px;
}

.provider-title { display: flex; align-items: center; gap: .65rem; }
.provider-title .card-icon { width: 28px; height: 28px; margin-top: 0; border-radius: 5px; }
.provider-title h1 { margin: 0; }
.card-name { font-size: 1.05rem; font-weight: 600; }
.card-sub { margin-top: .18rem; }
.card-desc { margin-top: .25rem; color: #4b5563; }
.grp-head { margin-top: 1.6rem; color: #4b5563; font-size: .78rem; }

.ep {
  display: flex;
  align-items: baseline;
  gap: .55rem;
  padding: .28rem 0;
  font-size: .85rem;
}

.ep-method { min-width: 44px; flex-shrink: 0; color: #64748b; font-size: .8rem; }
.ep a { text-decoration: underline dotted; text-underline-offset: 3px; }
.param-req { color: var(--warn); font-size: .75rem; font-weight: 600; }
.param-opt { color: #64748b; font-size: .75rem; }
.tag { margin-left: 5px; vertical-align: middle; }
.tag-paid { background: #fef3c7; color: var(--warn); }
.tag-unconf,
.tag-browser { background: #f1f5f9; color: #64748b; }
.stat { display: inline-block; margin-right: 1.2rem; color: #4b5563; font-size: .85rem; }

.contract-facts {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  margin: .8rem 0 1.2rem;
  padding: .65rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}

.contract-facts strong { color: var(--ink); }

.account-shell { margin-top: 1.4rem; }
.account-shell .panel { margin-top: 2rem; }
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.panel-heading .eyebrow { display: none; }
.panel-heading h2 { margin-top: .55rem; }
.state-chip { flex-shrink: 0; margin-top: .55rem; white-space: nowrap; }
.state-chip[data-state="success"] { background: #dcfce7; color: var(--ok); }
.state-chip[data-state="loading"] { background: #f1f5f9; color: #52626d; }
.status-message { min-height: 1.8rem; color: var(--muted); }
.status-message[data-state="success"] { color: var(--ok); }
.status-message[data-state="error"] { color: var(--bad); }
.status-message[data-state="loading"]::after {
  display: inline-block;
  width: 1em;
  content: "…";
  animation: pulse 900ms ease-in-out infinite alternate;
}

.key-fingerprint code { font-variant-numeric: tabular-nums; }
.raw-key-panel {
  margin-top: 1rem;
  padding: .8rem 1rem;
  border-left: 3px solid var(--warn);
  background: #fffbeb;
}

.raw-key-panel[hidden] { display: none; }
.secret-row { margin-top: .4rem; }
.secret-row code { flex: 1 1 18rem; padding: .55rem; background: #fff; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: .8rem 0;
}

.metric {
  padding-top: .55rem;
  border-top: 1px solid #f0f0f0;
}

.metric span { display: block; color: var(--muted); font-size: .76rem; }
.metric strong { display: block; margin-top: .15rem; font-size: 1.2rem; line-height: 1.2; }
.next-action {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  gap: .75rem;
  align-items: center;
  margin: 1rem 0;
  padding: .7rem .85rem;
  border-left: 3px solid var(--ink);
  background: #fafafa;
  font-size: .88rem;
}

.next-action span { color: var(--muted); }
.next-action a { font-weight: 600; white-space: nowrap; }
.empty-cell { color: var(--muted); text-align: center; }
.siwe-review { margin-top: 1rem; }
.siwe-review pre { max-height: 280px; }

.recipe-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}

.recipe-meta strong { display: block; color: var(--ink); }
.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .84rem;
}

.status { display: inline-flex; align-items: center; gap: .35rem; }
.status::before {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-ok { color: var(--ok); }
.status-warn { color: var(--warn); }
.status-bad { color: var(--bad); }
.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;
}

@keyframes pulse { from { opacity: .25; } to { opacity: 1; } }

@media (max-width: 680px) {
  body { margin: 28px auto; padding: 0 16px; }
  h1 { font-size: 1.3rem; }
  .grid { grid-template-columns: 1fr; }
  .trust-strip { grid-template-columns: 1fr; }
  .trust-strip span + span { border-top: 1px solid var(--line); border-left: 0; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .next-action { grid-template-columns: 1fr; gap: .2rem; }
  .recipe-meta { grid-template-columns: 1fr; gap: .5rem; }
  pre { font-size: .78rem; }
}

@media (max-width: 460px) {
  .site-nav { align-items: flex-start; }
  .nav-links { gap: .55rem; }
  .nav-links a { font-size: .78rem; }
  .hero-actions,
  .button-row { align-items: stretch; flex-direction: column; }
  .hero-actions .button,
  .button-row .button { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .button { transition-duration: .01ms; }
}

/* /docs merges every reference topic into one page. */
.docs-toc p { line-height: 1.9; }
.docs-section { margin-top: 2.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
