:root {
  --bg: #ffffff; --bg-side: #f8faf9; --bg-soft: #f3f6f5; --panel: #ffffff; --line: #e3e8e6; --line-strong: #cfd7d4;
  --text: #14191d; --muted: #4f5960; --faint: #66717a; --accent: #08704f; --accent-hover: #065c41; --accent-soft: #e6f4ee; --accent-text: #ffffff;
  --note-bg: #f0f7f4; --warn-bg: #fdf6e7; --warn-line: #d9a640; --warn-text: #5c3d00;
  --code-bg: #f1f4f3; --code-text: #1f2a30;
  --term-bg: #0f151b; --term-bar: #172029; --term-line: #24303b; --term-text: #e4ebf1; --term-muted: #9aa8b6;
  --focus: #1d5fd1; --radius: 8px; --shadow: 0 1px 2px rgba(16,24,20,.05), 0 8px 24px rgba(16,24,20,.08);
  --top-h: 56px; --side-w: 264px; --toc-w: 232px; --content-w: 740px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1117; --bg-side: #0d141b; --bg-soft: #121b24; --panel: #111a22; --line: #1e2a35; --line-strong: #2b3a47;
    --text: #e6edf3; --muted: #a3b1be; --faint: #8b9aa8; --accent: #3fd49a; --accent-hover: #6be3b4; --accent-soft: #10271f; --accent-text: #04140d;
    --note-bg: #0f1f1a; --warn-bg: #221c0e; --warn-line: #a17a27; --warn-text: #f1dba6;
    --code-bg: #16212b; --code-text: #d7e1ea;
    --term-bg: #070b0f; --term-bar: #0f161d; --term-line: #1c2731; --focus: #8ab4ff; --shadow: 0 8px 30px rgba(0,0,0,.45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1117; --bg-side: #0d141b; --bg-soft: #121b24; --panel: #111a22; --line: #1e2a35; --line-strong: #2b3a47;
  --text: #e6edf3; --muted: #a3b1be; --faint: #8b9aa8; --accent: #3fd49a; --accent-hover: #6be3b4; --accent-soft: #10271f; --accent-text: #04140d;
  --note-bg: #0f1f1a; --warn-bg: #221c0e; --warn-line: #a17a27; --warn-text: #f1dba6;
  --code-bg: #16212b; --code-text: #d7e1ea;
  --term-bg: #070b0f; --term-bar: #0f161d; --term-line: #1c2731; --focus: #8ab4ff; --shadow: 0 8px 30px rgba(0,0,0,.45);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 20px); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--accent-text); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* shell */
.top { position: fixed; inset: 0 0 auto 0; height: var(--top-h); z-index: 40; display: flex; align-items: center; gap: 6px; padding: 0 16px 0 20px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.5) blur(10px); -webkit-backdrop-filter: saturate(1.5) blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 16px; letter-spacing: -.01em; color: var(--text); text-decoration: none; margin-right: 22px; width: calc(var(--side-w) - 42px); }
.brand:hover { color: var(--text); }
.brand .mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; }
.brand .mark .i { width: 15px; height: 15px; }
.sections { display: flex; gap: 2px; height: 100%; }
.sections a { display: flex; align-items: center; padding: 0 12px; height: 100%; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sections a:hover { color: var(--text); }
.sections a[aria-current="true"] { color: var(--text); border-bottom-color: var(--accent); }
.spacer { flex: 1; }
.search-btn { display: inline-flex; align-items: center; line-height: 1; gap: 8px; height: 34px; width: 220px; padding: 0 8px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--faint); font: inherit; font-size: 14px; cursor: pointer; margin-right: 8px; }
.search-btn:hover { border-color: var(--line-strong); color: var(--text); }
.search-btn .label { flex: 1; text-align: left; }
.search-btn kbd, .search-field kbd { font-size: 11px; padding: 1px 6px; }
.ver { font-size: 12px; color: var(--faint); font-family: var(--mono); padding: 0 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.icon-btn .i { width: 18px; height: 18px; }
.menu-btn { display: none; margin-right: 4px; }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.btn:hover { color: var(--text); border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn.small { height: 34px; padding: 0 12px; font-size: 14px; margin-left: 6px; }

.side { position: fixed; top: var(--top-h); bottom: 0; left: 0; width: var(--side-w); overflow-y: auto; overscroll-behavior: contain; padding: 18px 12px 40px; background: var(--bg-side); border-right: 1px solid var(--line); z-index: 30; font-size: 14px; }
.navhead { margin: 0; font-size: 12px; font-weight: 650; letter-spacing: .02em; color: var(--text); padding: 14px 10px 6px; }
.side .navhead:first-child { padding-top: 2px; }
.side ul, .toc ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; line-height: 1.4; }
.side a:hover { color: var(--text); background: var(--bg-soft); }
.side a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.scrim { position: fixed; inset: var(--top-h) 0 0 0; background: rgba(5,10,14,.45); z-index: 25; }

.toc { position: fixed; top: var(--top-h); right: 0; width: var(--toc-w); max-height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 32px 20px 24px 8px; font-size: 13px; display: none; }
.toc .navhead { padding: 0 0 8px 12px; }
.toc li a { display: block; padding: 4px 0 4px 12px; color: var(--faint); text-decoration: none; border-left: 1px solid var(--line); line-height: 1.4; }
.toc li.sub a { padding-left: 24px; }
.toc li a:hover { color: var(--text); }
.toc li a[aria-current="location"] { color: var(--accent); border-left: 2px solid var(--accent); padding-left: 11px; }
.toc li.sub a[aria-current="location"] { padding-left: 23px; }

main { display: block; max-width: var(--content-w); margin: 0 auto; padding: 32px 24px 48px; }
html.js main { padding-top: calc(var(--top-h) + 36px); }
@media (min-width: 900px) {
  html.js main { margin-left: calc(var(--side-w) + max(32px, (100vw - var(--side-w) - var(--content-w) - var(--toc-w)) / 2)); margin-right: auto; padding-left: 0; padding-right: 0; }
}
@media (min-width: 1280px) { .has-toc .toc { display: block; } }
@media (max-width: 1279px) and (min-width: 900px) { html.js main { margin-left: calc(var(--side-w) + max(32px, (100vw - var(--side-w) - var(--content-w)) / 2)); max-width: min(var(--content-w), calc(100vw - var(--side-w) - 64px)); } }

/* type */
h1 { font-size: 32px; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; margin: 0 0 12px; }
h2 { font-size: 22px; line-height: 1.3; letter-spacing: -.01em; font-weight: 650; margin: 40px 0 10px; }
h3 { font-size: 17px; line-height: 1.4; font-weight: 650; margin: 28px 0 8px; }
p, ul, ol, dl { margin: 0 0 14px; }
li { margin: 4px 0; }
ul, ol { padding-left: 22px; }
.lede, .lede-lead { color: var(--muted); font-size: 17px; margin: 0 0 18px; }
.lede + .lede { font-size: 16px; }
.need, .quiet { color: var(--muted); font-size: 14px; }
.need strong { color: var(--text); }
.how { color: var(--muted); font-size: 14px; margin-top: -4px; }
strong { font-weight: 650; }
code, pre, kbd { font-family: var(--mono); }
:not(pre) > code, :not(pre) > code var { font-size: .86em; }
:not(pre) > code { background: var(--code-bg); color: var(--code-text); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
a code { color: inherit; }
kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--panel); font-size: .8em; color: var(--text); }
var { font-style: normal; }
code var { color: inherit; border-bottom: 1.5px dashed var(--warn-line); }
q { quotes: "\201C" "\201D"; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* notes and containers: content sits on the page, boxes only for notes, code and folds */
.note, .ends, .limits, .youset { border-left: 3px solid var(--accent); background: var(--note-bg); padding: 10px 14px; border-radius: 0 6px 6px 0; margin: 16px 0; font-size: 15px; }
.note > :last-child, .ends > :last-child, .limits > :last-child, .youset > :last-child { margin-bottom: 0; }
.ends p { margin: 0 0 4px; }
.limits h2, .youset h2 { font-size: 16px; margin: 0 0 6px; }
.guide, .alt, .alts, .hero { all: unset; display: block; }
.guide > h2:first-child { margin-top: 40px; }
.label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; margin: 14px 0 6px; color: var(--muted); }
.label.good { color: var(--accent); }
.label code { font-weight: 400; }
.compact li { margin: 2px 0; }

/* commands */
.cmd { position: relative; display: flex; align-items: center; gap: 8px; background: var(--term-bg); color: var(--term-text); border: 1px solid var(--term-line); border-radius: 8px; padding: 0 6px 0 14px; margin: 10px 0 14px; min-height: 42px; max-width: 100%; }
.cmd code { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.5; padding: 10px 0; background: none; color: var(--term-text); white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 0; }
.cmd code::before { content: "$ "; color: var(--term-muted); user-select: none; }
.cmd code var { border-bottom-color: #e5b754; }
.copy { display: inline-flex; align-items: center; gap: 5px; flex: none; height: 28px; padding: 0 9px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--term-muted); font: 500 12px var(--sans); cursor: pointer; }
.copy:hover { background: var(--term-bar); color: var(--term-text); border-color: var(--term-line); }
.copy .i { width: 14px; height: 14px; }
.copy.ok { color: #6be3b4; }

figure.term { margin: 8px 0 16px; background: var(--term-bg); border: 1px solid var(--term-line); border-radius: 8px; overflow: hidden; position: relative; max-width: 100%; }
figure.term figcaption { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--term-bar); color: var(--term-muted); font-size: 11px; letter-spacing: .02em; border-bottom: 1px solid var(--term-line); }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: #3a4652; }
figure.term pre { margin: 0; padding: 12px 14px; color: var(--term-text); font-size: 12.5px; line-height: 1.55; overflow-x: auto; white-space: pre; tab-size: 4; }
figure.term.wrap pre { white-space: pre-wrap; overflow-wrap: anywhere; }
figure.term.bad { border-color: #6b3a3a; }
figure.term.overflows figcaption::after { content: "scroll sideways"; margin-left: auto; font-size: 11px; color: var(--term-muted); }
.sum { font-family: var(--mono); font-size: 14px; letter-spacing: .04em; white-space: pre-line; background: var(--code-bg); padding: 10px 14px; border-radius: 6px; margin: 8px 0 14px; }

/* folds and tabs */
details { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; background: var(--panel); }
details > summary { cursor: pointer; padding: 9px 14px; font-weight: 600; font-size: 15px; list-style: none; display: flex; align-items: center; gap: 8px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px; }
details[open] > summary::before { transform: rotate(45deg); }
details > summary svg { display: none; }
details.fail > summary { color: var(--text); }
details > .body { padding: 2px 16px 6px; border-top: 1px solid var(--line); }
details > .body > :first-child { margin-top: 12px; }
.tabs { margin: 8px 0 14px; }
[role="tablist"] { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 10px; overflow-x: auto; }
[role="tab"] { border: 0; background: none; font: 600 14px var(--sans); color: var(--muted); padding: 8px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
[role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
[role="tab"]:hover { color: var(--text); }

/* tables */
.scroll-x { overflow-x: auto; margin: 12px 0 18px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 13px; font-weight: 650; color: var(--muted); border-bottom-color: var(--line-strong); }
td code { font-size: .86em; }
@media (max-width: 700px) {
  table.stack thead { position: absolute; left: -9999px; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--line-strong); padding: 6px 0; }
  table.stack td { border: 0; padding: 3px 0; }
  table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 650; color: var(--faint); }
}

/* cheat sheet rows */
.cheat .row { display: grid; grid-template-columns: 220px 1fr; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding: 2px 0; }
.cheat .row > span { font-size: 14px; color: var(--muted); }
.cheat .row .cmd { margin: 6px 0; }
@media (max-width: 700px) { .cheat .row { grid-template-columns: 1fr; gap: 0; padding-top: 8px; } }

/* landing */
.name-meaning { font-size: 14px; color: var(--muted); border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; margin: 0 0 22px; }
.name-meaning strong { color: var(--text); }
.thai { font-size: 15px; color: var(--text); }
p.sub { font-size: 18px; color: var(--muted); margin: 0 0 22px; max-width: 62ch; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; }
.actions + .quiet { margin-bottom: 24px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.grid2 h2 { margin-top: 28px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }
.promise, .eyebrow, .cta { display: none; }

/* quickstart steps */
ol.steps { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: step; }
ol.steps > li.step { position: relative; counter-increment: step; padding: 0 0 20px 48px; margin: 0; }
ol.steps > li.step::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 650; color: var(--text); background: var(--bg-soft); border: 1px solid var(--line-strong); z-index: 1; }
ol.steps > li.step::after { content: ""; position: absolute; left: 15px; top: 30px; bottom: 0; width: 1px; background: var(--line-strong); }
ol.steps > li.step:last-child::after { display: none; }
ol.steps > li.step > h2:first-child { margin-top: 0; font-size: 20px; line-height: 26px; }
ol.do { padding-left: 22px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 0; }
.nextcard { display: block; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; text-decoration: none; color: var(--text); }
.nextcard:hover { border-color: var(--accent); color: var(--text); }
.nextcard strong { display: block; font-size: 15px; margin-bottom: 2px; }
.nextcard span { font-size: 14px; color: var(--muted); }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } ol.steps > li.step { padding-left: 40px; } }

/* pager and footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 48px 0 0; }
.pager .card { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; text-decoration: none; color: var(--text); }
.pager .card:hover { border-color: var(--accent); }
.pager .card span { font-size: 13px; color: var(--faint); }
.pager .card strong { font-size: 15px; color: var(--accent); }
.pager .next { grid-column: 2; text-align: right; }
.pager noscript a { display: inline-block; margin-right: 16px; }
.foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); }

/* search */
.search { position: fixed; inset: 0; z-index: 60; background: rgba(5,10,14,.5); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.search[hidden] { display: none; }
.search-panel { width: 100%; max-width: 620px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--faint); }
.search-field input { flex: 1; min-width: 0; height: 52px; border: 0; outline: 0; background: none; color: var(--text); font: 16px var(--sans); }
#search-results { list-style: none; margin: 0; padding: 6px; max-height: 56vh; overflow-y: auto; }
#search-results:empty { display: none; }
#search-results li { margin: 0; }
#search-results a { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
#search-results [aria-selected="true"] a { background: var(--accent-soft); }
#search-results strong { font-size: 14px; }
#search-results .where { font-size: 12px; color: var(--faint); margin-left: 8px; }
#search-results .line { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#search-results .none { padding: 12px; color: var(--muted); font-size: 14px; }
.search-note { margin: 0; padding: 8px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.search-note:empty { display: none; }

/* narrow screens: the sidebar is a drawer */
@media (max-width: 899px) {
  .menu-btn { display: inline-grid; }
  .brand { width: auto; margin-right: 8px; }
  .sections { display: none; }
  .side { transform: translateX(-100%); transition: transform .2s; width: min(300px, 86vw); visibility: hidden; }
  .side.open { transform: none; visibility: visible; box-shadow: var(--shadow); }
  .search-btn { width: 34px; padding: 0; justify-content: center; border: 0; background: none; margin: 0; }
  .search-btn .label, .search-btn kbd { display: none; }
  .search-btn .i { width: 18px; height: 18px; }
  main { padding-left: 20px; padding-right: 20px; }
}
@media (min-width: 900px) { .scrim { display: none; } }
@media (max-width: 520px) {
  .ver { display: none; }
  .top { padding: 0 10px; gap: 2px; }
  .btn.small span { display: none; }
  .btn.small { padding: 0 9px; }
  h1 { font-size: 27px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}

@media print {
  .top, .side, .toc, .scrim, .search, .pager, .copy, .skip { display: none !important; }
  html.js main { margin: 0; padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .cmd, figure.term { background: #fff; color: #000; border: 1px solid #999; }
  .cmd code, figure.term pre { color: #000; white-space: pre-wrap; }
  details > .body { display: block; }
  a { color: #000; }
}
