/* The machine API documentation page (tools/docs.ts). Served as /docs/docs.css under style-src 'self'. */

:root {
  --bg: #ffffff;
  --fg: #1c1f24;
  --muted: #5d6673;
  --line: #dde1e6;
  --panel: #f5f7f9;
  --accent: #0b5cad;
  --code-bg: #f0f2f5;
  --get: #1f7a46;
  --post: #0b5cad;
  --req: #a3381c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --fg: #e4e7eb;
    --muted: #9aa3ae;
    --line: #2c3239;
    --panel: #1b1f24;
    --accent: #6cb0f5;
    --code-bg: #20252b;
    --get: #5cc58a;
    --post: #6cb0f5;
    --req: #f08f72;
  }
}

* { box-sizing: border-box; }

html { scroll-padding-top: 16px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); padding: 12px 14px; border-radius: 6px; overflow-x: auto; line-height: 1.45; }
pre code { background: none; padding: 0; overflow-wrap: normal; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--panel); border-bottom: 1px solid var(--line); padding: 28px 0 20px; }
.brand { margin: 0; color: var(--muted); font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; }
.top h1 { margin: 4px 0 8px; font-size: 1.9rem; line-height: 1.2; }
.version { color: var(--muted); font-size: 1rem; font-weight: 500; }
.lede { margin: 0 0 14px; max-width: 760px; }
.actions { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.button {
  display: inline-block; padding: 7px 14px; border-radius: 6px;
  background: var(--accent); color: var(--bg); text-decoration: none; font-weight: 600;
}

.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; padding-top: 24px; }

.toc { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; font-size: 0.9rem; }
.toc-head { margin: 0 0 6px; font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }
.toc ul { list-style: none; margin: 0 0 18px; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 3px 0; color: var(--fg); text-decoration: none; }
.toc a:hover { color: var(--accent); }

main { min-width: 0; }
h2.part { font-size: 1.5rem; margin: 8px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
#reference { margin-top: 48px; }
main h3 { font-size: 1.2rem; margin: 32px 0 8px; }
main h4 { font-size: 1rem; margin: 20px 0 6px; }

.scroll { overflow-x: auto; margin: 8px 0 16px; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--panel); font-weight: 600; }
td p { margin: 0 0 4px; }
main > section > table, #guide table { display: block; overflow-x: auto; }

.op { border: 1px solid var(--line); border-radius: 8px; padding: 4px 18px 8px; margin: 24px 0; }
.op h3 { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.op h3 code { background: none; padding: 0; font-size: 1rem; }
.method { font-size: 0.78rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; color: var(--bg); letter-spacing: 0.04em; }
.method.get { background: var(--get); }
.method.post { background: var(--post); }
.summary { font-weight: 600; margin-top: 0; }

.schema { margin: 18px 0; }
.req { color: var(--req); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.muted { color: var(--muted); }
.chips code { display: inline-block; margin: 0 2px 4px 0; }
details summary { cursor: pointer; color: var(--accent); }

footer { margin-top: 48px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: 0.85rem; }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .toc { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
  .toc ul { columns: 2; column-gap: 16px; }
  .top h1 { font-size: 1.5rem; }
}
