:root {
  color-scheme: light dark;
  --bg: #F5FCF8; --card: #FFFFFF; --text: #08231A; --muted: #3D5A4E; --line: #CDE7DB;
  --accent: #047857; --accent-ink: #08231A; --sun: #34D399; --code-bg: #06120D; --code-text: #ECFDF5; --code-muted: #A9C9BA;
  --warn: #8A4B00; --warn-bg: #FFF3E0; --focus: #08231A;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #06120D; --card: #0B1F17; --text: #ECFDF5; --muted: #A9C9BA; --line: #1E3D30;
    --accent: #34D399; --accent-ink: #08231A; --code-bg: #0F2A20; --code-text: #ECFDF5; --code-muted: #A9C9BA;
    --warn: #FFB300; --warn-bg: #0F2A20; --focus: #34D399;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  border-top: 10px solid; border-image: linear-gradient(90deg, #3EE0A0, #0E9F6E) 1;
  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: center; 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.1rem; font-weight: 800; margin-right: auto; flex-basis: 100%; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
nav.top a.home img { display: block; border-radius: 23%; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent); }
nav.top a[aria-current] { color: var(--accent); }
header { margin: 26px 0 8px; }
header h1 { font-size: 2.3rem; font-weight: 800; line-height: 1.1; margin: 0 0 10px; letter-spacing: -0.03em; }
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); }
.nb { white-space: nowrap; }
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; }
section :is(h2) { letter-spacing: -0.015em; }
.code { position: relative; background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 12px 14px; margin: 8px 0 12px; }
.code:last-child { margin-bottom: 0; }
.code pre { margin: 0 72px 0 0; padding-right: 8px; overflow-x: auto; white-space: pre; 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: 1.5px solid #34D399; background: var(--code-bg); color: #34D399; cursor: pointer; }
.copy:hover { background: #34D399; color: #08231A; }
.copy:focus-visible { outline-color: #34D399; }
.note, .warn { border-left: 5px solid var(--sun); padding: 8px 12px; margin: 12px 0; background: color-mix(in srgb, var(--sun) 14%, 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:hover strong { text-decoration: underline; }
.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: var(--sun); color: #08231A; 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 { gap: 0 14px; padding-bottom: 8px; }
  nav.top a { font-size: 0.875rem; padding: 7px 0; }
  nav.top a.home { font-size: 1.1rem; flex-basis: 100%; padding: 0 0 4px; }
  .nav-long { display: none; }
  .code { padding-top: 38px; }
  .code pre { font-size: 0.82rem; margin-right: 0; padding-right: 0; }
}

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