:root {
  --ink: #17191d;
  --muted: #626873;
  --line: #e2e5e9;
  --blue: #245de8;
  --paper: #fbfcfe;
  --silver: #f2f4f7;
  --code-bg: #0e0f13;
  --code-ink: rgba(255, 255, 255, 0.92);
  --code-dim: rgba(255, 255, 255, 0.5);
  --green: #1f9d55;
  --orange: #c26a00;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.6; font-size: 16px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em; }
:not(pre) > code { background: var(--silver); border: 1px solid var(--line); border-radius: 5px; padding: 0.08em 0.35em; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 14px 28px; background: rgba(251, 252, 254, 0.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top img { height: 20px; display: block; }
.top .tag { font-size: 13px; font-weight: 600; color: var(--muted); border-left: 1px solid var(--line); padding-left: 14px; }
.top .spacer { flex: 1; }
.top a.home { font-size: 14px; color: var(--muted); }

.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
nav.toc { position: sticky; top: 57px; align-self: start; height: calc(100vh - 57px); overflow-y: auto; padding: 32px 20px 40px 28px; border-right: 1px solid var(--line); font-size: 14px; }
nav.toc h4 { margin: 22px 0 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
nav.toc h4:first-child { margin-top: 0; }
nav.toc a { display: block; padding: 4px 0; color: var(--ink); }
nav.toc a:hover { color: var(--blue); text-decoration: none; }

main { padding: 40px 56px 120px; max-width: 860px; }
main h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 14px; }
main .lede { font-size: 19px; color: var(--muted); margin: 0 0 28px; max-width: 640px; }
main h2 { font-size: 26px; letter-spacing: -0.01em; margin: 64px 0 12px; padding-top: 12px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
main h3 { font-size: 18px; margin: 32px 0 8px; scroll-margin-top: 80px; }
main p, main li { max-width: 720px; }

pre { background: var(--code-bg); color: var(--code-ink); padding: 18px 20px; border-radius: 12px; overflow-x: auto; line-height: 1.55; margin: 14px 0 20px; position: relative; }
pre .c { color: var(--code-dim); }
pre .k { color: #7ab8ff; }
pre .s { color: #9be29b; }
pre[data-label]::before { content: attr(data-label); position: absolute; top: 8px; right: 14px; font-size: 11px; color: var(--code-dim); letter-spacing: 0.04em; }

table { border-collapse: collapse; width: 100%; margin: 12px 0 24px; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
td code { white-space: nowrap; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin: 0 0 28px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: white; font-weight: 600; font-size: 14px; display: grid; place-items: center; }
.steps > li > strong { display: block; font-size: 17px; margin-bottom: 4px; }

.callout { border: 1px solid var(--line); background: var(--silver); border-radius: 12px; padding: 14px 18px; margin: 18px 0; font-size: 15px; }
.callout.warn { background: #fff8ec; border-color: #f3d9a8; }
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 18px 0 8px; }
.pipeline div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: white; font-size: 14px; }
.pipeline b { display: block; font-size: 14.5px; margin-bottom: 2px; }

/* Try it */
.try { border: 1px solid var(--line); border-radius: 16px; background: white; padding: 22px; margin: 18px 0 8px; }
.try label { font-size: 13px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; }
.try input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-family: ui-monospace, "SF Mono", monospace; font-size: 13px; }
.try .row { display: flex; gap: 12px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.try button.mic { border: 0; border-radius: 999px; background: var(--ink); color: white; padding: 12px 22px; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; gap: 10px; user-select: none; }
.try button.mic.live { background: #d93025; }
.try button.mic:disabled { opacity: 0.4; }
.try .meter { width: 120px; height: 6px; border-radius: 3px; background: var(--silver); overflow: hidden; }
.try .meter span { display: block; height: 100%; width: 0; background: var(--green); transition: width 60ms linear; }
.try .status { font-size: 14px; color: var(--muted); }
.try .hint { margin-top: 12px; font-size: 14px; color: var(--orange); min-height: 20px; }
.try .out { margin-top: 12px; min-height: 64px; border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; font-size: 16px; white-space: pre-wrap; }
.try .meta { margin-top: 8px; font-size: 12.5px; color: var(--muted); font-family: ui-monospace, "SF Mono", monospace; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  nav.toc { display: none; }
  main { padding: 28px 20px 80px; }
}
