:root {
  --bg: #f7f8fa; --card: #ffffff; --text: #16191d; --muted: #5b6470; --line: #e2e6eb;
  --accent: #2f7a6b; --accent-ink: #ffffff; --code-bg: #0f1720; --code-text: #e6edf3; --code-muted: #8b98a5;
  --warn: #9a6700; --warn-bg: #fff8e6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1114; --card: #161a1f; --text: #e8ecf0; --muted: #9aa4af; --line: #262c33;
    --accent: #5cc3ab; --accent-ink: #06231d; --code-bg: #0a0d10; --code-text: #e6edf3; --code-muted: #7d8994;
    --warn: #e3b341; --warn-bg: #2a2210;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 56px; }
nav.top { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
nav.top a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
nav.top a.home { color: var(--text); font-size: 1.05rem; margin-right: auto; }
nav.top a[aria-current] { color: var(--accent); }
header { margin: 26px 0 8px; }
header h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.02em; }
header p { margin: 0; color: var(--muted); font-size: 1.08rem; }
section { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-top: 18px; }
h2 { font-size: 1.25rem; margin: 0 0 12px; line-height: 1.3; }
h3 { font-size: 1.02rem; margin: 20px 0 8px; }
h2 + h3 { margin-top: 4px; }
p { margin: 0 0 12px; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 12px; padding-left: 1.3em; }
li { margin: 4px 0; }
ol.steps > li { margin: 0 0 18px; }
ol.steps > li:last-child { margin-bottom: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
p code, li code, td code { background: color-mix(in srgb, var(--line) 60%, transparent); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.code { position: relative; background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 12px 14px; margin: 8px 0 12px; overflow-x: auto; }
.code:last-child { margin-bottom: 0; }
.code pre { margin: 0; white-space: pre; padding-right: 60px; font-size: 0.88rem; line-height: 1.5; }
.code .c { color: var(--code-muted); }
.copy { position: absolute; top: 8px; right: 8px; font: 600 12px/1 inherit; font-family: inherit; padding: 6px 9px; border-radius: 7px; border: 1px solid #33404d; background: #1c2630; color: #e6edf3; cursor: pointer; }
.note, .warn { border-left: 3px solid var(--accent); padding: 8px 12px; margin: 12px 0; background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 0 8px 8px 0; }
.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.note p, .warn p { margin: 0 0 6px; }
.note > :last-child, .warn > :last-child { margin-bottom: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-top: 18px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-decoration: none; color: var(--text); }
.card:hover { border-color: var(--accent); }
.card strong { display: block; font-size: 1.05rem; margin-bottom: 4px; color: var(--accent); }
.card span { color: var(--muted); font-size: 0.95rem; }
.toc { margin-top: 18px; padding: 14px 20px; }
.toc ol { margin: 6px 0 0; }
.toc strong { font-size: 0.95rem; }
.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 12px; font-size: 0.92rem; }
.flow span { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; }
.flow i { font-style: normal; color: var(--muted); }
.table-wrap { overflow-x: auto; margin: 8px 0 12px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 0.88rem; }
tr:last-child td { border-bottom: 0; }
details { border-top: 1px solid var(--line); padding: 10px 0; }
details:first-of-type { border-top: 0; padding-top: 0; }
summary { cursor: pointer; font-weight: 600; }
details > :not(summary) { margin-top: 8px; }
.pill { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); vertical-align: 2px; margin-left: 6px; }
footer { margin-top: 26px; color: var(--muted); font-size: 0.92rem; }
footer p { margin: 6px 0; }
@media (max-width: 480px) {
  header h1 { font-size: 1.7rem; }
  section { padding: 16px; }
  nav.top a.home { flex-basis: 100%; margin-bottom: 4px; }
  .code { padding-top: 38px; }
  .code pre { font-size: 0.82rem; padding-right: 0; }
}

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
