:root {
  --bg: #fbfaf7; --paper: #ffffff; --text: #1f2430; --muted: #5d6474;
  --accent: #2c5fd6; --accent-soft: #eaf0fd; --line: #e4e2dc;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14161b; --paper: #1b1e25; --text: #e6e8ee; --muted: #a2a8b6;
          --accent: #7ea3ff; --accent-soft: #232b40; --line: #2b2f39; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.7 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }

.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top .wrap { display: flex; align-items: baseline; gap: 10px; padding-top: 16px; padding-bottom: 14px; }
.brand { font: 700 21px/1.2 var(--serif); color: var(--text); text-decoration: none; }
.tag { color: var(--muted); font-size: 14px; }

.wrap { max-width: 1040px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.layout { display: grid; grid-template-columns: 230px 1fr; gap: 48px; padding-top: 36px; }

.toc { position: sticky; top: 24px; align-self: start; font-size: 15px; }
.toc p { text-transform: uppercase; letter-spacing: .12em; font-size: 11.5px; color: var(--muted); margin: 0 0 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; border-left: 2px solid var(--line); }
.toc li { counter-increment: t; margin: 0; }
.toc a { display: block; padding: 7px 0 7px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.toc a::before { content: counter(t) ". "; }
.toc a:hover { color: var(--text); }
.toc a[aria-current="page"] { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

article { max-width: 680px; min-width: 0; }
h1 { font: 700 clamp(30px, 5vw, 42px)/1.15 var(--serif); margin: 0 0 14px; letter-spacing: -.01em; }
h2 { font: 700 24px/1.25 var(--serif); margin: 38px 0 10px; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 8px; }
figure { margin: 26px 0; }
figure img { width: 100%; height: auto; display: block; border-radius: 6px; }

ol.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
ol.steps > li { counter-increment: s; position: relative; padding: 2px 0 18px 54px; margin: 0; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font: 700 17px/36px var(--serif); text-align: center; }
ol:not(.steps) li, ul li { margin: 6px 0; }

.callout { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 14px 18px; border-radius: 0 6px 6px 0; margin: 22px 0; }
.note { color: var(--muted); font-size: 15px; }

.next { display: flex; justify-content: space-between; gap: 12px; margin: 40px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-weight: 600; }
.next a { text-decoration: none; }

.codebox { margin: 44px 0 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 15px; color: var(--muted); }
.codebox code { font: 600 15px ui-monospace, Consolas, monospace; color: var(--text); }

footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 20px 0 40px; color: var(--muted); font-size: 13.5px; }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; gap: 8px; padding-top: 20px; }
  .toc { position: static; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .tag { display: none; }
}
