/* The website (#379). Its colours are the app's tokens from src/index.css, light by default and dark only as a visitor's
 * choice, and it borrows the app's shape: white panels on a grey frame. The font is the app's, served by the site itself. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  /* Preloaded (site-layout.mjs), and used only if it is there in time: a font that arrives late would re-wrap the
   * page under the reader (#423), so that one view keeps the system font instead. */
  font-display: optional;
  font-weight: 100 900;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
}
:root {
  color-scheme: light;
  --bg: #f4f6f9; --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #eef2f6;
  --border: #e1e6ed; --border-strong: #cbd3de; --frame: #d9dfe7;
  --fg: #0b1220; --fg-muted: #3d495c; --fg-subtle: #4f5a6c;
  --accent: #1b68cb; --accent-strong: #1659b3; --accent-soft: #e5effc; --accent-fg: #ffffff; --ring: #3b82f6;
  --warning: #aa4f09; --warning-soft: #fdf1e1;
  --ink: #0b1220; --ink-fg: #eef2f7; --ink-muted: #b0bacb; --ink-line: #253041; --ink-accent: #6aa3f5;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 12px 32px rgb(15 23 42 / 0.1);
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --radius: 8px;
  --top: 64px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1117; --surface: #131922; --surface-2: #171e29; --surface-3: #1d2532;
  --border: #253041; --border-strong: #334155; --frame: #07090d;
  --fg: #eef2f7; --fg-muted: #b0bacb; --fg-subtle: #9ea8b9;
  --accent: #5092f0; --accent-strong: #6aa3f5; --accent-soft: #172a45; --accent-fg: #06101f; --ring: #60a5fa;
  --warning: #f5a524; --warning-soft: #2c210d;
  --ink: #07090d;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.4);
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Noto Sans", sans-serif; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 6px; z-index: 30; }
.skip:focus { left: 16px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
code { font-family: var(--mono); font-size: 0.875em; background: var(--surface-3); border-radius: 4px; padding: 0.12em 0.36em; overflow-wrap: anywhere; }
.muted { color: var(--fg-muted); font-size: 0.9rem; }
.logo-dark, .dark-only { display: none; }
[data-theme="dark"] .logo-light, [data-theme="dark"] .light-only { display: none; }
[data-theme="dark"] .logo-dark, [data-theme="dark"] .dark-only { display: block; }
.toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

/* Buttons */
.button { display: inline-block; background: var(--accent); color: var(--accent-fg); padding: 9px 16px; border: 1px solid var(--accent); border-radius: 6px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.button:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-fg); }
.button.small { padding: 6px 14px; font-size: 0.9rem; }
.button.large { padding: 12px 24px; }
.button.quiet { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.button.quiet:hover { background: var(--surface); color: var(--fg); border-color: var(--fg-subtle); }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.bar { max-width: 1400px; margin: 0 auto; padding: 0 24px; min-height: var(--top); display: flex; align-items: center; gap: 32px; }
.brand { display: block; flex: none; line-height: 0; }
.bar nav { flex: 1; }
.bar ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.bar nav a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--fg-muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.bar nav a:hover { color: var(--fg); background: var(--surface-3); }
.bar nav a[aria-current] { color: var(--accent-strong); }
.tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.theme { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--fg-muted); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.theme[hidden] { display: none; }
/* With scripts, the switch keeps its place until theme.js shows it, so the header doesn't move (#423). */
.js .theme[hidden] { display: grid; visibility: hidden; }
.theme:hover { color: var(--fg); background: var(--surface-3); }
.theme svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme .sun { display: none; }
[data-theme="dark"] .theme .sun { display: block; }
[data-theme="dark"] .theme .moon { display: none; }
.menu-button { display: none; }

/* Product pages */
.eyebrow { display: inline-block; margin: 0 0 20px; padding: 3px 10px; color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.lead { font-size: 1.2rem; line-height: 1.5; color: var(--fg-muted); max-width: 36em; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.hero { padding-top: 72px; }
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4rem); line-height: 1.05; letter-spacing: -0.03em; max-width: 13em; margin: 0 0 20px; }
.hero .small { color: var(--fg-subtle); font-size: 0.9rem; margin: 16px 0 0; }
.stage { margin-top: 56px; padding-bottom: 72px; background: linear-gradient(var(--bg) 0 34%, var(--frame) 34%); }
.stage .shot { margin: 0; }
/* The dark screenshot takes over only once it has loaded (theme.js marks it `ready`), so switching the theme never
 * shows an empty frame (#423); until then the light one stays. The frame has the app's surface while either loads. */
[data-theme="dark"] .stage img.light-only { display: block; }
.stage img.dark-only, [data-theme="dark"] .stage:has(img.dark-only.ready) img.light-only { display: none; }
[data-theme="dark"] .stage img.dark-only.ready { display: block; }
.stage img { display: block; width: 100%; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow); }
.stage figcaption { color: var(--fg-muted); font-size: 0.85rem; margin-top: 12px; }

.strengths { padding-top: 64px; padding-bottom: 8px; }
.strengths ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; list-style: none; margin: 0; padding: 0; }
.strengths li { margin: 0; color: var(--fg-muted); font-size: 0.95rem; }
.strengths li p { margin: 0; }
.strengths strong { display: block; margin-bottom: 4px; color: var(--fg); font-size: 1.05rem; }

.features { padding-top: 72px; padding-bottom: 88px; }
.features > h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); letter-spacing: -0.025em; margin: 0 0 48px; }
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 56px; align-items: center; padding: 32px 0; }
.feature:nth-of-type(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.feature:nth-of-type(even) .feature-text { order: 2; }
.feature h3 { font-size: 1.65rem; letter-spacing: -0.02em; margin: 0 0 12px; }
.feature p { color: var(--fg-muted); margin: 0 0 12px; font-size: 1.05rem; }
.more { font-weight: 600; text-decoration: none; }
.more::after { content: " →"; }
.more:hover { text-decoration: underline; }
.shot { margin: 24px 0; }
.shot img { display: block; border-radius: 6px; }
.prose .shot img { border: 1px solid var(--border); }
.prose figcaption { color: var(--fg-muted); font-size: 0.85rem; margin-top: 8px; }
.focus { margin: 0; padding: 12px; background: var(--frame); border-radius: 12px; }
.focus > div { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface); border-radius: 6px; }
.focus img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; object-fit: cover; object-position: var(--x) var(--y); transform: scale(var(--zoom)); transform-origin: var(--x) var(--y); }

.ink { background: var(--ink); color: var(--ink-fg); padding: 80px 0; }
.ink h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); letter-spacing: -0.025em; margin: 0 0 32px; }
.ink p { color: var(--ink-muted); max-width: 46em; }
.ink .table { background: none; border: 0; border-top: 1px solid var(--ink-line); border-radius: 0; margin: 0 0 24px; }
.ink th { background: none; color: var(--ink-muted); font-size: 0.85rem; font-weight: 600; }
.ink td, .ink th { border-color: var(--ink-line); padding: 14px 16px 14px 0; }
.ink td:first-child { color: var(--ink-fg); font-weight: 600; }
.ink td { color: var(--ink-muted); }
.ink code { background: #1d2532; color: var(--ink-fg); white-space: nowrap; }
.ink table { min-width: 680px; }

.switcher { padding: 80px 0; background: var(--surface); border-bottom: 1px solid var(--border); position: relative; }
.switcher h2 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); letter-spacing: -0.025em; margin: 0 0 24px; }
.switcher input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; font-size: 0.95rem; }
.tabs label { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 6px; color: var(--fg-muted); cursor: pointer; font-weight: 500; }
.tabs label:hover { background: var(--surface-3); color: var(--fg); }
.screens { padding: 12px; background: var(--frame); border-radius: 12px; }
.screen { display: none; }
.screen img { display: block; width: 100%; border-radius: 6px; }
#screen-downloads:checked ~ .screens .screen-downloads, #screen-details:checked ~ .screens .screen-details, #screen-add:checked ~ .screens .screen-add,
#screen-categories:checked ~ .screens .screen-categories, #screen-browser:checked ~ .screens .screen-browser, #screen-schedule:checked ~ .screens .screen-schedule,
#screen-guide:checked ~ .screens .screen-guide, #screen-get-started:checked ~ .screens .screen-get-started, #screen-dark:checked ~ .screens .screen-dark { display: block; }
#screen-downloads:checked ~ .tabs [for="screen-downloads"], #screen-details:checked ~ .tabs [for="screen-details"], #screen-add:checked ~ .tabs [for="screen-add"],
#screen-categories:checked ~ .tabs [for="screen-categories"], #screen-browser:checked ~ .tabs [for="screen-browser"], #screen-schedule:checked ~ .tabs [for="screen-schedule"],
#screen-guide:checked ~ .tabs [for="screen-guide"], #screen-get-started:checked ~ .tabs [for="screen-get-started"], #screen-dark:checked ~ .tabs [for="screen-dark"] { background: var(--accent-soft); color: var(--accent-strong); }
#screen-downloads:focus-visible ~ .tabs [for="screen-downloads"], #screen-details:focus-visible ~ .tabs [for="screen-details"], #screen-add:focus-visible ~ .tabs [for="screen-add"],
#screen-categories:focus-visible ~ .tabs [for="screen-categories"], #screen-browser:focus-visible ~ .tabs [for="screen-browser"], #screen-schedule:focus-visible ~ .tabs [for="screen-schedule"],
#screen-guide:focus-visible ~ .tabs [for="screen-guide"], #screen-get-started:focus-visible ~ .tabs [for="screen-get-started"], #screen-dark:focus-visible ~ .tabs [for="screen-dark"] { outline: 2px solid var(--ring); outline-offset: 2px; }
.switcher .muted { margin: 12px 0 0; }

.columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px; }
.columns h2 { font-size: 1.15rem; letter-spacing: -0.01em; margin: 0 0 8px; }
.columns p { color: var(--fg-muted); font-size: 0.975rem; margin: 0 0 8px; }
.promises { padding-top: 72px; padding-bottom: 72px; }

.closing { background: var(--frame); padding: 64px 0; }
.closing .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.closing h2 { font-size: clamp(1.7rem, 3vw, 2.25rem); letter-spacing: -0.025em; margin: 0 0 12px; }
.closing p { color: var(--fg-muted); margin: 0; }
.next-steps { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); }
.next-steps li { margin: 0; border-bottom: 1px solid var(--border); }
.next-steps li:last-child { border-bottom: 0; }
.next-steps a { display: block; padding: 16px 20px; color: var(--fg-muted); text-decoration: none; font-size: 0.95rem; }
.next-steps a:hover { background: var(--surface-2); }
.next-steps strong { display: block; color: var(--accent-strong); font-size: 1rem; }

.page-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 64px 0 56px; }
.page-head h1 { font-size: clamp(2.2rem, 4.4vw, 3.25rem); letter-spacing: -0.03em; margin: 0 0 12px; }
.band-gap { padding-top: 48px; padding-bottom: 80px; }

.files { list-style: none; margin: 0 0 24px; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.file { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0; padding: 24px; border-bottom: 1px solid var(--border); }
.file:last-child { border-bottom: 0; }
.file h2 { font-size: 1.2rem; margin: 0 0 4px; }
.file p { margin: 0; color: var(--fg-muted); }
.file .file-name { margin-top: 6px; color: var(--fg-subtle); font-family: var(--mono); font-size: 0.8rem; overflow-wrap: anywhere; }
.note { margin: 0 0 48px; padding: 14px 18px; background: var(--warning-soft); color: var(--fg); border-radius: var(--radius); }

.rows { padding-top: 16px; padding-bottom: 72px; }
.row { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 48px; padding: 40px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row h2 { font-size: 1.3rem; margin: 0; }
.row p, .row ul { margin: 0 0 12px; color: var(--fg-muted); max-width: 40em; }
.row li { margin: 6px 0; }
.row strong { color: var(--fg); }

.faq { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 3fr); gap: 64px; padding-top: 40px; padding-bottom: 80px; align-items: start; }
.answer { border-bottom: 1px solid var(--border); }
.question { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; cursor: pointer; list-style: none; }
.question::-webkit-details-marker { display: none; }
.question::after { content: "+"; color: var(--fg-subtle); font-size: 1.4rem; line-height: 1; }
.answer[open] .question::after { content: "−"; }
.question h2 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.answer p { margin: 0 0 20px; color: var(--fg-muted); max-width: 44em; }
.ask h2 { font-size: 1.05rem; margin: 18px 0 8px; }
.ask p { color: var(--fg-muted); margin: 0; font-size: 0.95rem; }

/* Documents */
/* "On this page" is the box at the top of a document, so its text and tables get the width (#422); only a screen
 * wide enough for both keeps it as a column on the right. */
.docs { max-width: 1400px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 56px; align-items: start; }
.docs > .toggle, .docs-button { display: none; }
.docs-side { position: sticky; top: var(--top); max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 28px 12px 40px 0; font-size: 0.925rem; }
.docs-side ul { list-style: none; margin: 0; padding: 0; }
.docs-side li { margin: 1px 0; }
.docs-side a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--fg-muted); text-decoration: none; line-height: 1.4; }
.docs-side a:hover { color: var(--fg); background: var(--surface-3); }
.docs-side a[aria-current] { color: var(--accent-strong); background: var(--accent-soft); font-weight: 600; }
.docs-side li.sub a { padding-left: 22px; font-size: 0.875rem; }
.nav-group { margin-bottom: 22px; }
.nav-group > p { margin: 0 0 6px; padding: 0 10px; color: var(--fg); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; }
.docs-side details { margin-top: 2px; }
.docs-side summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 6px; color: var(--fg); font-weight: 600; cursor: pointer; list-style: none; line-height: 1.35; }
.docs-side summary::-webkit-details-marker { display: none; }
.docs-side summary::after { content: "›"; color: var(--fg-subtle); font-size: 1.15rem; line-height: 1; }
.docs-side details[open] > summary::after { transform: rotate(90deg); }
.docs-side summary:hover { background: var(--surface-3); }
.docs-side details ul { padding: 2px 0 8px 8px; }

.search { margin: 0 0 16px; }
.search[hidden] { display: none; }
.search label { display: block; margin-bottom: 6px; padding: 0 11px; color: var(--fg); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; }
.search input { width: 100%; font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 6px; padding: 8px 10px; }
.search p { margin: 8px 2px 0; color: var(--fg-muted); font-size: 0.85rem; }
.search p:empty { display: none; }
.search ul { max-height: 50vh; overflow-y: auto; margin-top: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.search ul:empty { display: none; }
.search li { margin: 0; border-bottom: 1px solid var(--border); }
.search li:last-child { border-bottom: 0; }
.search li a { padding: 8px 10px 2px; color: var(--accent-strong); font-weight: 600; font-size: 0.875rem; }
.search li p { margin: 0; padding: 0 10px 8px; color: var(--fg-muted); font-size: 0.8rem; line-height: 1.4; }

.doc { min-width: 0; padding: 40px 0 72px; }
/* Text keeps a readable line; tables and code may use the whole column. */
.doc > :not(.prose), .prose > :not(.table):not(pre) { max-width: 760px; }
.toc { display: none; position: sticky; top: var(--top); max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 44px 0 32px; font-size: 0.85rem; }
.toc p, .toc-title { margin: 0 0 8px; color: var(--fg); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; }
.toc ul, .toc-small ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 4px 0 4px 12px; color: var(--fg-muted); text-decoration: none; line-height: 1.35; border-left: 1px solid var(--border-strong); }
.toc a:hover { color: var(--accent-strong); border-left-color: var(--accent); }
.toc li.sub a { padding-left: 24px; }
.toc-small { display: block; margin-bottom: 24px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; }
.toc-small summary { margin: 0; cursor: pointer; }
.toc-small ul { margin-top: 8px; }
.toc-small li { margin: 4px 0; }
.toc-small li.sub { padding-left: 14px; }
.toc-small a { text-decoration: none; }
@media (min-width: 1600px) {
  .docs { max-width: 1680px; }
  .docs:has(.toc) { grid-template-columns: 272px minmax(0, 1fr) 216px; }
  .toc { display: block; }
  .toc-small { display: none; }
}

.prose { font-size: 1.0313rem; line-height: 1.72; }
.prose h1 { font-size: clamp(2rem, 3.6vw, 2.5rem); letter-spacing: -0.025em; margin: 0 0 20px; }
.prose h2 { font-size: 1.5rem; margin: 52px 0 12px; padding-top: 28px; border-top: 1px solid var(--border); }
.prose h3 { font-size: 1.175rem; margin: 36px 0 8px; }
.prose h4 { font-size: 1rem; margin: 24px 0 6px; }
.prose p, .prose ul, .prose ol { margin: 14px 0; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 6px 0; }
.prose li > p { margin: 0; }
.prose li::marker { color: var(--fg-subtle); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }
.prose img { border-radius: 6px; }
.prose a { overflow-wrap: anywhere; }
.prose pre { margin: 18px 0; padding: 14px 18px; background: var(--ink); color: var(--ink-fg); border-radius: var(--radius); overflow-x: auto; font-size: 0.875rem; line-height: 1.6; }
.prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; overflow-wrap: normal; }
.prose blockquote { margin: 20px 0; padding: 12px 18px; background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; }
.prose blockquote p { margin: 6px 0; }
.table { margin: 20px 0; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.925rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: 0; }
th { background: var(--surface-2); font-weight: 600; white-space: nowrap; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.pager a { display: block; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--accent-strong); text-decoration: none; font-weight: 600; line-height: 1.35; }
.pager a:hover { border-color: var(--accent); }
.pager a[rel="next"] { text-align: right; grid-column: 2; }
.pager small { display: block; margin-bottom: 2px; color: var(--fg-subtle); font-size: 0.8rem; font-weight: 500; }
.topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; margin-top: 40px; }
.topics section { padding: 18px 0; border-top: 1px solid var(--border); }
.prose .topics h2 { font-size: 1rem; letter-spacing: -0.005em; margin: 0 0 6px; padding: 0; border: 0; }
.topics ul { list-style: none; margin: 0; padding: 0; font-size: 0.925rem; }
.topics li { margin: 3px 0; }

/* Footer */
.foot { background: var(--surface); border-top: 1px solid var(--border); font-size: 0.925rem; }
.foot .wrap { max-width: 1400px; }
.foot .wrap:first-child { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: 32px; padding-top: 48px; padding-bottom: 32px; }
.foot-brand a { display: inline-block; line-height: 0; }
.foot-brand p { margin: 12px 0 0; color: var(--fg-muted); max-width: 18em; }
.foot h2 { margin: 0 0 10px; font-size: 0.85rem; letter-spacing: 0; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 6px 0; }
.foot li a { color: var(--fg-muted); text-decoration: none; }
.foot li a:hover { color: var(--accent-strong); text-decoration: underline; }
.legal { padding-top: 16px; padding-bottom: 24px; border-top: 1px solid var(--border); }
.legal p { margin: 0; color: var(--fg-subtle); font-size: 0.85rem; }

/* Narrower screens */
@media (max-width: 1180px) {
  .docs { grid-template-columns: 248px minmax(0, 1fr); gap: 40px; }
}
@media (max-width: 900px) {
  .bar { flex-wrap: wrap; gap: 8px 12px; padding: 0 16px; }
  .wrap { padding: 0 16px; }
  .menu-button { order: 2; display: inline-flex; align-items: center; padding: 10px 8px; border-radius: 6px; color: var(--fg); font-size: 0; cursor: pointer; }
  .menu-button span, .menu-button span::before, .menu-button span::after { display: block; width: 16px; height: 2px; background: currentColor; border-radius: 1px; }
  .menu-button span { position: relative; }
  .menu-button span::before, .menu-button span::after { content: ""; position: absolute; left: 0; }
  .menu-button span::before { top: -5px; }
  .menu-button span::after { top: 5px; }
  .toggle:focus-visible + .menu-button, .toggle:focus-visible + .docs-button { outline: 2px solid var(--ring); outline-offset: 2px; }
  .tools { order: 1; }
  .bar nav { margin: 0; }
  .bar nav { order: 3; display: none; flex-basis: 100%; padding-bottom: 12px; }
  #menu:checked ~ nav { display: block; }
  .bar ul { flex-direction: column; }
  .bar nav a { padding: 10px 12px; }
  .hero { padding-top: 48px; }
  .stage { margin-top: 40px; padding-bottom: 40px; }
  .strengths ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .strengths { padding-top: 48px; }
  .features { padding-top: 56px; padding-bottom: 56px; }
  .ink, .switcher { padding: 56px 0; }
  .feature, .feature:nth-of-type(even) { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .feature:nth-of-type(even) .feature-text { order: 0; }
  .columns { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .closing .wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 28px 0; }
  .faq { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .foot .wrap:first-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }

  .docs { display: block; padding: 0 16px; }
  .docs-button { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-weight: 600; font-size: 0.925rem; cursor: pointer; }
  .docs-button::after { content: "›"; color: var(--fg-subtle); font-size: 1.15rem; line-height: 1; transform: rotate(90deg); }
  .docs-side { display: none; position: static; max-height: none; margin-top: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
  #docs-menu:checked ~ .docs-side { display: block; }
  .doc { padding-top: 24px; max-width: none; }
  /* On a phone or tablet a table is as wide as its cells need, each at most a readable width that fits the screen,
   * and scrolls in its box, rather than squeezing every column into a few words a line (#422). */
  .prose table { width: max-content; min-width: 100%; }
  .prose th, .prose td { max-width: min(30em, 80vw); }
}
@media (max-width: 540px) {
  .strengths ul { grid-template-columns: minmax(0, 1fr); }
  .file { flex-direction: column; align-items: flex-start; }
  .topics { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager a[rel="next"] { grid-column: 1; }
  .actions .button { flex: 1; text-align: center; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
