/* The developer docs. The colours are the tokens of the account pages'
   stylesheet (web/static/app.css), repeated here because the docs are
   served on their own; dark mode follows the device. */

:root {
  --bg: #f6f6f8;
  --surface: #ffffff;
  --surface-2: #f0f0f4;
  --border: #e3e3ea;
  --text: #17171c;
  --muted: #5a5a66;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-text: #4338ca;
  --link: #4338ca;
  --focus: #4f46e5;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c10;
    --surface: #15151b;
    --surface-2: #1e1e27;
    --border: #2b2b37;
    --text: #ececf1;
    --muted: #a2a2b0;
    --accent-hover: #5a52ea;
    --accent-soft: #1f1d47;
    --accent-text: #b4b9ff;
    --link: #a5b0ff;
    --focus: #a5b0ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.65; margin: 0; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent); color: #fff; }
a { color: var(--link); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, main:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: .5rem; top: -4rem; padding: .5rem .9rem; border-radius: 8px; background: var(--text); color: var(--bg); z-index: 10; }
.skip:focus { top: .5rem; }

header.site { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.brand { max-width: 72.5rem; margin: 0 auto; padding: .7rem 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.brand a { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); text-decoration: none; }
.brand a::before { content: ""; width: 1.35rem; height: 1.35rem; border-radius: .45rem; background: linear-gradient(135deg, #6366f1, #a855f7 60%, #ec4899); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.brand a:hover { text-decoration: underline; }

.layout { max-width: 72.5rem; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.site-nav { position: sticky; top: 4.25rem; max-height: calc(100vh - 5rem); overflow-y: auto; font-size: .925rem; padding-right: .25rem; }
.nav-section { margin: 1.1rem .65rem .3rem; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.nav-section:first-child { margin-top: 0; }
.site-nav ul, .toc ul { list-style: none; padding: 0; margin: 0; }
.site-nav li { margin: 1px 0; }
.site-nav a { display: block; padding: .35rem .65rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current=page] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

main { min-width: 0; max-width: 46rem; }
h1 { font-size: 1.9rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 1rem; }
h2 { font-size: 1.3rem; line-height: 1.3; letter-spacing: -.01em; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
h3 { font-size: 1.05rem; margin-top: 1.75rem; }

.toc { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: .8rem 1rem; margin-bottom: 1.5rem; font-size: .925rem; }
.toc-title { margin: 0 0 .3rem; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc li { margin: .15rem 0; }

code { font-family: var(--mono); font-size: .875em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
/* A long address in inline code wraps instead of widening the page. */
:not(pre) > code { overflow-wrap: anywhere; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; overflow-x: auto; white-space: pre; line-height: 1.5; }
pre code { background: none; padding: 0; font-size: .85rem; }
pre:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* The Copy button the ai-prompts page's script puts before each code block. */
.copy { display: block; margin: 1rem 0 -.5rem auto; padding: .35rem .85rem; font: inherit; font-size: .85rem; font-weight: 600; color: #fff; background: var(--accent); border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.copy:hover { background: var(--accent-hover); }
.copy:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* render.go wraps each table in .table-wrap, which scrolls sideways; the
   table itself keeps its table display. */
.table-wrap { max-width: 100%; overflow-x: auto; margin: 1rem 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .925rem; }
th, td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }

blockquote { margin: 1rem 0; padding: .6rem 1rem; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: var(--radius); background: var(--accent-soft); }
blockquote > :first-child { margin-top: 0; }
blockquote > :last-child { margin-bottom: 0; }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.pager a { display: block; max-width: 48%; padding: .7rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; font-weight: 600; }
.pager a:hover { border-color: var(--accent); }
.pager .next { margin-left: auto; text-align: right; }
.pager-label { display: block; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* Phone width: one column, the navigation above the page. */
@media (max-width: 48rem) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-top: 1rem; }
  .site-nav { position: static; max-height: none; border-bottom: 1px solid var(--border); padding-bottom: .75rem; }
  .site-nav ul { display: flex; flex-wrap: wrap; gap: .15rem .25rem; }
  .nav-section { margin-left: 0; }
  .site-nav a { padding: .2rem .5rem; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
  .pager .next { text-align: left; margin-left: 0; }
}
