/* Sonic 9 -- the user manual (the stylesheet of Comma). One stylesheet for every language. */
:root {
  --bg: #f6f8f9; --page: #ffffff; --ink: #1b2329; --soft: #55646e; --line: #d6dee3;
  --accent: #0f8fa3; --accent-soft: #e3f4f6; --note: #fff6e0; --note-line: #f0b429; --code: #eef2f4;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1114; --page: #111a1f; --ink: #dce7ec; --soft: #93a6b0; --line: #24343c;
    --accent: #3fd2e6; --accent-soft: #12303a; --note: #2a2410; --note-line: #c9951f; --code: #1a262c;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif;
}
.layout { display: flex; max-width: 1280px; margin: 0 auto; }
nav.toc {
  position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto;
  width: 270px; flex: none; padding: 24px 16px; border-right: 1px solid var(--line); font-size: 14px;
}
nav.toc .brand { font-size: 22px; font-weight: 700; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 4px; }
nav.toc .langs { margin: 0 0 16px; font-size: 13px; color: var(--soft); }
nav.toc .langs a { margin-right: 6px; }
nav.toc ol { list-style: none; margin: 0; padding: 0; }
nav.toc li { margin: 2px 0; }
nav.toc ol ol { padding-left: 14px; font-size: 13px; }
nav.toc a { color: var(--ink); text-decoration: none; }
nav.toc a:hover { color: var(--accent); }
main { flex: 1; min-width: 0; background: var(--page); padding: 32px 48px 80px; }
h1 { font-size: 34px; margin: 0 0 4px; letter-spacing: 0.02em; }
.subtitle { color: var(--soft); margin: 0 0 32px; }
h2 { font-size: 26px; margin: 56px 0 12px; padding-top: 8px; border-top: 2px solid var(--accent); }
h3 { font-size: 20px; margin: 32px 0 8px; }
h4 { font-size: 16px; margin: 20px 0 6px; color: var(--accent); }
a { color: var(--accent); }
p, ul, ol, table { margin: 0 0 14px; }
figure { margin: 18px 0 22px; }
figure img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; display: block; }
figcaption { font-size: 13px; color: var(--soft); margin-top: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 6px 10px; border-bottom: 1px solid var(--line); }
th { background: var(--accent-soft); font-weight: 600; }
td:first-child { white-space: nowrap; font-weight: 600; }
table.col-libre td:first-child { white-space: normal; width: 30%; }
/* Tables grouped by block (Mangle): the block name spans its rows, the control after it reads like a first column;
   a cell across two columns is a note, it wraps. */
td[rowspan] { border-right: 1px solid var(--line); }
td[rowspan] + td { white-space: nowrap; font-weight: 600; }
td[rowspan], td[rowspan] + td { width: 1%; }
td[colspan] { white-space: normal; font-weight: normal; }
.ui { font-weight: 600; padding: 0 4px; border-radius: 3px; background: var(--code); white-space: nowrap; }
kbd { font: 13px/1 Consolas, monospace; padding: 2px 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--code); }
.note { background: var(--note); border-left: 4px solid var(--note-line); padding: 10px 14px; border-radius: 4px; margin: 0 0 16px; }
.flow { font: 14px/1.7 Consolas, monospace; background: var(--code); padding: 12px 16px; border-radius: 6px; overflow-x: auto; white-space: pre; }
ol.callouts li::marker { font-weight: 700; color: var(--accent); }
@media (max-width: 900px) {
  .layout { display: block; }
  nav.toc { position: static; height: auto; width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  main { padding: 20px 16px 60px; }
  td:first-child { white-space: normal; }
}
@media print {
  nav.toc { display: none; }
  main { padding: 0; }
  h2 { break-before: page; }
  figure, table { break-inside: avoid; }
}
