:root {
  --bg: #fbfaf7; --fg: #1d1d1b; --muted: #6b6a66; --line: #e4e1da; --accent: #c2410c; --accent-fg: #fff;
  --code-bg: #f1eee7; --callout: #fff7ed; --alert: #b91c1c; --notice: #166534;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #151514; --fg: #ecebe7; --muted: #a3a19b; --line: #2e2d2a; --accent: #fb923c; --accent-fg: #1d1d1b;
    --code-bg: #22211f; --callout: #2a1d12; --alert: #f87171; --notice: #4ade80; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
code, pre { font-family: var(--mono); font-size: 0.875em; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; }
pre { background: var(--code-bg); padding: 1rem; border-radius: 8px; overflow-x: auto; line-height: 1.45; }
pre code { background: none; padding: 0; }

.brand { font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; letter-spacing: -0.01em; }

main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.docs-nav { display: flex; flex-direction: column; gap: 0.35rem; position: sticky; top: 5.5rem; font-size: 0.95rem; }
.docs-nav a { color: var(--fg); text-decoration: none; }
.docs-nav a.current { color: var(--accent); font-weight: 600; }
.nav-heading { margin: 1rem 0 0.25rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.nav-heading:first-child { margin-top: 0; }

.prose { max-width: 760px; }
.prose h1 { font-size: 2rem; line-height: 1.2; margin-top: 0; }
.prose h2 { margin-top: 2.25rem; border-top: 1px solid var(--line); padding-top: 1.25rem; }
table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.fields { margin: 0.75rem 0 1.5rem; border-top: 1px solid var(--line); }
.field { padding: 0.75rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 5rem; }
.field dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.6rem; }
.field-name { font-weight: 600; }
.field-type { color: var(--muted); }
.field dd { margin: 0.35rem 0 0; }
.field-args { padding-left: 0.9rem; border-left: 2px solid var(--line); font-size: 0.92em; }
.field-args-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.field-args ul { list-style: none; margin: 0.2rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.args { margin-top: 0.3rem; font-size: 0.85rem; }
tr.revoked { color: var(--muted); text-decoration: line-through; }
table.compact { width: auto; }

.button, input[type=submit] { display: inline-block; background: var(--accent); color: var(--accent-fg); border: 0; border-radius: 8px; padding: 0.6rem 1.1rem; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.button.secondary { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.button.small { padding: 0.35rem 0.8rem; font-size: 0.9rem; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
button.link.danger { color: var(--alert); }
input[type=email], input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea { font: inherit; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); min-width: 0; }
form.stack { display: flex; flex-direction: column; gap: 0.6rem; max-width: 420px; }
form.inline { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0 2rem; }
form.inline input[type=search] { flex: 1 1 14rem; max-width: 28rem; }
table form.inline { margin: 0; flex-wrap: nowrap; align-items: center; }
table form.inline input[type=number] { width: 4.5rem; }
table form.inline input.money { width: 8.5rem; }
.focus-card form.inline { margin: 0; flex-wrap: nowrap; }
.focus-card form.inline input[type=text] { flex: 1; min-width: 0; }
.focus-card form.inline .button { flex: none; width: auto; }
.hp { position: absolute; left: -10000px; }

.narrow { max-width: 520px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.flash { max-width: 1100px; margin: 1rem auto 0; padding: 0.6rem 1.5rem; }
.flash.notice { color: var(--notice); }
.flash.alert { color: var(--alert); }
.dev { padding: 0.75rem 1rem; border: 1px dashed var(--accent); border-radius: 8px; }
.callout { background: var(--callout); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.25rem; margin: 1.5rem 0; }
.callout h2 { margin-top: 0; }
pre.token { font-size: 1rem; user-select: all; }

.lede { font-size: 1.2rem; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
.grid h3 { margin: 0 0 0.35rem; }

.explorer-bar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.explorer-bar input { width: 360px; max-width: 100%; }
#graphiql { height: 75vh; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }

footer { border-top: 1px solid var(--line); padding: 1.5rem; color: var(--muted); font-size: 0.8rem; text-align: center; }
footer p { margin: 0.25rem auto; max-width: 900px; }

main.consent { padding-top: 3rem; }
.consent-actions { display: flex; gap: 0.75rem; margin: 1.5rem 0; }
.consent-actions form { margin: 0; }
.user-code { font-family: var(--mono); font-size: 2rem; letter-spacing: 0.15em; font-weight: 700; }
.legal blockquote { margin: 0 0 1.5rem; padding: 0.75rem 1rem; border-left: 4px solid var(--accent); background: var(--callout); border-radius: 0 8px 8px 0; }
.legal blockquote p { margin: 0; }
