:root {
  --ink: #1c1b1f;
  --muted: #5f5b66;
  --accent: #4f4a9e;
  --line: #e2dfe8;
  --code-bg: #f4f2f8;
  --page: #ffffff;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
}
main { max-width: 860px; margin: 0 auto; padding: 32px 20px 64px; }
h1 { font-size: 2rem; margin: 0 0 8px; }
h2 { font-size: 1.35rem; margin: 36px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.05rem; margin: 24px 0 8px; }
p.subtitle { color: var(--muted); margin-top: 0; }
a { color: var(--accent); }
nav.top, nav.bottom { display: flex; gap: 16px; justify-content: space-between; font-size: 0.95rem; }
nav.top { margin-bottom: 24px; }
nav.bottom { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); }
ol.toc { padding-left: 1.4em; }
ol.toc li { margin: 6px 0; font-size: 1.05rem; }
table.notations { border-collapse: collapse; width: 100%; }
table.notations td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.notations td:first-child { width: 45%; }
code { background: var(--code-bg); padding: 2px 6px; border-radius: 4px; font-family: "Cascadia Mono", Consolas, monospace; font-size: 0.92em; word-break: break-word; }
.example { margin: 20px 0 32px; }
.example .caption { font-weight: 500; margin-bottom: 6px; }
.example .input { color: var(--muted); margin-bottom: 10px; }
.example img { display: block; width: 100%; max-width: 412px; border: 1px solid var(--line); border-radius: 12px; }
ul.soon li { margin: 4px 0; }
ol.toc ul { margin: 4px 0 8px; padding-left: 1.2em; list-style: none; }
ol.toc ul li { margin: 2px 0; font-size: 0.95rem; }
.chip { display: inline-block; margin-left: 6px; padding: 1px 10px; border-radius: 12px; background: #e8e5f6; color: var(--accent); font-size: 0.85rem; }
ul.limitations { padding-left: 1.2em; }
ul.limitations li { margin: 6px 0; }
footer { margin-top: 32px; color: var(--muted); font-size: 0.85rem; }

/* The parts of a long example: only in the PDF. */
.example .parts { display: none; }

/* The single document for the PDF: one chapter per page, no navigation; a long example cut into parts side by side
   (each at most about half a page), a heading or a caption never left alone at a page's end. */
@media print {
  nav { display: none; }
  main { padding: 0; max-width: none; }
  section.chapter { break-before: page; }
  h1, h2, h3, .example .caption, .example .input { break-after: avoid; }
  .example img { max-width: 300px; }
  .example img.whole { break-inside: avoid; }
  .example img.whole.cut { display: none; }
  .example .parts { display: grid; grid-template-columns: repeat(2, 300px); gap: 12px 24px; align-items: start; }
  .example .parts img { width: 300px; break-inside: avoid; }
  a { color: var(--ink); text-decoration: none; }
}
