:root {
  --paper: #F4EFE7;
  --card: #FBF8F3;
  --ink: #1E1A16;
  --ink-2: #5C544A;
  --line: #E1D9CC;
  --forest: #2F5444;
  --forest-soft: #E7EFE9;
  --butter: #F5EACB;
  --sage: #B9CDB0;
  --clay: #EBC0AE;
  --denim: #B8C8D8;
  --wheat: #EED9A0;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1A1714;
    --card: #221E1A;
    --ink: #EFE8DC;
    --ink-2: #B5AB9C;
    --line: #3A342D;
    --forest: #A9C7B2;
    --forest-soft: #23302A;
    --butter: #3A3220;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* Header: a strip of quilt patches, then the name */
.quilt { display: flex; height: 10px; }
.quilt span { flex: 1; }
.quilt span:nth-child(4n+1) { background: var(--sage); }
.quilt span:nth-child(4n+2) { background: var(--clay); }
.quilt span:nth-child(4n+3) { background: var(--denim); }
.quilt span:nth-child(4n+4) { background: var(--wheat); }
header.site { padding: 22px 0 8px; }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand img { width: 28px; height: 28px; }
nav.site { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; }
nav.site a { color: var(--ink-2); text-decoration: none; }
nav.site a:hover, nav.site a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

main { padding: 24px 0 56px; }
h1 { font-size: 38px; line-height: 1.15; letter-spacing: -0.02em; margin: 18px 0 6px; font-weight: 800; }
.updated { color: var(--ink-2); font-size: 15px; margin: 0 0 22px; }
.lead { font-size: 19px; background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--sage); border-radius: 14px; padding: 16px 20px; }
h2 { font-size: 24px; line-height: 1.25; letter-spacing: -0.01em; margin: 44px 0 10px; padding-top: 4px; font-weight: 750; }
h3 { font-size: 18px; margin: 26px 0 8px; }
p, ul, ol { margin: 0 0 14px; }
li { margin: 4px 0; }
a { color: var(--forest); text-underline-offset: 3px; }
strong { font-weight: 650; }

.toc { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 20px; margin: 26px 0 8px; }
.toc p { margin: 0 0 6px; font-weight: 650; }
.toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 28px; font-size: 15px; }
@media (max-width: 560px) { .toc ol { columns: 1; } h1 { font-size: 31px; } }

.table { overflow-x: auto; margin: 6px 0 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { font-weight: 650; background: var(--forest-soft); }

.note { background: var(--butter); border-radius: 14px; padding: 14px 18px; }
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; margin: 12px 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 8px; background: var(--sage); color: #1E1A16; border: 1.5px solid var(--ink); font-weight: 750; display: grid; place-items: center; font-size: 15px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 26px 0; }
.cards a { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; color: var(--ink); text-decoration: none; }
.cards a:hover { border-color: var(--ink-2); }
.cards strong { display: block; font-size: 18px; margin-bottom: 4px; }
.cards span { color: var(--ink-2); font-size: 15px; }
.cards a::before { content: ""; display: block; width: 26px; height: 8px; border-radius: 3px; margin-bottom: 12px; background: var(--sage); }
.cards a:nth-child(2)::before { background: var(--clay); }
.cards a:nth-child(3)::before { background: var(--denim); }

footer.site { border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--ink-2); font-size: 14px; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer.site a { color: var(--ink-2); }

@media print {
  .quilt, nav.site, .toc, footer.site a.top { display: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .table, .lead, .toc { border-color: #999; background: #fff; }
}
h1 + .lead { margin-top: 20px; }
.toc li { margin: 0 0 6px; break-inside: avoid; }
