/* Culprit docs, design A (Terminal Steps) on the original layout: sidebar · content · on this page. */
:root {
  --bg: #0d0e10; --side: #111214; --panel: #17181b; --panel2: #1d1f23; --line: #2a2c31; --line2: #3a3d44;
  --fg: #f1f1f3; --text: #d5d6da; --muted: #9a9ca4; --acc: #f2b544; --term: #050506;
  --good: #5bd394; --bad: #ff6b57; --info: #7fb2ff;
  --display: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --top: 56px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.7 var(--display); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
kbd { font: 11px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: var(--muted); background: var(--panel); }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 18px; padding-inline: 20px;
  border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.logo { font-weight: 700; color: var(--fg); letter-spacing: -.02em; display: flex; gap: 8px; align-items: center; text-decoration: none; }
.logo i { width: 14px; height: 14px; border: 2px solid var(--acc); display: inline-block; }
.section { color: var(--muted); text-decoration: none; font-size: 14px; padding-left: 14px; border-left: 1px solid var(--line); }
.search-btn { margin-left: 12px; display: flex; align-items: center; gap: 28px; justify-content: space-between; min-width: 220px;
  font: 14px var(--display); color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px 6px 12px; cursor: pointer; }
.search-btn:hover { border-color: var(--muted); }
.top-links { margin-left: auto; display: flex; gap: 18px; align-items: center; font-size: 14px; color: var(--muted); }
.top-links a { text-decoration: none; }
.top-links a:hover { color: var(--fg); }
.ver { font: 12px var(--mono); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.menu { display: none; background: none; border: 0; padding: 6px; cursor: pointer; flex-direction: column; gap: 4px; }
.menu span { width: 18px; height: 2px; background: var(--fg); display: block; }

/* layout: as the original site */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr) 220px; max-width: 1400px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 22px 14px 40px 16px;
  border-right: 1px solid var(--line); background: var(--side); }
.content { min-width: 0; padding: 40px 48px 64px; max-width: 860px; }
.toc { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 40px 20px 40px 8px; font-size: 13px; }

/* sidebar */
.nav-group { margin-bottom: 24px; }
.nav-title { font: 600 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px 8px; }
.sidebar ul, .sidebar ol { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: block; text-decoration: none; font-size: 14.5px; color: var(--text); padding: 5px 8px; border-radius: 6px; }
.sidebar a:hover { background: var(--panel); color: var(--fg); }
.sidebar a[aria-current="page"] { background: var(--panel2); color: var(--fg); box-shadow: inset 3px 0 0 var(--acc); }
.sidebar code { font: 500 13px var(--mono); color: var(--fg); }
.sidebar small { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; }
/* the command sequence: numbered circles on a line */
.seq ol { position: relative; }
.seq ol::before { content: ""; position: absolute; left: 19px; top: 18px; bottom: 18px; width: 2px; background: var(--line); }
.seq a { display: flex; gap: 10px; align-items: flex-start; position: relative; padding: 6px 8px; }
.seq .n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--side); border: 2px solid var(--acc); color: var(--acc);
  font: 600 11.5px/20px var(--mono); text-align: center; z-index: 1; margin-top: 1px; }
.seq a[aria-current="page"] .n { background: var(--acc); color: var(--bg); }
.seq .c { display: grid; min-width: 0; }
.cmds a { padding: 5px 8px; }
/* collapsed sections */
.fold { border-top: 1px solid var(--line); padding: 8px 0; }
.fold summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center;
  font: 600 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-radius: 6px; }
.fold summary:hover { color: var(--fg); background: var(--panel); }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "+"; font-size: 15px; line-height: 1; }
.fold[open] summary::after { content: "–"; }
.fold ul { margin-top: 4px; }

/* on this page */
.toc-title { font: 600 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 1px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.4; }
.toc li.l3 a { padding-left: 24px; }
.toc li a:hover { color: var(--fg); }
.toc li a.active { color: var(--acc); border-left-color: var(--acc); }

/* page head */
.crumb { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--acc); margin-bottom: 10px; }
.content > h1 { font-size: clamp(30px, 4vw, 40px); line-height: 1.1; letter-spacing: -.03em; font-weight: 600; color: var(--fg); margin: 0; text-wrap: balance; }
.lead { font-size: 18px; color: var(--muted); margin: 12px 0 32px; max-width: 62ch; }

/* prose */
.prose { max-width: 74ch; }
.prose h2 { font-size: 23px; letter-spacing: -.02em; font-weight: 600; color: var(--fg); margin: 44px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); text-wrap: balance; }
.prose h3 { font-size: 17px; font-weight: 600; color: var(--fg); margin: 30px 0 8px; }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose .headerlink { margin-left: 8px; color: var(--muted); text-decoration: none; opacity: 0; font-weight: 400; }
.prose h2:hover .headerlink, .prose h3:hover .headerlink, .prose .headerlink:focus { opacity: 1; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose li { margin: 4px 0; }
.prose li > p { margin: 0 0 8px; }
.prose a { color: var(--acc); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); }
.prose a:hover { border-bottom-color: var(--acc); }
.prose strong { font-weight: 600; color: var(--fg); }
.prose :not(pre) > code { font: .87em var(--mono); color: var(--fg); background: var(--panel); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; overflow-wrap: anywhere; }

/* commands: a terminal window with an always-visible Copy button */
.term { border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; background: var(--term); margin: 0 0 16px; box-shadow: 0 8px 28px rgba(0,0,0,.35); }
.term-h { display: flex; align-items: center; gap: 7px; padding: 7px 8px 7px 12px; background: var(--panel2); border-bottom: 1px solid var(--line2); }
.term-h i { width: 10px; height: 10px; border-radius: 50%; background: #45484f; }
.term-h .label { font: 500 12px var(--mono); color: var(--muted); margin-left: 4px; }
.term.file .term-h .label { margin-left: 0; }
.copy { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; font: 600 12.5px var(--display); color: var(--bg); background: var(--acc);
  border: 0; border-radius: 6px; padding: 5px 11px; cursor: pointer; }
.copy:hover { filter: brightness(1.1); }
.copy.done { background: var(--good); }
.term pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.term pre code { font: 14px/1.7 var(--mono); color: #f5f5f7; white-space: pre; }
.term .pr { color: var(--acc); user-select: none; }
.term .tok-c { color: var(--muted); }
.term.file pre code { font-size: 13.5px; color: var(--text); }
/* output: dashed, quieter, no copy */
.out { border: 1px dashed var(--line2); border-radius: 10px; margin: -6px 0 16px; }
.out-h { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 14px 0; }
.out pre { margin: 0; padding: 6px 14px 12px; overflow-x: auto; }
.out pre code { font: 13px/1.65 var(--mono); color: var(--muted); white-space: pre; }
.term + .out { margin-top: -8px; border-top-left-radius: 0; border-top-right-radius: 0; }

/* tables */
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 18px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--panel); font-weight: 500; color: var(--muted); font-size: 13px; white-space: nowrap; }
.prose td code { white-space: nowrap; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* callouts */
.admonition { border: 1px solid var(--line); border-left: 3px solid var(--info); background: var(--panel); border-radius: 8px; padding: 12px 16px; margin: 0 0 18px; }
.admonition-title { font-weight: 600; margin: 0 0 4px !important; font-size: 14.5px; }
.admonition p:last-child { margin-bottom: 0; }
.admonition.tip { border-color: #2c5a42; border-left-color: var(--good); background: #0f1d16; }
.admonition.warning { border-color: #5a4720; border-left-color: var(--acc); background: #1c170c; }
.admonition.danger { border-left-color: var(--bad); }
.admonition.tip .admonition-title { color: var(--good); }
.admonition.warning .admonition-title { color: var(--acc); }
.admonition.danger .admonition-title { color: var(--bad); }
.admonition.note .admonition-title { color: var(--info); }

/* numbered steps: amber circles */
.prose ol.steps { list-style: none; counter-reset: s; padding: 0; }
.prose ol.steps > li { counter-increment: s; position: relative; padding-left: 44px; margin: 0 0 22px; }
.prose ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--acc); color: var(--bg); font: 700 13px/28px var(--mono); text-align: center; }

/* cards */
.prose ul.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.prose ul.cards > li { margin: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 14px 16px; }
.prose ul.cards > li a { border: 0; font-weight: 600; color: var(--fg); }
.prose ul.cards > li a::after { content: " →"; color: var(--acc); }
.prose ul.cards > li:hover { border-color: var(--muted); }

/* pager + footer */
.pagers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; max-width: 74ch; }
.pager { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; text-decoration: none; display: grid; gap: 2px; font-weight: 500; color: var(--fg); }
.pager span { font: 12px var(--mono); color: var(--muted); }
.pager:hover { border-color: var(--acc); }
.pager.next { grid-column: 2; text-align: right; }
.foot { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; max-width: 74ch; }

/* search */
.search[hidden] { display: none; }
.search { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.search-box { width: min(640px, 100%); background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
#search-input { width: 100%; font: 16px var(--display); color: var(--fg); background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 14px 16px; outline: none; }
#search-results { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
#search-results li a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--fg); }
#search-results li a small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#search-results li a mark { background: none; color: var(--acc); }
#search-results li.sel a, #search-results li a:hover { background: var(--panel2); }
#search-results .empty { padding: 14px 10px; color: var(--muted); font-size: 14px; }
.search-foot { border-top: 1px solid var(--line); padding: 8px 12px; color: var(--muted); font-size: 12px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* responsive */
@media (max-width: 1180px) { .shell { grid-template-columns: 250px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu { display: flex; }
  .section, .top-links a { display: none; }
  .search-btn { min-width: 0; margin-left: auto; gap: 10px; }
  .top-links { margin-left: 0; }
  .sidebar { position: fixed; top: var(--top); left: 0; bottom: 0; width: min(300px, 85vw); height: auto; z-index: 15; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  .content { padding: 28px 16px 48px; }
  .prose ul.cards { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .search-btn span { display: none; } .pagers { grid-template-columns: 1fr; } .pager.next { grid-column: 1; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
