/* Woodcore's website (website/build.py). After typst.app: a white page, a lot of air, one accent -- Woodcore's teal, the icon's -- and wood as a second. Every colour is a token, redefined for a dark theme -- written once in calc/tools/theme.json, which Woodcore's window is dressed from too (v0.90). */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f9;
  --bg-sunk: #eef0f4;
  --ink: #17161d;
  --ink-soft: #3d3c48;
  --muted: #6a6977;
  --line: #e3e5eb;
  --line-strong: #cfd3dc;
  --accent: #239dad;
  --accent-strong: #1a7e8b;
  --accent-soft: #e3f4f6;
  --wood: #d4944f;
  --wood-soft: #fbf1e6;
  --danger-soft: #fff1ec;
  --missing: #fde7c9;
  --code-bg: #f6f7f9;
  --paper: #ffffff;
  --shadow: 0 1px 2px rgba(23, 22, 29, .06), 0 8px 24px rgba(23, 22, 29, .06);
  --syn-comment: #8a8f98;
  --syn-string: #2f8a4c;
  --syn-raw: #7a5c1e;
  --syn-math: #7a3fa6;
  --syn-keyword: #c2185b;
  --syn-call: #1a6fb0;
  --syn-named: #b0521a;
  --syn-number: #b0521a;
  --primary: #1a7e8b;
  --primary-hover: #15666f;
  --on-primary: #ffffff;
  --override: #b35c00;
  --warning: #b35c00;
  --danger: #b42318;
  --ok: #1b7a3a;
  --lit: #ffe08a;
  --link-uses: #dbe8ff;
  --link-uses-line: #2563eb;
  --link-used: #dcf5e3;
  --link-used-line: #15803d;
  --hover: #cfe3fb;
  --hover-ink: #0e2238;
  --lit-ink: #3d2e00;
  --lit-line: #e0a800;
  --desk: #e4e4e7;
  --card: #ffffff;
  --plan-select: #e67e22;
  --plan-crop: #1f5fbf;
  --plan-snap: #d81b60;
  --plan-storey: #c62828;
  --plan-storey-mark: #d62828;
  --plan-track: #2f8cff;
  --plan-align: #7b1fa2;
  --plan-dimension: #1f6feb;
  --plan-sheet-edge: #b0b0b0;
  --plan-shade: #282828;
  --drawing-grid-fine: #e4e7ea;
  --drawing-grid-heavy: #c9cfd5;
  --drawing-grid-axis: #a8b1b9;
  --drawing-select: #2f8cff;
  --drawing-hover: #e67e22;
  --drawing-crop: #c0392b;
  --drawing-crop-veil: #787878;
  --drawing-track: #2f8cff;
  --drawing-snap: #e8841a;
  --drawing-readout: #5a6570;
  --annex-frame: #c2410c;
  --annex-title: #ffd34d;
  --badge-ink: #ffffff;
  --heat-p3: #c0392b;
  --heat-p2: #e67e5f;
  --heat-p1: #f6c7b6;
  --heat-z0: #f4f4f4;
  --heat-s1: #c6dcf2;
  --heat-s2: #6fa3d8;
  --heat-s3: #1f5fa8;
  --heat-ink: #111111;
  --heat-mark: #e6a23c;
  --model-face: #f7f5f0;
  --model-roof: #e9e4da;
  --model-strip: #ffffff;
  --model-ground: #f3f3f1;
  --model-ink: #111111;
  --model-muted: #888888;
  --model-pressure: #c0392b;
  --model-suction: #1f5fa8;
  --model-direction: #1f5fa8;
  --model-lit: #8fbce6;
  --model-halo: #ffffff;
  --radius: 10px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "Cascadia Code", "Fira Code", ui-monospace, Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111117;
    --bg-soft: #17171f;
    --bg-sunk: #1d1d27;
    --ink: #ececf1;
    --ink-soft: #cfcfd8;
    --muted: #9a99a8;
    --line: #2a2a36;
    --line-strong: #3a3a48;
    --accent: #3cbccd;
    --accent-strong: #5fd0de;
    --accent-soft: #10323a;
    --wood: #e0a768;
    --wood-soft: #2d2217;
    --danger-soft: #2f1c16;
    --missing: #3a2a12;
    --code-bg: #181822;
    --paper: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    --syn-comment: #7d8290;
    --syn-string: #7fd18f;
    --syn-raw: #e3c07a;
    --syn-math: #cf9cf3;
    --syn-keyword: #f07aa8;
    --syn-call: #7cc0f5;
    --syn-named: #f0a472;
    --syn-number: #f0a472;
    --primary: #3cbccd;
    --primary-hover: #5fd0de;
    --on-primary: #0b1d21;
    --override: #f0a050;
    --warning: #f0a050;
    --danger: #ff8a7a;
    --ok: #6fd08c;
    --lit: #5c4a12;
    --link-uses: #1b2c4a;
    --link-uses-line: #6ea8ff;
    --link-used: #173a24;
    --link-used-line: #5fd38a;
    --hover: #27486f;
    --hover-ink: #f2f7ff;
    --lit-ink: #ffe9a8;
    --lit-line: #d9a400;
    --desk: #0b0b10;
    --card: #1d1d27;
    --plan-select: #e67e22;
    --plan-crop: #1f5fbf;
    --plan-snap: #d81b60;
    --plan-storey: #c62828;
    --plan-storey-mark: #d62828;
    --plan-track: #2f8cff;
    --plan-align: #7b1fa2;
    --plan-dimension: #1f6feb;
    --plan-sheet-edge: #b0b0b0;
    --plan-shade: #282828;
    --drawing-grid-fine: #e4e7ea;
    --drawing-grid-heavy: #c9cfd5;
    --drawing-grid-axis: #a8b1b9;
    --drawing-select: #2f8cff;
    --drawing-hover: #e67e22;
    --drawing-crop: #c0392b;
    --drawing-crop-veil: #787878;
    --drawing-track: #2f8cff;
    --drawing-snap: #e8841a;
    --drawing-readout: #5a6570;
    --annex-frame: #c2410c;
    --annex-title: #ffd34d;
    --badge-ink: #ffffff;
    --heat-p3: #e0604f;
    --heat-p2: #b8574a;
    --heat-p1: #5a3530;
    --heat-z0: #2a2a33;
    --heat-s1: #2a3d55;
    --heat-s2: #3f6fa8;
    --heat-s3: #78aef0;
    --heat-ink: #f4f4f4;
    --heat-mark: #f0b45a;
    --model-face: #f7f5f0;
    --model-roof: #e9e4da;
    --model-strip: #ffffff;
    --model-ground: #f3f3f1;
    --model-ink: #111111;
    --model-muted: #888888;
    --model-pressure: #c0392b;
    --model-suction: #1f5fa8;
    --model-direction: #1f5fa8;
    --model-lit: #8fbce6;
    --model-halo: #ffffff;
    color-scheme: dark;
  }
}
:root { --topbar: 60px; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 16px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, kbd, pre { font-family: var(--mono); font-size: .88em; font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }  /* code shows what is typed: `<=` stays two characters, never ≤ */
:not(pre) > code { background: var(--bg-sunk); border-radius: 5px; padding: .08em .35em; overflow-wrap: anywhere; }
kbd { border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 .35em; background: var(--bg); font-size: .8em; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; color: var(--ink); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---- the bar at the top ------------------------------------------------------------------------------------ */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--topbar); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { height: 100%; max-width: 1440px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
/* The slogan beside the wordmark (v0.110): the brand's own line, so it is set apart from the name it
   follows rather than reading as part of it. Hidden with the wordmark on a narrow screen by the
   `.brand span` rule of the media query below, which reaches it too. */
.brand .slogan { font-weight: 400; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.footer-brand .slogan { color: var(--ink); }
.mainnav { display: flex; gap: 22px; }
.mainnav a { color: var(--ink-soft); font-weight: 500; font-size: 15px; }
.mainnav a.active, .mainnav a:hover { color: var(--ink); text-decoration: none; }
.mainnav a.active { box-shadow: inset 0 -2px 0 var(--accent); padding-bottom: 2px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.langs { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.langs a { padding: 4px 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.langs a[aria-current] { background: var(--ink); color: var(--bg); }
.langs a:hover { text-decoration: none; color: var(--ink); }
.langs a[aria-current]:hover { color: var(--bg); }
.menu-toggle { display: none; border: 0; background: none; padding: 8px; margin-left: -8px; cursor: pointer; }
.menu-toggle span { display: block; width: 20px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; }

/* ---- buttons ---------------------------------------------------------------------------------------------- */
.button { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff; font-weight: 600; padding: 11px 20px; border-radius: 9px; border: 1px solid transparent; transition: background .15s, transform .15s; }
.button:hover { background: var(--accent-strong); text-decoration: none; }
.button:active { transform: translateY(1px); }
.button.small { padding: 6px 14px; font-size: 14px; }
.button.big { padding: 14px 26px; font-size: 17px; }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.button.ghost:hover { background: var(--bg-soft); }
.button.light { background: #fff; color: #10323a; }
.button.light:hover { background: #e8f6f8; }
.button.ghost.light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45); }
.button.ghost.light:hover { background: rgba(255, 255, 255, .1); }

/* ---- the home page ------------------------------------------------------------------------------------------ */
.wide-layout { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.page-layout { max-width: 900px; margin: 0 auto; padding: 32px 24px 64px; }
.hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); gap: 56px; align-items: center; padding: 72px 0 64px; }
.eyebrow { text-transform: uppercase; letter-spacing: .09em; font-size: 12.5px; font-weight: 700; color: var(--accent-strong); margin: 0 0 12px; }
.hero h1 { font-size: clamp(38px, 5vw, 60px); margin: 0 0 20px; letter-spacing: -.03em; }
.lead { font-size: 19px; color: var(--ink-soft); }
.hero .lead { font-size: 19.5px; margin: 0 0 30px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { font-size: 14px; color: var(--muted); margin-top: 18px; }
.editor { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: var(--shadow); overflow: hidden; }
.editor-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.editor-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.editor-bar em { margin-left: 10px; font-style: normal; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.editor-panes { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); min-height: 300px; }
.editor-code { padding: 18px; border-right: 1px solid var(--line); background: var(--code-bg); }
.editor-code pre { margin: 0; white-space: pre-wrap; font-size: 12.2px; line-height: 1.65; }
/* The code is the example's own fence, one call to a line: it wraps between its words and never inside a name, `l-k-y` or `#verify-compression`. */
.editor-code .f, .editor-code .n, .editor-code .s, .editor-code .d { white-space: nowrap; }
.editor-preview { padding: 16px; background: var(--bg-sunk); display: flex; align-items: flex-start; }
.editor-preview img { background: var(--paper); border-radius: 4px; box-shadow: var(--shadow); max-height: 460px; object-fit: contain; object-position: top; }

.band { padding: 64px 0; border-top: 1px solid var(--line); }
.band h2 { font-size: clamp(28px, 3.2vw, 38px); margin: 0 0 14px; }
.section-lead { font-size: 18px; color: var(--ink-soft); max-width: 720px; margin: 0 0 32px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; counter-reset: step; }
.steps li { display: flex; gap: 14px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps .num, .tutorial-list .num { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 14px; }
.steps h3 { margin: 2px 0 6px; font-size: 17px; }
.steps p { margin: 0; font-size: 15px; color: var(--ink-soft); }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.feature { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--bg); transition: border-color .15s, box-shadow .15s; }
.feature:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.feature-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 14px; }
.feature:nth-child(even) .feature-icon { background: var(--wood-soft); color: var(--wood); }
.feature-icon svg { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 8px; font-size: 18px; }
.feature p { margin: 0; color: var(--ink-soft); font-size: 15.5px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.split p { color: var(--ink-soft); font-size: 17px; }
.checks { list-style: none; padding: 0; margin: 18px 0 22px; }
.checks li { position: relative; padding-left: 28px; margin: 8px 0; color: var(--ink-soft); }
.checks li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 14px; height: 8px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }
.norm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.norm-chip { border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px; font-size: 14px; font-weight: 600; color: var(--ink-soft); background: var(--bg-soft); }
.cta-band { margin: 24px 0 72px; padding: 56px 40px; border-radius: 18px; background: linear-gradient(135deg, #10323a 0%, #1a6b76 60%, #239dad 100%); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; font-size: clamp(28px, 3.2vw, 40px); margin: 0 0 10px; }
.cta-band p { color: rgba(255, 255, 255, .85); font-size: 18px; margin: 0 0 26px; }
.cta-band .cta { justify-content: center; }

/* ---- documentation layout: sidebar, content, table of contents (typst.app/docs) ---------------------------- */
.doc-layout { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 290px minmax(0, 1fr) 220px; gap: 0; }
.doc-layout:not(:has(.toc)) { grid-template-columns: 290px minmax(0, 1fr); }
.sidebar { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; border-right: 1px solid var(--line); padding: 18px 14px 40px 20px; background: var(--bg); scrollbar-width: thin; }
.search { position: relative; margin-bottom: 14px; }
.search input { width: 100%; font: inherit; font-size: 15px; padding: 9px 36px 9px 34px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236a6977' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center / 16px; color: var(--ink); }
.search input:focus { outline: none; border-color: var(--accent); background-color: var(--bg); box-shadow: 0 0 0 3px var(--accent-soft); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.results { list-style: none; margin: 0; padding: 0; }
.results li a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); }
.results li a:hover, .results li a.selected { background: var(--accent-soft); text-decoration: none; }
.results .r-title { font-weight: 600; font-size: 14.5px; }
.results .r-title.mono { font-family: var(--mono); font-size: 13.5px; }
.results .r-meta { display: block; font-size: 12px; color: var(--muted); }
.results .r-text { display: block; font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results .empty { color: var(--muted); padding: 8px 10px; font-size: 14px; }
.sidenav .group { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); margin: 18px 0 6px; }
.sidenav .group a { color: var(--muted); }
.sidenav .group a.active, .sidenav .group a:hover { color: var(--ink); text-decoration: none; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav li a { display: flex; align-items: baseline; gap: 8px; padding: 4px 10px; border-radius: 7px; color: var(--ink-soft); font-size: 14.5px; }
.sidenav li a:hover { background: var(--bg-soft); color: var(--ink); text-decoration: none; }
.sidenav li a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.sidenav a.cmd { font-family: var(--mono); font-size: 13.2px; }
.sidenav .step { color: var(--muted); font-size: 12px; min-width: 14px; }
.sidenav details { margin: 2px 0; }
.sidenav summary { cursor: pointer; list-style: none; padding: 5px 10px; border-radius: 7px; font-weight: 600; font-size: 14.5px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.sidenav summary::-webkit-details-marker { display: none; }
.sidenav summary::before { content: ""; width: 6px; height: 6px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; flex: none; margin-right: 2px; }
.sidenav details[open] > summary::before { transform: rotate(45deg); }
.sidenav summary:hover { background: var(--bg-soft); }
.sidenav details ul { padding-left: 14px; border-left: 1px solid var(--line); margin-left: 13px; }
/* The site's sections, which the bar at the top carries: shown in the sidebar only where the bar hides them behind ☰ (the narrow screens below). */
.sidebar-sections { display: none; }
.sidebar-sections a { color: var(--ink-soft); font-weight: 600; font-size: 14.5px; padding: 4px 10px; border-radius: 7px; }
.sidebar-sections a.active { background: var(--accent-soft); color: var(--accent-strong); }
.sidebar-sections a:hover { text-decoration: none; background: var(--bg-soft); color: var(--ink); }

.content { min-width: 0; padding: 36px 48px 80px; }
.page-layout .content, .wide-layout .content { padding: 0; }
.toc { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 38px 20px 40px 8px; font-size: 13.5px; }
.toc p { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); margin: 0 0 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 3px 12px; color: var(--muted); margin-left: -1px; border-left: 2px solid transparent; }
.toc li.lvl3 a { padding-left: 24px; }
.toc li a:hover { color: var(--ink); text-decoration: none; }
.toc li a.current { color: var(--accent-strong); border-left-color: var(--accent); }

/* ---- prose ------------------------------------------------------------------------------------------------- */
.prose { max-width: 820px; }
.prose h1 { font-size: clamp(30px, 3.4vw, 40px); margin: 0 0 14px; }
.prose h1 code { background: none; padding: 0; font-size: .92em; letter-spacing: -.02em; }
.prose h2 { font-size: 25px; margin: 44px 0 12px; padding-top: 8px; }
.prose h3 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-soft); }
.prose li { margin: 4px 0; }
.prose .lead { margin-top: 0; }

/* ---- the gallery of examples: no sidebar, the home page's width, two examples a row ---------------------------- */
body.gallery .wide-layout .content { padding: 40px 0 72px; }
.prose.gallery-page { max-width: none; }
.gallery-head { max-width: 820px; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 44px; }
.gallery-item h2 { font-size: 22px; margin: 32px 0 8px; }

.anchor { float: left; margin-left: -1em; padding-right: .3em; color: var(--line-strong); opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; text-decoration: none; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--muted); }
.label { font-size: 13.5px; font-weight: 600; color: var(--muted); margin: 18px 0 6px; }
.defined { font-size: 13.5px; color: var(--muted); margin-top: 34px; }

.code { position: relative; margin: 14px 0; }
.code pre { margin: 0; background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; line-height: 1.6; font-size: 13.6px; }
.code pre code { font-size: inherit; }
.copy { position: absolute; top: 8px; right: 8px; font: 600 12px var(--font); color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 4px 9px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.code:hover .copy, .copy:focus-visible, .copy.done { opacity: 1; }
.copy.done { color: var(--accent-strong); border-color: var(--accent); }
.signature pre { margin: 10px 0 22px; background: var(--code-bg); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 14px 16px; overflow-x: auto; white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.c { color: var(--syn-comment); font-style: italic; }
.s { color: var(--syn-string); }
.r { color: var(--syn-raw); }
.m { color: var(--syn-math); }
.k { color: var(--syn-keyword); font-weight: 600; }
.f { color: var(--syn-call); }
.n { color: var(--syn-named); }
.d { color: var(--syn-number); }

.params { margin: 12px 0 0; }
.params dt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.params dt:first-child { border-top: 0; padding-top: 4px; }
.params dt > code { font-size: 14.5px; font-weight: 700; background: none; padding: 0; color: var(--ink); margin-right: 4px; }
.params .type { font-family: var(--mono); font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); }
.params .default, .params .required { font-size: 12.5px; color: var(--muted); margin-left: auto; }
.params .required { color: var(--wood); font-weight: 600; }
.params dd { margin: 6px 0 14px; color: var(--ink-soft); }

.example { margin: 18px 0 34px; }
.example figcaption { font-weight: 700; font-size: 15px; margin: 0 0 6px; color: var(--ink); }
.preview { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-sunk); padding: 14px; }
.levels { display: flex; align-items: center; gap: 4px; margin: -2px 0 12px; font-size: 13px; color: var(--muted); }
.levels span { margin-right: 6px; font-weight: 600; }
.levels button { font: 600 13px var(--font); width: 30px; height: 28px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink-soft); cursor: pointer; }
.levels button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.paper { background: var(--paper); border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); overflow: hidden; }
.paper img { display: block; width: 100%; }
.callout { border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; border: 1px solid var(--line); background: var(--bg-soft); }
.callout p { margin: 4px 0; font-size: 15px; }
.callout.tip { background: var(--accent-soft); border-color: transparent; }
.callout.warning, .callout.norm { background: var(--wood-soft); border-color: transparent; }
.table-wrap { overflow-x: auto; margin: 16px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; }
.prose thead th { text-align: left; font-weight: 700; border-top: 1.5px solid var(--ink-soft); border-bottom: 1px solid var(--ink-soft); padding: 8px 10px; }
.prose tbody td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-soft); }
.prose tbody tr:last-child td { border-bottom: 1.5px solid var(--ink-soft); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 14px 0 8px; }
.card { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--ink-soft); font-size: 14px; transition: border-color .15s, background .15s; }
.card:hover { border-color: var(--accent); background: var(--bg-soft); text-decoration: none; }
.card code { background: none; padding: 0; color: var(--ink); font-weight: 700; font-size: 14px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 48px; }
.pager a { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; color: var(--ink); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a span { font-size: 13px; color: var(--muted); }
.pager .next { text-align: right; grid-column: 2; }
.tutorial-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 10px; }
.tutorial-list a { display: grid; grid-template-columns: 30px 1fr; column-gap: 14px; align-items: start; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--ink); }
.tutorial-list a:hover { border-color: var(--accent); text-decoration: none; }
.tutorial-list strong { font-size: 17px; }
.tutorial-list span:last-child { grid-column: 2; font-size: 14.5px; color: var(--ink-soft); }

.download-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px 24px; border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; background: linear-gradient(135deg, var(--accent-soft), var(--bg) 70%); margin: 8px 0 28px; }
.download-card h2 { margin: 0 !important; padding: 0 !important; font-size: 30px !important; }
.download-card .meta { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.download-card .sha { grid-column: 1 / -1; margin: 6px 0 0; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.download-card .sha span { font-weight: 700; margin-right: 6px; }
.download-card.pending { display: block; background: var(--bg-soft); }
.download-card .whatsnew { grid-column: 1 / -1; margin: 0; font-weight: 600; }
.tutorial-list.versions a { grid-template-columns: 64px 1fr; }
.tutorial-list.versions .num { width: auto; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 13px; }
.releases { list-style: none; padding: 0; }
.releases li { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 0 0 18px; }
.releases h3 { margin: 0 0 4px; font-size: 18px; }
.releases .date { font-weight: 400; font-size: 14px; color: var(--muted); margin-left: 8px; }
.releases p { margin: 0; }

/* ---- the footer ------------------------------------------------------------------------------------------ */
.footer { border-top: 1px solid var(--line); background: var(--bg-soft); }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 28px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; font-size: 14px; color: var(--muted); }
.footer-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); flex-wrap: wrap; }
.footer-brand span { color: var(--muted); }
.footer-links { display: flex; gap: 18px; }
.footer-links a { color: var(--ink-soft); }
.footer-note { margin: 0 0 0 auto; }
.footer-legal { flex-basis: 100%; margin: 0; font-size: 13px; }
.footer-legal a { color: var(--ink-soft); }

/* ---- the root and 404 ---------------------------------------------------------------------------------------- */
.root-choice { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; }
.root-choice h1 { margin: 0; }
.root-choice div { display: flex; gap: 10px; }
.lang-choice { border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 16px; font-weight: 600; }
.notfound { padding: 12px 0 24px; border-bottom: 1px solid var(--line); }

/* ---- a command's condensed page (issue #115): the line and its bubbles, the key points, the arguments ---- */
.cpage h1 .cat { font-size: 13px; font-weight: 500; color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; padding: 2px 10px; vertical-align: middle; }
.cpage .lead { font-size: 17px; color: var(--ink-soft); }
.cmdline pre { font: 13.5px/1.9 var(--mono); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; white-space: pre; overflow-x: auto; margin: 0; }
.cmdline .fn { color: var(--syn-call); }
.cpage button.an, .cpage button.av, .cpage button.dv { font: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; color: var(--syn-math); }
.cpage button.an { border-bottom: 1px dotted currentColor; }
.cpage button.an.rq { font-weight: 700; color: var(--ink); }
.cpage button.av, .cpage button.dv { color: var(--wood); background: var(--card); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 4px; font-family: var(--mono); }
.cpage button.av i { font-style: normal; font-size: 9px; color: var(--muted); }
.cpage button.av:hover, .cpage button.dv:hover, .cpage button.an:hover { border-color: var(--accent); }
.cpage .hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.key { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; background: var(--card); display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.key span { color: var(--ink-soft); }
.atab { width: 100%; border-collapse: collapse; font-size: 14px; }
.atab th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--line-strong); }
.atab td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.atab tr.gh td { background: var(--bg-sunk); font-weight: 600; font-size: 13px; color: var(--ink-soft); padding: 5px 8px; }
.atab td.an2 { white-space: nowrap; font-family: var(--mono); }
.atab td.stc { white-space: nowrap; }
.atab .st { font-size: 12px; border-radius: 999px; padding: 1px 8px; font-weight: 600; }
.atab .st.rq { background: var(--danger-soft); color: var(--danger); }
.atab .st.op { background: var(--bg-sunk); color: var(--ink-soft); }
.atab .exs { display: flex; flex-direction: column; gap: 3px; margin-top: 5px; }
.atab .exl { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: 13px; }
.atab .exl span { color: var(--muted); }
.atab td.named { color: var(--ink-soft); background: var(--bg-soft); }
.preview .same { font-size: 13px; color: var(--muted); margin: 4px 0; }
.tip { position: fixed; z-index: 70; max-width: min(380px, calc(100vw - 16px)); background: var(--card); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 13px; }
.tip.wide { max-width: min(860px, calc(100vw - 16px)); }
.tip .tiph { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin: 0 0 6px; }
.tip .tiph code { font-weight: 600; }
.tip .tips { font-size: 11px; color: var(--muted); }
.tip .vgrid { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 12px; align-items: start; }
.tip .vl > div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 3px 6px; border-radius: 5px; }
.tip .vl > div.on { background: var(--accent-soft); }
.tip .vl span { color: var(--ink-soft); }
.tip .vhint, .tip .vfoot { font-size: 11px; color: var(--muted); margin-top: 6px; }
.tip .vp { border-left: 1px solid var(--line); padding-left: 12px; min-width: 0; }
.tip .pcode { margin: 0 0 6px; font: 11.5px/1.45 var(--mono); white-space: pre-wrap; word-break: break-word; background: var(--bg-soft); padding: 6px 8px; border-radius: 6px; }
.tip .pset { color: var(--muted); }
.tip .plab { font-size: 11px; color: var(--muted); font-weight: 600; margin: 2px 0 4px; }
.tip .pimg { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 6px; overflow: auto; max-height: 340px; }
.tip .pimg.blank { color: #666; font-style: italic; }
.tip .spr { background-repeat: no-repeat; }
.tip .pnote2 { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
@media (max-width: 720px) { .tip .vgrid { grid-template-columns: minmax(0, 1fr); } .tip .vp { border-left: 0; padding-left: 0; } }

/* ---- smaller screens ------------------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .doc-layout, .doc-layout:not(:has(.toc)) { grid-template-columns: 270px minmax(0, 1fr); }
  .toc { display: none; }
  .gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero, .split { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero { padding: 40px 0; }
  .mainnav { gap: 16px; }
  .topbar-inner:has(.menu-toggle) .mainnav { display: none; }  /* a page with a sidebar carries the same links in it, .sidebar-sections */
  .sidebar-sections { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .menu-toggle { display: block; }
  .doc-layout, .doc-layout:not(:has(.toc)) { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: var(--topbar); width: min(320px, 86vw); z-index: 40; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: none; }
  .content { padding: 24px 16px 64px; }
  .editor-panes { grid-template-columns: minmax(0, 1fr); }
  .editor-code { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .topbar-inner { padding: 0 16px; gap: 14px; }
  .button.small { display: none; }
  .brand span { display: none; }
  .mainnav { gap: 12px; }
  .mainnav a { font-size: 14px; }
  .features, .steps { grid-template-columns: minmax(0, 1fr); }
  .wide-layout, .page-layout { padding-left: 16px; padding-right: 16px; }
  .cta-band { padding: 40px 20px; }
  .download-card { grid-template-columns: minmax(0, 1fr); }
  .footer-note { margin-left: 0; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
}
