/* Rowan User Guide. Colors follow Rowan's own design tokens. */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/Inter-Regular.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/Inter-Medium.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 600 700; font-style: normal; font-display: swap; src: url("fonts/Inter-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/JetBrainsMono-Regular.ttf") format("truetype"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: italic; font-display: swap; src: url("fonts/JetBrainsMono-Italic.ttf") format("truetype"); }

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --bg-sidebar: #F5F5F7;
  --bg-elevated: #FFFFFF;
  --bg-code: #F5F5F7;
  --bg-hover: rgba(0, 0, 0, 0.045);
  --text: #1D1D1F;
  --text-2: #5E5E63;
  --text-3: #6E6E73;
  --separator: rgba(0, 0, 0, 0.09);
  --control-border: rgba(0, 0, 0, 0.18);
  --accent: #007AFF;
  --accent-soft: rgba(0, 122, 255, 0.10);
  --link: #0066CC;
  --success: #28A745;
  --warning: #C77700;
  --danger: #D70015;
  --note-bg: rgba(0, 122, 255, 0.06);
  --tip-bg: rgba(40, 167, 69, 0.07);
  --important-bg: rgba(245, 166, 35, 0.10);
  --caution-bg: rgba(255, 59, 48, 0.07);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 28px rgba(0, 0, 0, 0.09);
  --key-bg: linear-gradient(#FFFFFF, #F4F4F6);
  --key-border: rgba(0, 0, 0, 0.16);
  --key-shadow: 0 1px 0 rgba(0, 0, 0, 0.14);
  --sql-keyword: #AD3DA4;
  --sql-string: #C41A16;
  --sql-number: #1C00CF;
  --sql-comment: #707F8C;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, ui-monospace, monospace;
  --topbar: 56px;
  --sidebar-w: 288px;
  --toc-w: 220px;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1E1E1E;
    --bg-sidebar: #252526;
    --bg-elevated: #2C2C2E;
    --bg-code: #262628;
    --bg-hover: rgba(255, 255, 255, 0.06);
    --text: rgba(255, 255, 255, 0.88);
    --text-2: rgba(255, 255, 255, 0.62);
    --text-3: rgba(255, 255, 255, 0.52);
    --separator: rgba(255, 255, 255, 0.09);
    --control-border: rgba(255, 255, 255, 0.18);
    --accent: #0A84FF;
    --accent-soft: rgba(10, 132, 255, 0.16);
    --link: #2E9BFF;
    --success: #30D158;
    --warning: #FF9F0A;
    --danger: #FF6961;
    --note-bg: rgba(10, 132, 255, 0.10);
    --tip-bg: rgba(48, 209, 88, 0.09);
    --important-bg: rgba(255, 159, 10, 0.11);
    --caution-bg: rgba(255, 69, 58, 0.11);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 32px rgba(0, 0, 0, 0.45);
    --key-bg: linear-gradient(#3A3A3C, #323234);
    --key-border: rgba(255, 255, 255, 0.14);
    --key-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
    --sql-keyword: #FF7AB2;
    --sql-string: #FF8170;
    --sql-number: #D9C97C;
    --sql-comment: #8A99A6;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1E1E1E;
  --bg-sidebar: #252526;
  --bg-elevated: #2C2C2E;
  --bg-code: #262628;
  --bg-hover: rgba(255, 255, 255, 0.06);
  --text: rgba(255, 255, 255, 0.88);
  --text-2: rgba(255, 255, 255, 0.62);
  --text-3: rgba(255, 255, 255, 0.52);
  --separator: rgba(255, 255, 255, 0.09);
  --control-border: rgba(255, 255, 255, 0.18);
  --accent: #0A84FF;
  --accent-soft: rgba(10, 132, 255, 0.16);
  --link: #2E9BFF;
  --success: #30D158;
  --warning: #FF9F0A;
  --danger: #FF6961;
  --note-bg: rgba(10, 132, 255, 0.10);
  --tip-bg: rgba(48, 209, 88, 0.09);
  --important-bg: rgba(255, 159, 10, 0.11);
  --caution-bg: rgba(255, 69, 58, 0.11);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 32px rgba(0, 0, 0, 0.45);
  --key-bg: linear-gradient(#3A3A3C, #323234);
  --key-border: rgba(255, 255, 255, 0.14);
  --key-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
  --sql-keyword: #FF7AB2;
  --sql-string: #FF8170;
  --sql-number: #D9C97C;
  --sql-comment: #8A99A6;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 20px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 500;
}
.skip-link:focus { top: 10px; text-decoration: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.brand .brand-sub { color: var(--text-2); font-weight: 400; }
.topbar .spacer { flex: 1; }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-button:hover { background: var(--bg-hover); color: var(--text); }
.icon-button svg { width: 18px; height: 18px; }
.menu-button { display: none; }

/* Search */
.search { position: relative; width: min(340px, 40vw); }
.search input {
  width: 100%; height: 34px;
  padding: 0 12px 0 34px;
  border-radius: 9px;
  border: 1px solid var(--control-border);
  background: var(--bg-sidebar);
  color: var(--text);
  font: inherit; font-size: 14px;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search > svg { position: absolute; left: 11px; top: 9px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.search-results {
  position: absolute; top: 42px; right: 0; width: min(460px, 92vw);
  max-height: min(70vh, 560px); overflow: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--separator);
  border-radius: 12px; box-shadow: var(--shadow);
  padding: 6px; margin: 0; list-style: none;
}
.search-results[hidden] { display: none; }
.search-results li a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.search-results li a:hover, .search-results li a[aria-selected="true"] { background: var(--accent-soft); text-decoration: none; }
.search-results .r-title { display: block; font-weight: 500; font-size: 14.5px; }
.search-results .r-chapter { display: block; font-size: 12px; color: var(--text-2); margin-top: 1px; }
.search-results .r-snippet { display: block; font-size: 13px; color: var(--text-2); margin-top: 3px; line-height: 1.45; }
.search-results mark { background: none; color: var(--link); font-weight: 600; }
.search-results .r-empty { padding: 14px 12px; color: var(--text-2); font-size: 14px; }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar));
}
.sidebar {
  position: sticky; top: var(--topbar);
  height: calc(100vh - var(--topbar));
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--separator);
  padding: 22px 14px 40px;
  font-size: 14.5px;
}
.sidebar .side-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); padding: 0 10px 8px; }
.sidebar ol { list-style: none; margin: 0; padding: 0; }
.sidebar .chapter > a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 7px; color: var(--text);
  line-height: 1.35;
}
.sidebar .chapter > a .num { color: var(--text-3); font-variant-numeric: tabular-nums; width: 1.4em; text-align: right; flex: none; font-size: 13px; }
.sidebar .chapter > a:hover { background: var(--bg-hover); text-decoration: none; }
.sidebar .chapter.current > a { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.sidebar .sections { margin: 4px 0 8px 34px !important; border-left: 1px solid var(--separator); }
.sidebar .sections a { display: block; padding: 4px 10px 4px 14px; color: var(--text-2); font-size: 13.5px; line-height: 1.4; border-radius: 0 6px 6px 0; margin-left: -1px; border-left: 2px solid transparent; }
.sidebar .sections a:hover { color: var(--text); text-decoration: none; }
.sidebar .sections a.active { color: var(--link); border-left-color: var(--accent); }
.sidebar .side-foot { margin-top: 18px; padding: 14px 10px 0; border-top: 1px solid var(--separator); }
.sidebar .side-foot a { display: flex; gap: 8px; align-items: center; color: var(--text-2); font-size: 13.5px; padding: 4px 0; }
.sidebar .side-foot svg { width: 15px; height: 15px; }

.content-wrap { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 0 40px; }
main { width: 100%; max-width: 760px; padding: 48px 0 80px; }
.toc { display: none; }

@media (min-width: 1280px) {
  .content-wrap { grid-template-columns: minmax(0, 1fr) var(--toc-w); gap: 48px; justify-items: stretch; }
  main { justify-self: center; }
  .toc { display: block; position: sticky; top: calc(var(--topbar) + 40px); align-self: start; max-height: calc(100vh - var(--topbar) - 60px); overflow: auto; padding: 4px 0 20px; font-size: 13px; }
  .toc h2 { border: 0; padding: 0; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin: 0 0 10px; }
  .toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--separator); }
  .toc a { display: block; padding: 4px 0 4px 14px; color: var(--text-2); line-height: 1.4; margin-left: -1px; border-left: 2px solid transparent; }
  .toc .h3 a { padding-left: 26px; font-size: 12.5px; }
  .toc a:hover { color: var(--text); text-decoration: none; }
  .toc a.active { color: var(--link); border-left-color: var(--accent); }
}

/* Typography */
.eyebrow { font-size: 14px; font-weight: 600; color: var(--text-2); margin: 0 0 6px; letter-spacing: 0.01em; }
h1 { font-size: 44px; line-height: 1.1; letter-spacing: -0.028em; font-weight: 600; margin: 0 0 16px; }
.lead { font-size: 21px; line-height: 1.5; color: var(--text-2); margin: 0 0 32px; letter-spacing: -0.005em; }
h2 { font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 600; margin: 64px 0 14px; padding-top: 40px; border-top: 1px solid var(--separator); }
main > h1 + .lead + h2, .chapter-intro + h2 { border-top: 0; padding-top: 0; margin-top: 40px; }
h3 { font-size: 21px; line-height: 1.3; letter-spacing: -0.012em; font-weight: 600; margin: 40px 0 10px; }
h4 { font-size: 17px; font-weight: 600; margin: 28px 0 6px; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 18px; padding-left: 1.4em; }
li { margin: 6px 0; }
li > ul, li > ol { margin: 6px 0 0; }
strong { font-weight: 600; }
.anchor { margin-left: 8px; color: var(--text-3); opacity: 0; font-weight: 400; transition: opacity .15s ease-out; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus-visible { opacity: 1; text-decoration: none; }
hr { border: 0; border-top: 1px solid var(--separator); margin: 40px 0; }

/* Steps */
ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 40px; margin: 12px 0; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--link);
  font-size: 13.5px; font-weight: 600; line-height: 26px; text-align: center; font-variant-numeric: tabular-nums;
}

/* Inline code and keys */
code { font-family: var(--mono); font-size: 0.86em; background: var(--bg-code); border: 1px solid var(--separator); border-radius: 5px; padding: 0.08em 0.36em; font-variant-ligatures: none; }
kbd.key {
  display: inline-block; min-width: 1.75em;
  padding: 0.02em 0.48em 0.08em;
  font-family: var(--font); font-size: 0.8em; font-weight: 500; line-height: 1.5;
  text-align: center; white-space: nowrap; color: var(--text);
  background: var(--key-bg);
  border: 1px solid var(--key-border); border-radius: 6px;
  box-shadow: var(--key-shadow);
  vertical-align: 0.08em;
}
.keys { white-space: nowrap; }
.keys .plus { color: var(--text-3); font-size: 0.8em; margin: 0 0.12em; }

/* Code blocks */
.code { position: relative; margin: 0 0 22px; }
.code pre {
  margin: 0; padding: 16px 18px; overflow-x: auto;
  background: var(--bg-code);
  border: 1px solid var(--separator); border-radius: var(--radius);
  font-family: var(--mono); font-size: 14px; line-height: 1.6; font-variant-ligatures: none;
  tab-size: 4;
}
.code pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.code .copy {
  position: absolute; top: 8px; right: 8px;
  height: 28px; padding: 0 10px; border-radius: 7px;
  border: 1px solid var(--control-border); background: var(--bg-elevated); color: var(--text-2);
  font: 500 12.5px var(--font); cursor: pointer; opacity: 0; transition: opacity .15s ease-out;
}
.code:hover .copy, .code .copy:focus-visible, .code .copy.done { opacity: 1; }
@media (hover: none) { .code .copy { opacity: 1; } }
.code .copy:hover { color: var(--text); }
.tok-k { color: var(--sql-keyword); font-weight: 500; }
.tok-s { color: var(--sql-string); }
.tok-n { color: var(--sql-number); }
.tok-c { color: var(--sql-comment); font-style: italic; }

/* Callouts */
.callout { margin: 0 0 22px; padding: 14px 18px; border-radius: var(--radius); background: var(--note-bg); font-size: 16px; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout .label { display: block; font-weight: 600; font-size: 13px; letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 2px; color: var(--link); }
.callout.tip { background: var(--tip-bg); }
.callout.tip .label { color: var(--success); }
.callout.important { background: var(--important-bg); }
.callout.important .label { color: var(--warning); }
.callout.caution { background: var(--caution-bg); }
.callout.caution .label { color: var(--danger); }

/* Figures */
figure { margin: 28px auto 32px; max-width: var(--w, none); }
figure .frame { display: block; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--separator); background: var(--bg-sidebar); }
figure.plain .frame { box-shadow: none; }
figure img { display: block; width: 100%; height: auto; }
figure.narrow { max-width: min(560px, var(--w, 560px)); }
figure.small { max-width: min(420px, var(--w, 420px)); }
figcaption { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--text-2); text-align: center; padding: 0 12px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--separator); }
th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); border-bottom-color: var(--control-border); }
td:first-child { white-space: nowrap; }
table.keymap td:first-child { width: 42%; }
table.wrap td:first-child { white-space: normal; }
dl.options { margin: 0 0 22px; }
dl.options dt { font-weight: 600; margin-top: 14px; }
dl.options dd { margin: 2px 0 0; color: var(--text); }

/* Prev / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--separator); }
.pager a { display: block; padding: 16px 18px; border: 1px solid var(--separator); border-radius: 12px; color: var(--text); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager .dir { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 2px; }
.pager .t { font-weight: 600; color: var(--link); }
.pager .next { text-align: right; grid-column: 2; }

.page-foot { margin-top: 48px; font-size: 13px; color: var(--text-3); }
.page-foot a { color: var(--text-2); }

/* Home */
.hero { text-align: center; padding: 40px 0 16px; }
.hero img { width: 112px; height: 112px; margin-bottom: 18px; }
.hero h1 { font-size: 52px; margin-bottom: 14px; }
.hero .lead { max-width: 34em; margin: 0 auto 30px; font-size: 22px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.button { display: inline-flex; align-items: center; height: 40px; padding: 0 20px; border-radius: 20px; font-weight: 500; font-size: 15.5px; background: var(--accent); color: #fff; }
.button:hover { text-decoration: none; filter: brightness(1.07); }
.button.secondary { background: transparent; color: var(--link); border: 1px solid var(--control-border); }
.home-figure { margin: 40px 0 56px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 24px 0 40px; padding: 0; list-style: none; }
.cards li { margin: 0; }
.cards a { display: flex; flex-direction: column; height: 100%; padding: 20px 20px 18px; border-radius: 14px; background: var(--bg-sidebar); border: 1px solid var(--separator); color: var(--text); transition: border-color .15s ease-out, transform .2s ease-out; }
.cards a:hover { text-decoration: none; border-color: var(--accent); }
.cards .card-icon { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--link); margin-bottom: 14px; }
.cards .card-icon svg { width: 18px; height: 18px; }
.cards .card-title { font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.cards .card-text { font-size: 14.5px; color: var(--text-2); line-height: 1.5; }
.home main { max-width: 1000px; justify-self: center; }
.home .content-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.home .also { text-align: center; color: var(--text-2); font-size: 15px; margin-top: -8px; }
.home .layout { grid-template-columns: minmax(0, 1fr); }
.home .sidebar { display: none; }
.home .menu-button { display: none !important; }
.home h2.section-title { border-top: 0; padding-top: 0; margin-top: 56px; font-size: 26px; }

/* Phone and tablet */
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-button { display: inline-flex; }
  .sidebar {
    position: fixed; z-index: 50; top: var(--topbar); left: 0; bottom: 0; height: auto;
    width: min(320px, 86vw);
    transform: translateX(-102%); transition: transform .22s ease-out; visibility: hidden;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; visibility: visible; }
  .scrim { position: fixed; inset: var(--topbar) 0 0 0; z-index: 45; background: rgba(0, 0, 0, 0.32); }
  .scrim[hidden] { display: none; }
  .content-wrap { padding: 0 24px; }
}
@media (max-width: 440px) { .brand > span { display: none; } }
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .topbar { padding: 0 10px 0 6px; gap: 6px; }
  .brand .brand-sub { display: none; }
  .topbar a.icon-button[href="print.html"] { display: none; }
  .search { width: auto; flex: 1; }
  .content-wrap { padding: 0 16px; }
  main { padding-top: 28px; }
  h1 { font-size: 34px; }
  .hero h1 { font-size: 38px; }
  .lead, .hero .lead { font-size: 18.5px; }
  h2 { font-size: 25px; margin-top: 48px; padding-top: 32px; }
  h3 { font-size: 19px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  td:first-child { white-space: normal; }
  figure { margin-left: -4px; margin-right: -4px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
}

/* Print */
.print-only { display: none; }
@page { margin: 20mm 18mm 22mm; @bottom-center { content: counter(page); font: 9pt Inter, sans-serif; color: #888; } @top-right { content: "Rowan User Guide"; font: 9pt Inter, sans-serif; color: #888; } }
@page :first { @bottom-center { content: none; } @top-right { content: none; } }
@media print {
  :root { color-scheme: light; --bg: #fff; --text: #1D1D1F; --text-2: #55555A; --link: #0055B3; --bg-code: #F5F5F7; --separator: rgba(0,0,0,.14); --shadow: none; }
  body { font-size: 10.5pt; line-height: 1.5; background: #fff; }
  .topbar, .sidebar, .toc, .pager, .skip-link, .code .copy, .anchor, .scrim, .hero-actions, .no-print { display: none !important; }
  .print-only { display: block; }
  .layout, .content-wrap { display: block; padding: 0; }
  main { max-width: none; padding: 0; }
  h1 { font-size: 26pt; }
  h2 { font-size: 16pt; margin-top: 22pt; padding-top: 0; border-top: 0; break-after: avoid; }
  h3 { font-size: 12.5pt; margin-top: 16pt; break-after: avoid; }
  .lead { font-size: 13pt; }
  figure, .callout, .code, tr, .cards li { break-inside: avoid; }
  .table-wrap { overflow: visible; }
  thead { display: table-header-group; }
  figure { margin: 12pt auto 14pt; }
  figure .frame { border: 0.5pt solid #ccc; box-shadow: none; }
  /* Crops print at about the scale of the full windows, not at their screen size. */
  figure, figure.narrow, figure.small { max-width: min(88%, calc(var(--w, 1280px) * 0.6)); }
  figcaption { font-size: 8.5pt; }
  p, li { orphans: 3; widows: 3; }
  dl.options dt, .callout .label, figure + figcaption { break-after: avoid; }
  .code pre { white-space: pre-wrap; font-size: 8.5pt; }
  main a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #666; word-break: break-all; }
  main a.bare::after { content: none; }
  .print-chapter { break-before: page; }
  .print-cover { break-after: page; text-align: center; padding-top: 50mm; }
  .print-cover img { width: 36mm; height: 36mm; }
  .print-cover h1 { font-size: 34pt; margin: 8mm 0 3mm; }
  .print-cover .sub { font-size: 15pt; color: #555; }
  .print-cover .legal { margin-top: 70mm; font-size: 9pt; color: #777; }
  .print-toc { break-after: page; }
  .print-toc ol { list-style: none; padding: 0; }
  .print-toc > ol > li { margin: 0 0 5pt; font-weight: 600; font-size: 10.5pt; break-inside: avoid; }
  .print-toc li ol { margin: 0 0 0 14pt; line-height: 1.4; }
  .print-toc li li { display: inline; font-weight: 400; margin: 0; font-size: 8.5pt; color: #55555A; }
  .print-toc li li:not(:last-child)::after { content: "  ·  "; color: #999; }
  .print-toc li li a { color: #55555A; }
  .print-toc a { color: #1D1D1F; }
  .print-toc a::after { content: none !important; }
}
