/* SPDX-License-Identifier: BSD-2-Clause
 *
 * The style sheet of the ztcl and ztk docs sites, from docs/site/site.css
 * of ztcl at ddeb8e2d (BSD-2-Clause, the same owner as Flight Manual),
 * for the built-in style beetlebug. Two changes: the @font-face rules
 * use only fonts of the system (local()), because Flight Manual has no
 * font files, and the rule of the font of the book of ztcl is out. fm.css
 * gives the markup of Flight Manual the same look. */

/* The style of the ztcl and ztk sites: the look of a printed datasheet.
   Warm paper, ink, and one accent of ink blue. The two sites use the same
   tokens. The text and the headings use Inter, and the code uses IBM Plex
   Mono (both SIL OFL 1.1, the licenses are in fonts/). A font of the same
   name on the computer comes first. */
@font-face { font-family: "Inter"; font-weight: 400 500; font-style: normal; font-display: swap; src: local("Inter"), local("Inter Regular"); }
@font-face { font-family: "Inter"; font-weight: 600 800; font-style: normal; font-display: swap; src: local("Inter Bold"), local("Inter-Bold"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: local("IBM Plex Mono"), local("IBMPlexMono"); unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+2074, U+20AC, U+2122, U+2212, U+FB01-FB02; }
@font-face { font-family: "IBM Plex Mono"; font-weight: 600 700; font-style: normal; font-display: swap; src: local("IBM Plex Mono Bold"), local("IBMPlexMono-Bold"); unicode-range: U+0000, U+000D, U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2039-203A, U+2044, U+2074, U+20AC, U+2122, U+2212, U+FB01-FB02; }
:root {
  color-scheme: light dark;
  --accent: #1f3a6e;
  --accent-strong: #152a52;
  --accent-soft: #e2e6ee;
  --accent-ink: #f8f4ea;
  --sib: #5c574d;
  --bg: #f8f4ea;
  --bg-soft: #efe9da;
  --bg-deep: #e5ddc9;
  --surface: #fbf8f1;
  --code-bg: #efe9da;
  --text: #2a2721;
  --text-2: #45413a;
  --text-3: #5c574d;
  --line: #e2dacb;
  --line-strong: #cbc1ac;
  --ink-bar: #2a2721;
  --ink-bar-text: #f8f4ea;
  --bar-muted: #a39a86;
  --warn: #8a4600;
  --warn-soft: #f6e6c8;
  --tok-kw: #1f3a6e;
  --tok-str: #6a4b1c;
  --tok-var: #45413a;
  --tok-com: #5c574d;
  --tok-num: #6a4b1c;
  --shadow: none;
  --head: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Code", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --wrap: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #a9c1ee;
    --accent-strong: #c9d8f5;
    --accent-soft: #232d40;
    --accent-ink: #14161b;
    --sib: #9d9687;
    --bg: #1a1915;
    --bg-soft: #23211b;
    --bg-deep: #2d2a23;
    --surface: #1f1d18;
    --code-bg: #23211b;
    --text: #e4ddcd;
    --text-2: #c6bfb0;
    --text-3: #9d9687;
    --line: #332f28;
    --line-strong: #555046;
    --ink-bar: #2d2a23;
    --ink-bar-text: #ece6d8;
    --bar-muted: #6b6558;
    --warn: #f0b867;
    --warn-soft: #2e2617;
    --tok-kw: #a9c1ee;
    --tok-str: #dcc08e;
    --tok-var: #c6bfb0;
    --tok-com: #9d9687;
    --tok-num: #dcc08e;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
    --accent: #a9c1ee;
    --accent-strong: #c9d8f5;
    --accent-soft: #232d40;
    --accent-ink: #14161b;
    --sib: #9d9687;
    --bg: #1a1915;
    --bg-soft: #23211b;
    --bg-deep: #2d2a23;
    --surface: #1f1d18;
    --code-bg: #23211b;
    --text: #e4ddcd;
    --text-2: #c6bfb0;
    --text-3: #9d9687;
    --line: #332f28;
    --line-strong: #555046;
    --ink-bar: #2d2a23;
    --ink-bar-text: #ece6d8;
    --bar-muted: #6b6558;
    --warn: #f0b867;
    --warn-soft: #2e2617;
    --tok-kw: #a9c1ee;
    --tok-str: #dcc08e;
    --tok-var: #c6bfb0;
    --tok-com: #9d9687;
    --tok-num: #dcc08e;
    --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-strong); }
code, pre, kbd { font-family: var(--mono); }
img, svg { max-width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }

/* The top bar of each page. */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line-strong);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 700 19px/1 var(--mono); letter-spacing: -.01em; }
.logo:hover { color: var(--text); }
/* The project switcher, copied from beetlebug.org/kit. */
.bb-sep { color: var(--text-3); font-size: 13px; margin-left: -4px; }
.bb-switch { position: relative; }
.bb-switch summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 600; }
.bb-switch summary::-webkit-details-marker { display: none; }
.bb-switch summary:hover, .bb-switch[open] summary { color: var(--text); }
.bb-switch summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.bb-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; width: 300px; max-width: calc(100vw - 24px); padding: 6px 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 0; box-shadow: none; }
.bb-menu a { display: grid; grid-template-columns: 34px 1fr auto; column-gap: 12px; align-items: center; padding: 8px 14px; color: var(--text); text-decoration: none; }
.bb-menu a:hover, .bb-menu a:focus-visible { background: var(--bg-soft); color: var(--text); outline: none; }
.bb-menu .bb-glyph { grid-row: 1 / span 2; width: 34px; height: 26px; display: grid; place-items: center; background: var(--bg-deep); color: var(--text-2); font: 600 12px/1 var(--mono); border-radius: 0; }
.bb-menu .bb-glyph svg { width: 16px; height: 16px; }
.bb-menu a[aria-current] .bb-glyph { background: var(--accent); color: var(--accent-ink); }
.bb-menu .bb-name { grid-column: 2; font: 600 15px/1.25 var(--head); white-space: nowrap; }
.bb-menu small { grid-column: 2; font: 400 12.5px/1.3 var(--sans); color: var(--text-3); white-space: nowrap; }
.bb-menu a[aria-current]::after { content: "\25CF  here"; grid-column: 3; grid-row: 1 / span 2; font: 600 13px/1 var(--head); font-variant-caps: all-small-caps; letter-spacing: .06em; color: var(--accent); white-space: pre; }
.bb-menu .bb-home { border-bottom: 1px solid var(--line); margin-bottom: 4px; padding-bottom: 10px; }
.bb-menu p { margin: 8px 0 2px; padding: 10px 14px 4px; border-top: 1px solid var(--line-strong); font: 700 12px/1 var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.bb-menu .bb-home + p { border-top: 0; margin-top: 0; }
.bb-switch .bb-caret { display: inline-block; transition: transform .15s; }
.bb-switch[open] .bb-caret { transform: rotate(180deg); }
@media (max-width: 640px) { .bb-switch summary span:not(.bb-caret), .bb-sep { display: none; } }
.logo .glyph { width: 34px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 13px; }
.toplinks { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.toplinks a { color: var(--text-2); text-decoration: none; font-size: 15px; padding: 6px 10px; border-radius: 8px; }
.toplinks a:hover, .toplinks a[aria-current] { color: var(--text); background: var(--bg-soft); }
.toplinks .sib { display: inline-flex; gap: 6px; align-items: center; }
.toplinks .sib::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sib); }

/* Buttons. */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 10px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn.ghost { border-color: var(--line-strong); color: var(--text); background: var(--surface); }
.btn.ghost:hover { border-color: var(--text-3); color: var(--text); }

/* The landing page. */
.hero { padding: 28px 0 36px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; }
/* The masthead of the landing page: the name of the part, and a box
   with the release, the license, and the language. */
.mast { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding-bottom: 10px; margin-bottom: 18px; border-bottom: 2px solid var(--text); }
.mast .part { font: 700 72px/.9 var(--head); letter-spacing: -.04em; color: var(--text); }
.docbox { display: grid; grid-template-columns: auto auto; margin: 0; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); font: 12.5px/1.45 var(--mono); }
.docbox dt, .docbox dd { margin: 0; padding: 2px 8px; border-bottom: 1px solid var(--line); }
.docbox dt { color: var(--text-3); padding-left: 0; }
.docbox dt:nth-last-of-type(1), .docbox dd:nth-last-of-type(1) { border-bottom: 0; }
.hero h1 { font-size: clamp(32px, 3.8vw, 46px); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 750; }
.hero h1 em { display: block; font-style: normal; color: var(--text-2); font-size: .62em; line-height: 1.2; letter-spacing: 0; margin-top: 6px; }
.hero .sub { font-size: 17px; line-height: 1.55; color: var(--text-2); margin: 0 0 20px; max-width: 36em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .meta { margin-top: 22px; font-size: 14px; color: var(--text-3); }

.codecard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.codecard .bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 13px var(--mono); color: var(--text-3); background: var(--bg-soft); }
.codecard .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.codecard .bar span { margin-left: 8px; }
.codecard pre { margin: 0; padding: 18px 20px; font-size: 14px; line-height: 1.6; overflow-x: auto; background: none; border-radius: 0; }
.codecard pre + pre { border-top: 1px dashed var(--line); }
.term { color: var(--text-2); }
.term .p { color: var(--accent); user-select: none; }
.k { color: var(--tok-kw); } .s { color: var(--tok-str); } .v { color: var(--tok-var); } .c { color: var(--tok-com); } .n { color: var(--tok-num); }

.stats { border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.stats .wrap { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 28px 24px 26px 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat b { display: block; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; font-weight: 700; }
.stat span { display: block; margin-top: 6px; color: var(--text-2); font-size: 14px; line-height: 1.45; }

.section { padding: 56px 0; border-bottom: 1px solid var(--line); }
.section.alt { background: var(--bg-soft); }
.eyebrow { font: 600 13px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.section h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -.025em; margin: 0 0 16px; font-weight: 720; max-width: 22em; }
.lede { font-size: 18px; color: var(--text-2); max-width: 40em; margin: 0 0 40px; }
.section h3 { font-size: 18px; margin: 0 0 8px; letter-spacing: -.01em; }
.section p { margin: 0 0 12px; }
.muted { color: var(--text-3); }
.small { font-size: 14px; }

.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; min-width: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 12px; }
.card .tag.plan { background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--line); }
.card ul { padding-left: 20px; margin: 8px 0 0; color: var(--text-2); }
.card li + li { margin-top: 4px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }

/* Bar charts: HTML rows. Each bar has its value as text. */
.chart { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px 24px 18px; }
.chart h3 { margin-bottom: 4px; }
.chart .how { font-size: 14px; color: var(--text-3); margin: 0 0 20px; }
.bars { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; gap: 10px 14px; align-items: center; margin: 0; }
.bars dt { font-size: 14px; color: var(--text-2); white-space: nowrap; }
.bars dd { margin: 0; display: contents; }
.bars .track { height: 22px; display: flex; align-items: center; }
.bars .fill { height: 100%; min-width: 3px; border-radius: 0 4px 4px 0; background: var(--accent); }
.bars .fill.base { background: var(--bar-muted); }
.bars .fill.t1 { background: color-mix(in srgb, var(--accent) 70%, var(--bg)); }
.bars .fill.t0 { background: color-mix(in srgb, var(--accent) 42%, var(--bg)); }
.bars .val { font: 600 14px var(--mono); text-align: right; }
.bars .val small { font-weight: 400; color: var(--text-3); }
.chart .note { font-size: 13px; color: var(--text-3); margin: 16px 0 0; }
.multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.multiples .chart { padding: 18px 18px 14px; }
.multiples h4 { font: 600 14px var(--mono); margin: 0 0 12px; }
.multiples .bars { gap: 6px 10px; }
.multiples .bars .track { height: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-2); margin: 0 0 16px; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: var(--accent); }
.legend i.base { background: var(--bar-muted); }
.legend i.t1 { background: color-mix(in srgb, var(--accent) 70%, var(--bg)); }
.legend i.t0 { background: color-mix(in srgb, var(--accent) 42%, var(--bg)); }

/* The benchmark charts of bench/compare/chart.py, in tabs by task family. */
.benchtabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.benchtabs[hidden] { display: none; }
.benchtabs button { font: 600 14px var(--sans); padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text-2); cursor: pointer; }
.benchtabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); }
.benchfig { margin: 0 0 16px; }
.prose .chart-img { display: block; width: 100%; max-width: 600px; height: auto; margin: 0 0 20px; }
/* The pictures of a terminal (ztcl top): their own size, scaled on a narrow screen. */
.prose .term-img { display: block; width: 100%; max-width: 740px; height: auto; margin: 0 0 20px; }
.benchfig[hidden] { display: none; }
/* The tabs of the charts (index.html): the charts share one grid cell,
   and a chart that is off keeps its place with no paint. */
.benchstack.tabbed { display: grid; }
.benchstack.tabbed > .benchfig { grid-area: 1 / 1; }
.benchstack.tabbed > .benchfig.off { visibility: hidden; }
.benchfig img { display: block; width: 100%; max-width: 600px; height: auto; border: 1px solid var(--line); border-radius: 12px; }

.ktable { overflow-x: auto; }
.ktable table { border-collapse: collapse; width: 100%; font-size: 14px; }
.ktable th, .ktable td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; vertical-align: bottom; }
.ktable td { white-space: nowrap; }
.ktable tbody th, .ktable tbody td { vertical-align: middle; }
.chart .how code { white-space: nowrap; }
@media (max-width: 480px) { .ktable th, .ktable td { padding: 6px 4px; } .ktable td { font-size: 13px; } }
.ktable td { font: 600 14px var(--mono); }
.ktable thead th { font-size: 13px; font-weight: 600; color: var(--text-2); }
.ktable th[scope=row], .ktable thead th:first-child { text-align: left; font-weight: 400; color: var(--text-2); padding-left: 0; }
.ktable tbody tr:last-child td, .ktable tbody tr:last-child th { border-bottom: 0; }

.callout { border: 1px solid var(--line); border-left: 4px solid var(--warn); background: var(--warn-soft); border-radius: 0 12px 12px 0; padding: 16px 20px; margin: 24px 0 0; }
.callout p { margin: 0; }
/* The statement of the project, in the first column of the top section. */
.hero .manifest { margin-top: 18px; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--warn); background: var(--warn-soft); border-radius: 0 10px 10px 0; font-size: 14px; line-height: 1.5; max-width: 40em; }
.hero .manifest p { margin: 0; }
.hero .manifest p + p { margin-top: 6px; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { position: relative; padding-left: 28px; margin: 0 0 10px; color: var(--text-2); }
.checks li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 12px; height: 7px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.checks li b { color: var(--text); }
.status { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.status li { background: var(--surface); padding: 16px 20px; display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: baseline; }
.status .st { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.st.ok { color: var(--accent); } .st.wip { color: var(--warn); } .st.plan { color: var(--text-3); } .st.no { color: var(--tok-num); }
.family { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 28px 32px; background: var(--surface); }
.family h3 { font-size: 22px; margin: 0 0 6px; }
.family p { margin: 0; color: var(--text-2); }
.family .btn.sib-btn { background: var(--accent); color: var(--accent-ink); }

/* The docs pages. */
.docs { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sidebar { position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow: auto; padding: 32px 4px 48px 0; font-size: 15px; }
.sidebar h2, .sidebar summary { font: 600 12px/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); margin: 24px 0 8px; }
.sidebar h2:first-child { margin-top: 0; }
.sidebar summary { cursor: pointer; list-style-position: outside; }
.sidebar a.item { display: block; padding: 5px 10px; margin: 1px 0; border-radius: 8px; color: var(--text-2); text-decoration: none; line-height: 1.4; }
.sidebar a.item:hover { color: var(--text); background: var(--bg-soft); }
.sidebar .navpart { font: 600 12px/1.3 var(--sans); color: var(--text-3); margin: 12px 0 2px; padding: 0 10px; }
.sidebar a.item[aria-current] { color: var(--accent-strong); background: var(--accent-soft); font-weight: 600; }
.toc-toggle { position: absolute; opacity: 0; pointer-events: none; }
.toc-button { display: none; }
.prose { padding: 40px 0 80px; max-width: 780px; min-width: 0; }
.prose h1 { font-size: 38px; line-height: 1.15; letter-spacing: -.025em; margin: 0 0 24px; }
.prose h2 { font-size: 26px; line-height: 1.25; letter-spacing: -.015em; margin: 48px 0 12px; padding-top: 8px; }
.prose h3 { font-size: 20px; margin: 32px 0 8px; }
.prose h4 { font-size: 17px; margin: 24px 0 6px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; overflow-wrap: break-word; }
.prose li + li { margin-top: 4px; }
.prose code { font-size: .88em; background: var(--code-bg); padding: .14em .36em; border-radius: 5px; }
.prose pre { background: var(--code-bg); border: 1px solid var(--line); padding: 16px 18px; border-radius: 10px; overflow: auto; line-height: 1.5; font-size: 14px; margin: 0 0 20px; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose .table { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 10px; }
.prose table { border-collapse: collapse; min-width: 100%; font-size: 14.5px; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose th { background: var(--bg-soft); font-weight: 600; }
.prose td + td, .prose th + th { border-left: 1px solid var(--line); }
.prose blockquote { margin: 0 0 20px; padding: 4px 18px; border-left: 3px solid var(--line-strong); color: var(--text-2); }
.prose .alert { margin: 0 0 20px; padding: 12px 18px; border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--bg-soft); border-radius: 0 10px 10px 0; }
.prose .alert.warning { border-left-color: var(--warn); background: var(--warn-soft); }
.prose .alert p { margin: 0; }
.prose h1 + p, .prose h1 + .alert { margin-top: 0; }
.pager { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pager a { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; text-decoration: none; color: var(--text); }
.pager a:hover { border-color: var(--accent); color: var(--text); }
.pager a span { display: block; font-size: 13px; color: var(--text-3); }
.pager .next { text-align: right; grid-column: 2; }

.foot { padding: 40px 0 48px; color: var(--text-3); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; }
.foot a { color: var(--text-2); text-decoration: none; }
.foot a:hover { color: var(--text); }
.foot .right { margin-left: auto; display: flex; gap: 20px; flex-wrap: wrap; }
.docs-foot { border-top: 1px solid var(--line); }

@media (max-width: 960px) {
  .hero { padding: 32px 0 32px; }
  .hero .wrap, .split { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .g3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stats .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc-button { display: flex; align-items: center; gap: 8px; margin: 16px 0 0; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; width: max-content; }
  .toc-button::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
  .toc-toggle:focus-visible + .toc-button { outline: 2px solid var(--accent); outline-offset: 2px; }
  .sidebar { display: none; position: static; max-height: none; padding: 8px 0 16px; border-bottom: 1px solid var(--line); }
  .toc-toggle:checked ~ .sidebar { display: block; }
  .prose { padding-top: 24px; }
}
@media (max-width: 640px) {
  .wrap, .docs { padding: 0 16px; }
  .top .wrap { gap: 12px; }
  .toplinks a { padding: 6px 7px; font-size: 14px; }
  .section { padding: 40px 0; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .hero .sub { font-size: 17px; }
  .stat { padding: 20px 12px 18px 0; }
  .stat + .stat { padding-left: 12px; }
  .stat:nth-child(3) { padding-left: 0; }
  .stat b { font-size: 24px; }
  .codecard pre { font-size: 13px; padding: 14px 16px; }
  .bars { grid-template-columns: minmax(0, 1fr) max-content; }
  .bars dt { grid-column: 1 / -1; margin-bottom: -6px; white-space: normal; }
  .multiples { grid-template-columns: minmax(0, 1fr); }
  .status li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .family { grid-template-columns: minmax(0, 1fr); padding: 22px; }
  .prose h1 { font-size: 30px; }
  .prose h2 { font-size: 22px; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
  .foot .right { margin-left: 0; }
}
figure.chart { margin: 0; }
.bars dt code { font-size: 13px; color: var(--text-2); }
.bars .track.budget { position: relative; }
.bars .track.budget::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; border-left: 2px dashed var(--text-3); }
.bars .fill.over { background: var(--warn); }
.prose :not(pre) > code { overflow-wrap: anywhere; }
/* In a table cell, a code word breaks only when it is wider than the
   cell. `anywhere` lets the column shrink to a few characters, so a
   short name such as `option` broke in the middle. */
.prose td > code, .prose th > code { overflow-wrap: break-word; }

/* Live examples (assets/live.js): the code as an editor, and its output. */
.o { color: var(--accent); }
.live-demo { margin: 8px 0 28px; display: grid; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.live-demo .ld-code { position: relative; min-width: 0; background: var(--code-bg); }
.live-demo .ld-code pre, .live-demo .ld-code textarea { margin: 0; padding: 14px 16px; border: 0; border-radius: 0; background: none; font: 13px/1.55 var(--mono); tab-size: 4; white-space: pre-wrap; overflow-wrap: break-word; box-sizing: border-box; }
.live-demo .ld-code textarea { position: absolute; inset: 0; width: 100%; height: 100%; resize: none; overflow: hidden; color: transparent; caret-color: var(--text); outline: none; }
.live-demo .ld-code textarea::selection { background: var(--accent-soft); color: transparent; }
.live-demo .ld-code:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.live-demo .ld-out { margin: 0; padding: 10px 16px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--bg-soft); font: 13px/1.5 var(--mono); white-space: pre-wrap; min-height: 1.5em; max-height: 16em; overflow: auto; }
.live-demo .ld-out:empty::before { content: "The output shows here."; color: var(--text-3); }
/* The files that an example of ztcl::typeset or ztcl::pdf writes: each
   SVG image inline, side by side, and each PDF in a viewer with a link to
   open it and a link to download it. The images keep a white page in
   each theme, as paper. */
.live-demo .ld-files { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 16px; border-top: 1px solid var(--line); }
.live-demo .ld-files[hidden] { display: none; }
.live-demo .ld-file { margin: 0; min-width: 0; }
.live-demo .ld-file figcaption { font: 12px/1.6 var(--mono); color: var(--text-3); }
.live-demo .ld-file figcaption a { margin-left: 10px; }
.live-demo .ld-file .ld-svg { background: #fff; color: #000; padding: 8px; border: 1px solid var(--line); border-radius: 4px; overflow: auto; max-width: 100%; }
.live-demo .ld-file .ld-svg svg { display: block; max-width: 100%; height: auto; }
.live-demo .ld-file iframe { display: block; width: min(560px, 80vw); height: 380px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.live-demo .ld-result { color: var(--text-3); }
.live-demo .ld-error { color: var(--warn); }
.live-demo .ld-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); }
.live-demo .ld-bar button { font: inherit; color: var(--text-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.live-demo .ld-bar button:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.live-demo .ld-tag { font-weight: 650; }
.live-demo[data-live="1"] .ld-tag { color: var(--accent); }
.live-demo .ld-hud { margin-left: auto; font: 12px var(--mono); }

/* The shell in the page (assets/shell.js). The poster and the canvas have the same size. */
.zshell { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; min-width: 0; }
.zshell .bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); font: 13px var(--mono); color: var(--text-3); background: var(--bg-soft); }
.zshell .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); display: inline-block; }
.zshell .bar span { margin-left: 8px; }
.zshell .bar label { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; font: 13px var(--sans); color: var(--text-2); cursor: pointer; }
.zshell-poster, .zshell-screen { margin: 0; padding: 10px 14px; font: 14px/21px var(--mono); background: none; border-radius: 0; color: var(--text); white-space: pre; overflow: hidden; }
.zshell-poster { height: calc(var(--rows, 14) * 21px + 20px); box-sizing: border-box; }
.zshell-poster .p { color: var(--tok-str); font-weight: 600; }
.zshell-screen { position: relative; padding: 0; cursor: text; }
.zshell-screen canvas { display: block; }
.zshell-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; resize: none; border: 0; padding: 0; color: transparent; background: transparent; caret-color: transparent; }
.zshell-screen:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
.zshell-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--bg-soft); font-size: 13px; color: var(--text-3); }
.zshell-foot kbd { font: 12px var(--mono); border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; color: var(--text-2); background: var(--surface); }
.zshell-meter { flex-basis: 100%; justify-content: flex-end; display: inline-flex; gap: 8px; align-items: center; font: 12px var(--mono); white-space: nowrap; min-width: 0; }
.zshell-meter progress { width: 56px; height: 6px; flex: none; accent-color: var(--accent); }
@media (max-width: 480px) { .zshell-meter { font-size: 10px; justify-content: flex-start; } }
.zshell-editor { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); padding: 18px; width: min(640px, calc(100vw - 32px)); }
.zshell-editor::backdrop { background: rgba(0, 0, 0, .35); }
.zshell-editor label { display: grid; gap: 8px; font-weight: 600; }
.zshell-editor textarea { font: 14px/1.5 var(--mono); color: var(--text); background: var(--code-bg); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px; width: 100%; box-sizing: border-box; }
.zshell-inspect h2 { margin: 0 0 6px; font-size: 18px; }
.zshell-inspect .note { margin: 0 0 12px; color: var(--text-2); font-size: 14px; }
.zshell-inspect .tree { max-height: 60vh; overflow: auto; font: 14px/1.5 var(--mono); }
.zshell-inspect .kids { margin-left: 18px; border-left: 1px solid var(--line); padding-left: 10px; }
.zshell-inspect summary, .zshell-inspect .leaf > b { cursor: pointer; }
.zshell-inspect .leaf { padding-left: 18px; }
.zshell-inspect .leaf span, .zshell-inspect summary span { color: var(--text-3); overflow-wrap: anywhere; }
.zshell-inspect .row { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 2px 0 6px; font-size: 13px; }
.zshell-inspect .row code { overflow-wrap: anywhere; }
.zshell-inspect .row .btn { padding: 2px 10px; font-size: 13px; }
.zshell-editor .btns { display: flex; gap: 10px; margin-top: 14px; }
.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; }
.live-demo .ld-term { margin: 0; padding: 10px 16px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--text); font: 13px/1.3 var(--mono); white-space: pre; overflow: auto; max-height: 24em; }
/* The helpers of a docs page (helper.js) and the shell of the page. */
.zpage-shell { margin: 24px 0 8px; }
.zshell .bar .zshell-dock { margin-left: auto; font: 13px var(--sans); color: var(--text-2); background: none; border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.zshell .bar .zshell-dock + label { margin-left: 12px; }
.zshell .bar .zshell-dock[hidden] { display: none; }
.zshell .bar .zshell-dock[hidden] + label { margin-left: auto; }
.zshell-docked { position: fixed; z-index: 30; right: 16px; bottom: 16px; width: min(var(--dock-w), calc(100vw - 32px)); margin: 0; box-shadow: 0 12px 40px rgb(0 0 0 / 0.3); }
@media (max-width: 640px) {
  .zshell-docked { left: 0; right: 0; bottom: 0; width: 100%; border-radius: 14px 14px 0 0; }
}
.zsetup { margin: 0 0 24px; font-size: 14px; color: var(--text-2); }
.zsetup pre { margin-top: 8px; }
.zhelper { margin: 24px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; min-width: 0; }
.zhelper-bar { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--bg-soft); font-size: 13px; color: var(--text-3); }
.zhelper-bar .zhelper-tag { font: 600 11px var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; }
.zhelper-bar .zhelper-title { font: 600 14px var(--sans); color: var(--text); }
.zhelper-bar .zhelper-caption { flex-basis: 100%; font-size: 14px; color: var(--text-2); }
.zhelper-app { position: relative; overflow: hidden; }
.zhelper-open { margin-left: auto; padding: 2px 12px; font-size: 13px; }
@media (max-width: 640px) {
  .zhelper:not(.zhelper-opened) .zhelper-app { display: none; }
  .zhelper:not(.zhelper-opened) .zhelper-hint { display: none; }
}
.zhelper-poster { margin: 0; padding: 16px 14px; color: var(--text-3); font-size: 14px; }
.zhelper details { border-top: 1px solid var(--line); padding: 8px 14px; font-size: 14px; color: var(--text-2); }
.zhelper details pre { margin: 8px 0 0; }
.zfile { margin: 16px 0; }
.zfile figcaption { font-size: 13px; color: var(--text-3); margin-bottom: 4px; }

/* The Learn course: the shell is fixed in the window and starts closed,
   as the button Try it at the bottom right. The lesson keeps the page,
   and the button never covers its text: a wide window keeps a gutter at
   the right of the text, and a narrow window keeps a strip at the
   bottom. Open, the shell is a panel at the bottom right of a wide
   window, with a grip at its top left corner for its size, and a sheet
   at the bottom of a narrow one. shell.js opens and closes it. The page
   never scrolls to it, and a Run link never moves the page. */
body.course { --dock-w: 520px; --dock-h: 560px; --sheet: 42vh; --tab: 144px; }
.zcourse-dock { position: fixed; z-index: 20; right: 16px; bottom: 16px; display: flex; flex-direction: column; align-items: flex-end; }
.zcourse-open { font: 600 14px var(--sans); color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 999px; padding: 10px 18px; box-shadow: var(--shadow); cursor: pointer; }
.zcourse-open::before { content: "\25B6\FE0E"; font-size: .75em; margin-right: .5em; vertical-align: .1em; }
.zcourse-open:hover { background: var(--accent-strong); }
.zcourse-open:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.zcourse-dock.open .zcourse-open, .zcourse-dock:not(.open) .zcourse { display: none; }
.zcourse { position: relative; margin: 0; width: var(--dock-w); height: var(--dock-h); max-width: calc(100vw - 32px); max-height: calc(100vh - 92px); box-sizing: border-box; display: flex; flex-direction: column; min-height: 0; min-width: 0; box-shadow: var(--shadow); }
.zcourse .zshell-meter { white-space: normal; }
.zcourse .zshell-meter > span { min-width: 0; }
.zcourse .zshell-poster { flex: 1; height: auto; }
.zcourse .zshell-screen { flex: 1; min-height: 0; }
.zcourse .bar button { font: 13px var(--sans); color: var(--text-2); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 8px; cursor: pointer; }
.zcourse .bar button:first-of-type { margin-left: auto; }
.zcourse .bar button:hover { color: var(--text); }
.zcourse-grip { position: absolute; z-index: 1; left: 0; top: 0; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none; border-top-left-radius: inherit; background: linear-gradient(135deg, var(--line-strong) 0 3px, transparent 3px 6px, var(--line-strong) 6px 7px, transparent 7px); }
@media (min-width: 961px) {
  body.course.zcourse-ready .docs { padding-right: max(24px, calc(var(--tab) - max(0px, (100vw - var(--wrap)) / 2))); }
}
@media (max-width: 960px) {
  .zcourse-dock { left: 0; right: 0; bottom: 0; align-items: stretch; }
  .zcourse-dock:not(.open) { align-items: flex-end; padding: 8px 16px; background: var(--bg); border-top: 1px solid var(--line); }
  body.course.zcourse-ready { padding-bottom: 57px; }
  .zcourse { width: auto; height: var(--sheet); max-width: none; max-height: none; border-radius: 14px 14px 0 0; box-shadow: 0 -8px 30px rgb(0 0 0 / 0.18); }
  .zcourse-grip { display: none; }
  body.course.zcourse-on .prose { padding-bottom: calc(var(--sheet) + 40px); }
  body.course.zcourse-on .docs-foot { padding-bottom: var(--sheet); }
}
/* A Run link: a command in code type that runs in the shell. */
.prose .zrun { cursor: pointer; }
.prose .zrun code { color: var(--accent-strong); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.prose .zrun code::before { content: "\25B6\FE0E"; font-size: .7em; margin-right: .4em; vertical-align: .1em; }
.prose .zrun:hover code, .prose .zrun:focus-visible code { background: var(--accent-soft); }
.prose .zrun:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 5px; }
.zdefine { margin: 0 0 20px; }
.zdefine pre { margin: 0; border-radius: 10px 10px 0 0; }
.zdefine figcaption { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; padding: 8px 12px; background: var(--bg-soft); }
.zdefine button { font: 600 14px var(--sans); color: #fff; background: var(--accent); border: 0; border-radius: 8px; padding: 6px 14px; cursor: pointer; }
#try-this + ul { border-left: 4px solid var(--accent); background: var(--bg-soft); border-radius: 0 10px 10px 0; padding: 12px 18px 12px 38px; }
@media (max-width: 420px) {
  .toplinks { gap: 0; }
  .toplinks a { padding: 6px 5px; }
}
@media (max-width: 640px) { .zcourse .zshell-hint { display: none; } }
.course .prose code { font-variant-ligatures: none; }
/* The index of the command reference. */
.ref-search input { font: 16px var(--mono); width: min(100%, 420px); padding: 8px 12px; margin-left: 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.ref-list { list-style: none; padding: 0; margin: 0 0 16px; }
.ref-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.ref-list li a { margin-right: 8px; }
.ref-cap { font: 600 11px var(--sans); letter-spacing: .05em; text-transform: uppercase; color: var(--warn); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; margin-right: 6px; }
.prose a.ref-link { text-decoration: none; }
.prose a.ref-link code { box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--accent) 55%, transparent); }
/* The stage of a live example of `dom` (docs/site/live.js): the root
   element of the script, with plain form controls. */
.live-demo .ld-stage { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 15px; }
.live-demo .ld-stage p { margin: 0 0 8px; }
.live-demo .ld-stage ul { margin: 0 0 8px; padding-left: 22px; }
.live-demo .ld-stage input { font: inherit; padding: 5px 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); color: var(--text); max-width: 100%; box-sizing: border-box; }
.live-demo .ld-stage button { font: inherit; padding: 5px 12px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: var(--bg); cursor: pointer; }

/* The datasheet layer. The rules above give the parts; these rules give
   the look of a printed datasheet: square corners, rules in ink, labels
   in small capitals, and numbers for the sections, the figures, and the
   tables. */
body { font: 16px/1.62 var(--sans); }
h1, h2, h3, h4 { font-family: var(--head); }
.logo { font: 700 22px/1 var(--head); letter-spacing: 0; }
.logo .glyph { border-radius: 0; font: 600 13px/1 var(--mono); }
.toplinks a { border-radius: 0; font: 600 17px/1 var(--head); text-transform: none; font-variant-caps: all-small-caps; letter-spacing: .06em; padding: 8px 9px; color: var(--text-2); }
.toplinks a:hover { background: var(--bg-soft); }
.toplinks a[aria-current] { background: none; color: var(--text); box-shadow: inset 0 -2px var(--text); }
.toplinks .sib::before { border-radius: 0; width: 7px; height: 7px; background: currentColor; }
.btn { border-radius: 0; font: 600 14px/1 var(--head); text-transform: uppercase; letter-spacing: .06em; padding: 11px 16px; }
.btn.ghost { border-color: var(--text); background: transparent; }
.btn.ghost:hover { background: var(--bg-soft); border-color: var(--text); }
.hero h1 { font: 700 clamp(32px, 3.6vw, 44px)/1.1 var(--head); letter-spacing: -.022em; }
.hero h1 em { color: inherit; }
.actions { align-items: center; }
.actions .text-link { font-weight: 600; margin-left: 6px; }
#specs { padding-top: 56px; }
.hero .sub { max-width: 34em; }

/* Numbered sections: the label of a section is a bar with its number. */
.section { padding: 72px 0 24px; border-bottom: 0; }
.section.alt { background: none; }
.eyebrow, .section .eyebrow { counter-increment: sec; display: flex; align-items: center; gap: 10px; font: 600 17px/1 var(--head); text-transform: none; font-variant-caps: all-small-caps; letter-spacing: .07em; color: var(--text-3); border-bottom: 1px solid var(--line); margin: 0 0 16px; padding: 0; }
.eyebrow::before { content: counter(sec); color: var(--accent); font: 700 21px/1 var(--head); font-variant-caps: normal; letter-spacing: 0; }
.section h2 { font: 700 clamp(24px, 2.6vw, 30px)/1.2 var(--head); letter-spacing: -.015em; margin-bottom: 10px; }
.section h3 { font-family: var(--head); font-size: 19px; letter-spacing: 0; }
.lede { margin-bottom: 24px; max-width: 66ch; }
.section .feat-group, .tc-kicker { font: 600 15px/1 var(--head); text-transform: none; font-variant-caps: all-small-caps; letter-spacing: .07em; color: var(--text-3); margin-top: 40px; }

/* After the four numbered sections, the rest of the landing page is
   appendices: letters in place of numbers, and smaller headings. */
main { counter-reset: sec appx; }
.section.appx .eyebrow { counter-increment: appx; }
.section.appx .eyebrow::before { content: counter(appx, upper-alpha); color: var(--text-3); }
.section.appx h2 { font-size: clamp(22px, 2.2vw, 26px); }
.section:not(.appx) + .section.appx { margin-top: 64px; border-top: 2px solid var(--text); }
.kicker { font: 600 17px/1 var(--head); font-variant-caps: all-small-caps; letter-spacing: .07em; color: var(--text-3); margin: 0 0 8px; }
ul.feat { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; border-top: 1px solid var(--line); }
ul.feat li { padding: 10px 0 10px 18px; border-bottom: 1px solid var(--line); position: relative; color: var(--text-2); }
ul.feat li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 7px; height: 7px; background: var(--text); }
ul.feat li b a { color: var(--text); }
@media (max-width: 760px) { ul.feat { grid-template-columns: minmax(0, 1fr); } }

/* A grid of cards is a grid of cells: rules in ink and in the line color. */
.grid { gap: 0; border-top: 1px solid var(--line); }
.grid > .card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 14px 18px 16px 0; }
.grid > .card + .card { padding-left: 18px; }
.g2 > .card:nth-child(2n+1), .g3 > .card:nth-child(3n+1), .g4 > .card:nth-child(4n+1) { padding-left: 0; }
.g2 > .card:not(:nth-child(2n+1)), .g3 > .card:not(:nth-child(3n+1)), .g4 > .card:not(:nth-child(4n+1)) { border-left: 1px solid var(--line); }
.card { border-radius: 0; }
.card .tag, .card .tag.plan { background: none; border: 0; border-radius: 0; padding: 0; color: var(--text-3); font: 600 15px/1 var(--head); font-variant-caps: all-small-caps; letter-spacing: .07em; margin-bottom: 8px; }
.card .tag::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; background: currentColor; vertical-align: 2px; }
.card .tag.plan { color: var(--text-3); }
.install { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; padding: 0; gap: 0; }
.install dt, .install dd { padding: 7px 0; border-bottom: 1px solid var(--line); }
.install dt { font: 600 16px var(--head); font-variant-caps: all-small-caps; letter-spacing: .06em; padding-right: 24px; }
.status, .family, .callout, .chart, .codecard, .shot, .live-demo, .pager a, .wgrid .wcard, .toy-card, .stage, details.more, .replay .rp-chat li { border-radius: 0; }
.status { border-color: var(--text); }
.family { border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: none; padding: 20px 0; }
.codecard { box-shadow: none; border: 0; border-top: 1px solid var(--line-strong); background: none; }
.codecard .bar { background: none; border-bottom-color: var(--line); padding-left: 0; }
.codecard .bar i { display: none; }
.codecard .bar span { margin-left: 0; }
.codecard pre { border-left: 3px solid var(--line-strong); }
.bars .fill { border-radius: 0; }
.legend i { border-radius: 0; }

/* The specifications: groups of measures side by side. The value is
   first and large, with a bar when it is a part of a whole. */
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 56px; }
.specs h3 { margin: 18px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line-strong); font: 600 18px/1.2 var(--head); font-variant-caps: all-small-caps; letter-spacing: .06em; color: var(--text-2); }
table.spec { border-collapse: collapse; width: 100%; }
.spec td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec td.val { width: 9.5rem; padding-right: 16px; white-space: nowrap; }
.spec .val b { display: block; font: 700 27px/1.05 var(--head); color: var(--accent); font-variant-numeric: lining-nums tabular-nums; }
.spec .meter { display: block; width: 8rem; height: 4px; margin-top: 7px; background: var(--line); }
.spec .meter i { display: block; height: 100%; background: var(--accent); }
.spec td.what { color: var(--text-2); font-size: 15.5px; line-height: 1.45; }
.spec .what small { display: block; margin-top: 2px; color: var(--text-3); font-size: 13.5px; }
.spec-note { margin: 14px 0 0; font-size: 14px; color: var(--text-3); }
@media (max-width: 860px) { .specs { grid-template-columns: minmax(0, 1fr); } }

/* A caption has its text only, with no number. */
.hero-shot > figcaption, .desk-row figcaption { text-align: left; }
.shot .frame { border-bottom-color: var(--line); }
.shot img, .shot .live-canvas { border-radius: 2px; box-shadow: none; }
.hl-phone { box-shadow: none; }
.desk-run, .toy-go { border-radius: 0; font: 600 15px/1 var(--head); text-transform: uppercase; letter-spacing: .06em; box-shadow: none; }
.toy-pick button, .toy-pick button img, .toy-controls button, .toy-card img { border-radius: 0; }

/* The docs pages. */
.sidebar { font-size: 14px; }
.sidebar h2, .sidebar summary { font: 700 17px/1 var(--head); text-transform: none; font-variant-caps: all-small-caps; letter-spacing: .06em; color: var(--text); padding-bottom: 5px; border-bottom: 1px solid var(--line-strong); margin: 18px 0 6px; }
.sidebar h2:first-child, .sidebar details:first-child > summary { margin-top: 0; }
.sidebar details.sub > summary { border-bottom: 0; font: 400 14px/1.4 var(--sans); font-variant-caps: normal; letter-spacing: 0; color: var(--text-2); margin: 0; padding: 3px 10px; }
.sidebar a.item { border-radius: 0; padding: 3px 10px; color: var(--text-3); }
.sidebar a.item:hover { background: var(--bg-soft); }
.sidebar a.item[aria-current] { color: var(--accent); font-weight: 600; background: none; box-shadow: inset 3px 0 var(--accent); }
.toc-button { border-radius: 0; font-family: var(--head); text-transform: uppercase; letter-spacing: .06em; }
.prose { counter-reset: h2; }
.prose > p, .prose > ul, .prose > ol, .prose > blockquote { max-width: 68ch; }
.prose h1 { font: 700 40px/1.1 var(--head); letter-spacing: -.02em; }
.prose h2 { font: 600 27px/1.2 var(--head); letter-spacing: 0; padding: 0 0 6px; border-bottom: 1px solid var(--line); position: relative; counter-increment: h2; }
.prose h2::before { content: counter(h2); position: absolute; right: calc(100% + 16px); color: var(--accent); font-variant-numeric: lining-nums; }
.prose h3 { font: 600 21px/1.25 var(--head); }
.prose h4 { font: 600 18px/1.3 var(--head); }
.prose code { border-radius: 2px; }
.prose pre { border-radius: 0; border-color: var(--line-strong); border-left: 3px solid var(--accent); }
.prose .table { border: 0; border-radius: 0; }
.prose table { border: 1px solid var(--line-strong); }
.prose th { background: var(--ink-bar); color: var(--ink-bar-text); font: 600 16px/1.3 var(--head); font-variant-caps: all-small-caps; letter-spacing: .05em; border-bottom-color: var(--ink-bar); }
.prose td + td { border-left-color: var(--line); }
.prose th + th { border-left-color: var(--line-strong); }
/* A code word, a link, and bold text in the dark bar of a table head
   take the text of the bar: the box of a code word is a mix of the bar
   and its text, so the contrast stays above 4.5 to 1 in both themes. */
.prose th code, .prose th a code { background: color-mix(in srgb, var(--ink-bar-text) 16%, var(--ink-bar)); color: var(--ink-bar-text); box-shadow: none; }
.prose th a { color: var(--ink-bar-text); text-decoration: underline; }
.prose th strong, .prose th b { color: inherit; }
.prose .alert, .prose .onpage { border-radius: 0; }
.prose img, .prose .hero-pic img { border-radius: 0; }
.prose .ld-shot img { border-radius: 0; }
.pager a { border: 0; border-top: 1px solid var(--line); }
.pager a span { font: 600 15px/1.3 var(--head); font-variant-caps: all-small-caps; letter-spacing: .07em; color: var(--text-3); }
.wgrid .wcard:hover { box-shadow: none; }
.wgrid img { border-radius: 0; }
.wgrid .wkind { border: 0; border-radius: 0; padding: 0; font: 600 14px var(--head); font-variant-caps: all-small-caps; letter-spacing: .06em; }

/* The live snippets and the games: square frames, buttons in small capitals. */
.live-demo { border-color: var(--line-strong); }
.live-demo.stack { box-shadow: none; }
.live-demo .ld-bar button, .live-demo .ld-bar select, .live-demo .ld-bar a, .toy-controls button, .stage .st-bar button, .replay .rp-bar button { border-radius: 0; }
.live-demo .ld-tag { font: 700 15px/1 var(--head); font-variant-caps: all-small-caps; letter-spacing: .07em; }
.live-demo .ld-frame { border-radius: 0; box-shadow: none; }
.ld-win { border-radius: 4px; }
.ld-grip { border-bottom-right-radius: 3px; }
.live-demo .ld-inspect, .live-demo .ld-console { border-radius: 0; }
.stage .st-steps li, .stage .st-code, .stage .st-part, .stage .st-mark, .stage .st-mark span { border-radius: 0; }
.tabs > label { font-family: var(--head); font-size: 15px; text-transform: uppercase; letter-spacing: .05em; }

.foot { font: 13px/1.5 var(--mono); border-top: 1px solid var(--text); }

@media (max-width: 1100px) {
  .prose h2::before { position: static; margin-right: 12px; }
}
@media (max-width: 960px) {
  .g3 > .card:nth-child(n) { padding-left: 0; border-left: 0; }
  .g4 > .card:nth-child(n) { padding-left: 0; border-left: 0; }
}
@media (max-width: 640px) {
  .grid > .card:nth-child(n) { padding-left: 0; border-left: 0; }
  .mast .part { font-size: 60px; }
  .install dt { padding-bottom: 0; border-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Print: the page as a datasheet on paper. The menus, the controls of
   the live examples, and the games stay off the paper. */
@media print {
  @page { margin: 16mm 14mm; }
  :root { --bg: #fff; --bg-soft: #f2f2f2; --bg-deep: #e6e6e6; --surface: #fff; --code-bg: #f2f2f2; --text: #000; --text-2: #222; --text-3: #444; --line: #bbb; --line-strong: #888; --ink-bar: #000; --ink-bar-text: #fff; --accent: #1f3a6e; --accent-ink: #fff; }
  body { font-size: 10.5pt; line-height: 1.45; }
  .top, .skip, .sidebar, .toc-button, .toc-toggle, .pager, .ld-bar, .ld-err, .ld-inspect, .toy-controls, .toy-touch, .toy-cover, .toy-pick, .desk-run, .actions, .stage .st-bar { display: none !important; }
  .docs { display: block; padding: 0; }
  .prose { max-width: none; padding: 0; }
  .prose h2::before { position: static; margin-right: 10px; }
  a { color: inherit; text-decoration: none; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8.5pt; color: #444; word-break: break-all; }
  h1, h2, h3, h4 { break-after: avoid; }
  pre, table, figure, .card, .live-demo, .spec { break-inside: avoid; }
  pre { white-space: pre-wrap; }
  .live-demo .ld-code textarea { display: none; }
  .foot { border-top: 1px solid #000; }
}
@media (max-width: 640px) {
  .toplinks a { font-size: 15px; padding: 6px 5px; letter-spacing: .03em; }
}
@media (max-width: 480px) {
  .toplinks a { font-size: 14px; padding: 6px 3px; letter-spacing: 0; }
  .logo .glyph { display: none; }
}

/* The shell, the helpers, and the course of the ztcl site. */
.zshell, .zhelper, .zshell-editor, .zshell .bar .zshell-dock, .zshell-foot kbd, .zshell-editor textarea, .live-demo .ld-file .ld-svg, .live-demo .ld-file iframe { border-radius: 0; }
.zshell { box-shadow: none; border-color: var(--line-strong); }
.zshell .bar { background: var(--bg-deep); }
.zshell .bar i { display: none; }
.zshell .bar span { margin-left: 0; }
.zhelper-bar .zhelper-tag { border: 0; border-radius: 0; padding: 0; font: 600 14px/1.2 var(--head); text-transform: none; font-variant-caps: all-small-caps; letter-spacing: .07em; }
.zhelper-bar .zhelper-title { font-family: var(--head); }
.zcourse-open { border-radius: 0; font: 600 15px/1 var(--head); text-transform: uppercase; letter-spacing: .06em; }
.zshell-docked { border-radius: 0; }
.benchtabs button, .benchfig img, .zcourse, .zdefine pre, .zdefine { border-radius: 0; }
.benchtabs button { font-family: var(--head); font-size: 15px; }
.hero .ai-note { margin: 18px 0 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--line-strong); font-size: 14px; line-height: 1.5; color: var(--text-2); max-width: 40em; }
.manifest p { max-width: 66ch; }
.zhelper-open { padding: 4px 12px; font-size: 13px; }

/* A big feature of the landing page: a numbered section with three lines
   of text and one picture or live example. */
.feature .feat-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 56px; align-items: start; }
.feature .feat-text:only-child { grid-column: 1 / -1; }
.feature .feat-text:only-child p { max-width: 70ch; }
.feature .feat-text p { color: var(--text-2); max-width: 46ch; margin: 0 0 10px; }
.feature .feat-text .feat-links { margin-top: 16px; color: var(--text-3); font-size: 15px; }
.feature .feat-text .xlink { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-3); }
.feat-pic { margin: 6px 0 0; min-width: 0; }
.feat-pic img { display: block; width: 100%; height: auto; }
.feat-pic img.tall { width: auto; max-height: 460px; }
.feat-pic figcaption { margin-top: 8px; font-size: 14px; color: var(--text-3); }
.feature .benchtabs { margin-top: 28px; }
.feature .benchfig img { max-width: 760px; border: 0; }
@media (max-width: 860px) { .feature .feat-row { grid-template-columns: minmax(0, 1fr); } }
.feature .chart, .chart { border: 0; padding: 0; background: none; }

/* The color theme (assets/theme.js): a forced theme wins over the system. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.theme-toggle { flex: none; margin-left: 8px; min-width: 5.2em; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 0; background: var(--surface); color: var(--text-2); font: 600 15px/1 var(--head); font-variant-caps: all-small-caps; letter-spacing: .06em; cursor: pointer; }
.theme-toggle:hover { color: var(--text); background: var(--bg-soft); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; }
.theme-toggle .tt-icon { font-variant-caps: normal; font-size: 13px; }
@media (max-width: 640px) { .theme-toggle { min-width: 0; margin-left: 4px; padding: 5px 7px; } .theme-toggle .tt-text { display: none; } }

/* The paths of "What do you want to do?" and "How it works" on the
   landing page. */
.paths { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; margin-top: 20px; }
.path { display: flex; flex-direction: column; border: 1px solid var(--line-strong); background: var(--surface); padding: 20px 22px; min-width: 0; }
.path h3 { font: 700 21px/1.25 var(--head); margin: 0 0 6px; }
.path > p { color: var(--text-2); margin: 0 0 12px; }
.path pre.term { margin: 0 0 14px; padding: 12px 14px; font-size: 13px; line-height: 1.55; background: var(--code-bg); border: 1px solid var(--line); overflow-x: auto; }
.path .steps { margin: 0 0 14px; padding-left: 22px; color: var(--text-2); }
.path .steps li + li { margin-top: 6px; }
.path .steps code { font-size: 13.5px; overflow-wrap: break-word; }
.path .path-link { margin: auto 0 0; font-weight: 600; color: var(--accent); }
a.path { color: inherit; text-decoration: none; }
a.path:hover { border-color: var(--accent); }
a.path:hover .path-link { text-decoration: underline; }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.how p { margin: 0; color: var(--text-2); }
@media (max-width: 860px) { .paths, .how { grid-template-columns: minmax(0, 1fr); } }
#install .install { display: grid; grid-template-columns: max-content minmax(0, 1fr); margin: 0 0 12px; }
#install .install dd { margin: 0; }
@media (max-width: 640px) { #install .install { grid-template-columns: minmax(0, 1fr); } }
#how .ai-note { margin-top: 24px; }

/* The hero of the landing page: the text starts at the top of the shell,
   the release facts are one quiet line, and the first section follows at
   the gap of the other sections. */
.hero { padding-bottom: 0; }
.hero .wrap { align-items: start; }
.hero .mast { justify-content: flex-start; }
.hero .facts { margin: 14px 0 0; font: 12.5px/1.4 var(--mono); color: var(--text-3); }
.hero .zshell-meter { white-space: normal; }
.hero .zshell-meter > span { min-width: 0; text-align: right; }

/* The switch between the two sites, next to the logo of each page:
   ztcl | ztk, with the current site marked. It stays on a phone. */
.sites { display: inline-flex; flex: none; border: 1px solid var(--line-strong); margin-left: -8px; }
.sites a { font: 600 13px/1 var(--mono); padding: 5px 8px; color: var(--text-3); text-decoration: none; }
.sites a + a { border-left: 1px solid var(--line-strong); }
.sites a[aria-current] { background: var(--text); color: var(--bg); }
.sites a:not([aria-current]):hover { color: var(--text); background: var(--bg-soft); }
@media (max-width: 480px) { .sites a { padding: 4px 6px; font-size: 12px; } }
/* On a phone the switch names the site, so the logo and GitHub go, and
   the header fits in 390 pixels. */
@media (max-width: 480px) {
  .top .logo { display: none; }
  .sites { margin-left: 0; }
  .toplinks a[href^="https://github.com"] { display: none; }
}
