@font-face {
  font-family: "Lora Fallback";
  src: local("Georgia"), local("Times New Roman"), local("Liberation Serif");
  ascent-override: 100.60%;
  descent-override: 27.40%;
  line-gap-override: 0.00%;
  size-adjust: 105.99%;
}


@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/lora-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/lora-latin-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/lora-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/lora-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/lora-latin-600-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/lora-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/lora-latin-700-italic.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/caveat-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/caveat-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/inter-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/inter-latin-700-normal.woff2") format("woff2");
}

.jot-demo-out {
  --jot-color-notebook-paper: #fcf8f2;
  --jot-color-notebook-paper-elevated: #f5ead8;
  --jot-color-notebook-rule-lines: #e4d5be;
  --jot-color-notebook-margin-line: #e8beb4;
  --jot-color-notebook-ink: #2c2523;
  --jot-color-notebook-ink-muted: #73685e;
  --jot-color-notebook-ink-light: #8a7a6c;
  --jot-color-doc-viewport: #f3f4f6;
  --jot-color-doc-sheet: #ffffff;
  --jot-color-doc-sheet-border: #e5e7eb;
  --jot-color-doc-ink: #111827;
  --jot-color-doc-ink-muted: #4b5563;
  --jot-color-accent-terracotta: #c67139;
  --jot-color-accent-terracotta-light: #d27b42;
  --jot-color-accent-terracotta-pale: #ffdbc8;
  --jot-color-accent-slate-blue: #436475;
  --jot-color-accent-slate-blue-light: #294b5b;
  --jot-color-accent-sage: #5e8259;
  --jot-color-accent-sage-light: #759a6f;
  --jot-color-accent-sepia: #8b634b;
  --jot-color-syntax-directive: #c67139;
  --jot-color-syntax-data: #436475;
  --jot-color-syntax-structural: #73685e;
  --jot-color-syntax-marginalia: #8b634b;
  --jot-color-syntax-string: #aad1a2;
  --jot-color-syntax-comment: #73685e;
  --jot-type-headline-family: Lora;
  --jot-type-headline-xl-size: 36px;
  --jot-type-headline-xl-line-height: 44px;
  --jot-type-headline-xl-weight: 600;
  --jot-type-headline-xl-letter-spacing: -0.02em;
  --jot-type-headline-lg-size: 28px;
  --jot-type-headline-lg-line-height: 36px;
  --jot-type-headline-lg-weight: 600;
  --jot-type-headline-lg-letter-spacing: -0.015em;
  --jot-type-headline-md-size: 22px;
  --jot-type-headline-md-line-height: 28px;
  --jot-type-headline-md-weight: 500;
  --jot-type-headline-md-letter-spacing: -0.01em;
  --jot-type-headline-sm-size: 18px;
  --jot-type-headline-sm-line-height: 24px;
  --jot-type-headline-sm-weight: 500;
  --jot-type-body-family: Lora;
  --jot-type-body-lg-size: 16px;
  --jot-type-body-lg-line-height: 28px;
  --jot-type-body-lg-weight: 400;
  --jot-type-body-md-size: 14px;
  --jot-type-body-md-line-height: 24px;
  --jot-type-body-md-weight: 400;
  --jot-type-code-family: IBM Plex Mono;
  --jot-type-code-md-size: 13px;
  --jot-type-code-md-line-height: 20px;
  --jot-type-code-md-weight: 400;
  --jot-type-code-sm-size: 11px;
  --jot-type-code-sm-line-height: 16px;
  --jot-type-code-sm-weight: 500;
  --jot-type-margin-family: Caveat;
  --jot-type-margin-md-size: 18px;
  --jot-type-margin-md-line-height: 22px;
  --jot-type-margin-md-weight: 600;
  --jot-type-label-family: Inter;
  --jot-type-label-md-size: 12px;
  --jot-type-label-md-line-height: 16px;
  --jot-type-label-md-weight: 500;
  --jot-type-label-md-letter-spacing: 0.02em;
  --jot-type-label-sm-size: 10px;
  --jot-type-label-sm-line-height: 14px;
  --jot-type-label-sm-weight: 600;
  --jot-type-label-sm-letter-spacing: 0.05em;
  --jot-space-baseline-grid: 28px;
  --jot-space-gutter: 1.5rem;
  --jot-space-margin: 2rem;
  --jot-space-xs: 0.25rem;
  --jot-space-sm: 0.5rem;
  --jot-space-md: 1rem;
  --jot-space-lg: 1.5rem;
  --jot-space-xl: 2.5rem;
  --jot-shape-border-radius-sm: 2px;
  --jot-shape-border-radius-base: 4px;
  --jot-shape-border-radius-md: 6px;
  --jot-shape-border-radius-lg: 8px;
  --jot-shape-border-radius-full: 9999px;
  --jot-shape-elevation-card: 2px 2px 0px #e4d5be;
  --jot-shape-elevation-card-fact: 2px 2px 0px #d27b42;
  --jot-shape-elevation-doc-sheet: 0 1px 3px 0 rgba(0,0,0,0.04), 0 1px 2px -1px rgba(0,0,0,0.02);
  --jot-shape-elevation-modal: 0 12px 24px -4px rgba(0,0,0,0.35);
  --jot-shape-connectors-width: 1.5px;
  --jot-shape-connectors-color: #436475;
  --jot-shape-connectors-dash-array: 3,3;
  --jot-shape-connectors-junction-dot: 2.5px;
  --jot-shape-connectors-corner-fillet: 4px;
  --jot-layout-main-column-ratio: 0.77;
  --jot-layout-margin-channel-ratio: 0.23;
  --jot-layout-max-content-width: 681.7px;
  --jot-layout-left-margin-line-x: 32px;
  --jot-layout-margin-tick-dot-radius: 3px;
  --jot-layout-margin-tick-line-width: 1.5px;
  --jot-layout-margin-tick-color: #c67139;
  --jot-font-body: "Lora", "Lora Fallback", Georgia, "Times New Roman", serif;
  --jot-font-heading: "Lora", "Lora Fallback", Georgia, "Times New Roman", serif;
  --jot-font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --jot-font-margin: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --jot-font-label: "Inter", system-ui, "Segoe UI", sans-serif;
  --jot-rhythm: var(--jot-space-baseline-grid);
  --jot-accent: var(--jot-color-accent-terracotta);
}

.jot-demo-out[data-mode="notebook"] {
  --jot-surface: var(--jot-color-notebook-paper);
  --jot-surface-elevated: var(--jot-color-notebook-paper-elevated);
  --jot-rule: var(--jot-color-notebook-rule-lines);
  --jot-ink: var(--jot-color-notebook-ink);
  --jot-ink-muted: var(--jot-color-notebook-ink-muted);
  --jot-card-shadow: var(--jot-shape-elevation-card);
}

.jot-demo-out[data-mode="doc"] {
  --jot-surface: var(--jot-color-doc-sheet);
  --jot-surface-elevated: var(--jot-color-doc-sheet);
  --jot-rule: transparent;
  --jot-ink: var(--jot-color-doc-ink);
  --jot-ink-muted: var(--jot-color-doc-ink-muted);
  --jot-card-shadow: none;
}

.jot-demo-out {
  background: var(--jot-surface);
  color: var(--jot-ink);
  font-family: var(--jot-font-body);
  font-size: 16px;
  line-height: var(--jot-rhythm);
}
/* ── Page frame ─────────────────────────────────────────────────────── */
/* ── How a host sizes a document (UX-36, and the exception to it) ─────── */
/* The fit used to be written out in each of the five hosts, which is why
   hosts.test.ts exists: three of them had quietly redefined it. It lives here
   now, and a host writes zoom: var(--jot-fit) over a wrapper carrying
   container-name: jot-host.

   Above the reflow threshold this is exactly the old contract: a whole A4
   sheet, fitted to the column, never magnified past 1:1. Below it the sheet is
   given up rather than shrunk into illegibility — a phone at 375px was fitting
   it at 0.40, which is body text at 6.4px. */
.jot-demo-out { --jot-fit: min(1, calc(100cqw / 793.7px)); }


.jot-demo-out .jot-doc {
  --jot-rule-offset: 19.856px;
  /* Exactly an A4 page's printable width (ARC-14), so anything that fits on
     screen fits on paper. The number is derived from the paper size in
     page.ts, not typed here. */
  max-width: 681.7px;
  box-sizing: content-box;
  margin: 0 auto;
  padding: 28px 0;
  /* Named so the fold below can ask how wide the PAGE is, rather than how
     wide the window is. See the note at the bottom of this file. */
  container-type: inline-size;
  container-name: jot-page;
}

@container jot-host (max-width: 679px) {
  /* --jot-reflow tells the pagination to leave the document as one column. */
  .jot-demo-out { --jot-fit: 1; --jot-reflow: 1; }
  /* The document takes the room it has. Everything else — the 28px row, 16px
     body text, the figures fitting their container — is unchanged, because
     none of it was ever a function of the page's width. */
  .jot-demo-out .jot-doc { max-width: 100%; }
}
/* ── Pages on screen (UX-73) ────────────────────────────────────────── */
/* Laid out by paginate() in pages.ts, which marks the document data-paged and
   deals its rows onto sheets. A sheet is a real A4 page: the paper, its
   margins, and a window exactly as many rows tall as the page holds. A row
   that carries on to the next sheet is in both, and each window shows its
   own part — whole rows, so a break always falls between two lines. */
.jot-demo-out[data-paged] { padding: 28px 0; }
.jot-demo-out[data-mode="notebook"][data-paged] { background: var(--jot-desk, transparent); }
.jot-demo-out .jot-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.jot-demo-out .jot-sheet {
  flex: none;
  box-sizing: border-box;
  width: 793.7007874015749px;
  height: 1122.5196850393702px;
  padding: 57.25px 56px;
  background: var(--jot-surface);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.16);
}
.jot-demo-out[data-mode="doc"] .jot-sheet {
  border: 1px solid var(--jot-color-doc-sheet-border);
  box-shadow: var(--jot-shape-elevation-doc-sheet);
}
/* A landscape sheet is drawn at the width of a portrait one beside it, so the
   column of pages stays one width; it prints full size. */
.jot-demo-out .jot-sheet[data-orient="landscape"] {
  width: 1122.5196850393702px;
  height: 793.7007874015749px;
  zoom: 0.7071;
}
.jot-demo-out[data-paged] .jot-sheet > .jot-doc {
  position: relative;
  max-width: none;
  height: 1008px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.jot-demo-out[data-paged] .jot-sheet[data-orient="landscape"] > .jot-doc { height: 672px; }

/* One row per block: the block beside its margin notes. Rows are separate
   elements rather than cells of one document-wide grid because print needs
   them to be. A browser honours a named page — the landscape sheet — only on
   a block in normal flow; tested on a grid item, it turned the WHOLE FIRST
   PAGE landscape and isolated nothing. Every row uses identical tracks, so
   the two columns still line up down the page exactly as one grid did. */
.jot-demo-out .jot-row {
  display: grid;
  /* The 'fr' unit is written here rather than taken from the custom property,
     and that is not a style choice. The ratio tokens are unitless numbers, so
     the var expanded to 'grid-template-columns: 0.77 0.23' — invalid, silently
     dropped by every browser, and the two columns had been auto-sizing at
     roughly 50/50 ever since instead of 77/23. calc(0.77 * 1fr) is rejected
     too, so the ratio is interpolated from the token at build time.
     minmax(0, …) lets a wide block shrink inside its column rather than force
     the track wider and shove the margin channel off the page. */
  grid-template-columns:
    minmax(0, 0.77fr)
    minmax(0, 0.23fr);
  column-gap: 28px;
  align-items: start;
}

/* The body column carries the ruling. Painted at the baseline offset so text
   sits ON the rule; the period is one row so the phase can never slip. */
.jot-demo-out[data-mode="notebook"] .jot-body {
  background-image: repeating-linear-gradient(
    to bottom,
    var(--jot-rule) 0,
    var(--jot-rule) 1px,
    transparent 1px,
    transparent 28px
  );
  background-position: 0 calc(var(--jot-rule-offset) - 1px);
}
.jot-demo-out[data-mode="doc"] .jot-body { background-image: none; }
/* A drawn block clears the ruling — all of it, not just the part under its own
   box. Painting the figure's own background over the rules left them running
   down either side of it, so a diagram narrower than the page looked like it
   had been dropped onto a ruled sheet rather than drawn on one. */
.jot-demo-out[data-mode="notebook"] .jot-body:has(> .jot-figure) { background-image: none; }

/* ── Doc mode ───────────────────────────────────────────────────────── */
/* Doc mode is not "notebook with the rules switched off" — that reads as a
   generic web page and makes writing .jot look pointless. It is the same
   document in an editorial register: a white sheet on a grey backing, hairline
   rules instead of filled cards, quieter labels. The STRUCTURE still shows —
   a card is still a card, a metric is still prominent — because that structure
   is what the author wrote, and it is the reason to use the tool at all.
   The grid is unchanged; only the surface treatment differs. */
.jot-demo-out[data-mode="doc"] {
  background: var(--jot-color-doc-viewport);
  padding: 28px 0;
}
.jot-demo-out[data-mode="doc"] .jot-doc {
  background: var(--jot-color-doc-sheet);
  border: 1px solid var(--jot-color-doc-sheet-border);
  box-shadow: var(--jot-shape-elevation-doc-sheet);
  padding: 56px 56px;
  border-radius: 2px;
}
/* Cards lose their fill and keep a single hairline: on a white sheet a filled
   panel reads as a UI widget, not as part of a document. */
.jot-demo-out[data-mode="doc"] .jot-card {
  background: none;
  border: 0;
  border-top: 1px solid var(--jot-color-doc-sheet-border);
  border-radius: 0;
  /* One border plus 13 + 14 padding is exactly one row. Redesigning the chrome
     for doc mode without redoing this arithmetic is what broke it the first
     time — every surface treatment has to satisfy the same row contract. */
  padding: 13px 0 14px;
}
.jot-demo-out[data-mode="doc"] .jot-card[data-alert="true"] {
  border-top-color: var(--jot-color-accent-terracotta);
}
.jot-demo-out[data-mode="doc"] .jot-card .jot-card-kicker {
  color: var(--jot-color-doc-ink-muted);
}
/* Written with the attribute selector so it outranks `.jot-badge[data-alert]`,
   which otherwise kept its pink pill in doc mode and collided with the dash. */
.jot-demo-out[data-mode="doc"] .jot-badge,
.jot-demo-out[data-mode="doc"] .jot-badge[data-alert="true"] {
  background: none;
  padding: 0;
  margin-left: 7px;
  color: var(--jot-color-doc-ink-muted);
}
.jot-demo-out[data-mode="doc"] .jot-badge[data-alert="true"] { color: var(--jot-color-accent-terracotta); }
.jot-demo-out[data-mode="doc"] .jot-callout,
.jot-demo-out[data-mode="doc"] .jot-body pre {
  background: none;
  border: 0;
  border-left: 2px solid var(--jot-color-doc-sheet-border);
  border-radius: 0;
  /* No horizontal borders here, so the padding alone carries the row. */
  padding: 14px 0 14px 26px;
}
.jot-demo-out[data-mode="doc"] .jot-body table th { color: var(--jot-color-doc-ink-muted); }
.jot-demo-out[data-mode="doc"] .jot-chip-key { color: var(--jot-color-doc-ink-muted); }
.jot-demo-out[data-mode="doc"] .jot-nested .jot-card { border-top-style: dotted; }

/* Margin notes become true sidenotes: still in the margin, still the author's
   aside, but set in the body face rather than handwriting, because handwriting
   on a printed sheet reads as a mistake. */
.jot-demo-out[data-mode="doc"] .jot-note::before { display: none; }
.jot-demo-out[data-mode="doc"] .jot-note {
  padding-left: 0;
  border-left: 1px solid var(--jot-color-doc-sheet-border);
  padding-inline-start: 14px;
  color: var(--jot-color-doc-ink-muted);
}

.jot-demo-out .jot-body { grid-column: 1; min-width: 0; }
.jot-demo-out .jot-aside { grid-column: 2; min-width: 0; }
/* A block with nothing beside it takes the whole width.
   The channel is room for a note, not a permanent indent. Reserving it on
   every block left prose and headings stopping short of the page for no
   reason the reader could see. Write a note and the text makes room for it,
   which is the only time the narrower column means anything. */
.jot-demo-out .jot-row:has(> .jot-aside:empty) > .jot-body { grid-column: 1 / -1; }

/* Deterministic vertical rhythm.
   `flow-root` stops child margins collapsing out of the cell: without it a
   block's spacing depends on what happens to sit next to it, gaps come out as
   0/28/36/56px instead of a consistent row, and the phase drifts permanently
   the first time a non-multiple appears. Containing the margins makes every
   cell's height = content + its own margins, both of which are row multiples,
   so the phase cannot slip no matter how long the document is. */
.jot-demo-out .jot-body { display: flow-root; }
.jot-demo-out .jot-body > * { margin-top: 0; margin-bottom: 28px; }
/* The margin channel needs the same discipline. A grid row is as tall as its
   TALLEST cell, so a note left on browser-default paragraph margins sets the row
   height to a non-multiple and pushes everything below it off the ruling — even
   when every block in the main column is perfectly sized. */
.jot-demo-out .jot-aside { display: flow-root; }
.jot-demo-out .jot-aside > * { margin-top: 0; margin-bottom: 28px; }

/* Contextual spacing. A uniform gap after every block reads as double-spacing:
   a run of quotes gets a blank line between each, and a horizontal rule costs
   three rows — the previous block's margin, its own row, and its own margin.
   These exceptions stay whole-row, so the phase is unaffected. */
.jot-demo-out .jot-body[data-kind="divider"] > * { margin-bottom: 0; }
.jot-demo-out .jot-row:has(> .jot-body[data-kind="quote"]):has(> .jot-aside:empty) + .jot-row > .jot-body[data-kind="quote"] > *,
.jot-demo-out .jot-row:has(> .jot-body[data-kind="list"]):has(> .jot-aside:empty) + .jot-row > .jot-body[data-kind="list"] > *,
.jot-demo-out .jot-row:has(> .jot-body[data-primitive="sticky"]):has(> .jot-aside:empty) + .jot-row > .jot-body[data-primitive="sticky"] > * { margin-top: 0; }
.jot-demo-out .jot-row:has(> .jot-aside:empty):has(+ .jot-row > .jot-body[data-kind="quote"]) > .jot-body[data-kind="quote"] > * { margin-bottom: 0; }
/* @meta sits tight under the title it describes. */
.jot-demo-out .jot-body[data-primitive="meta"] > * { margin-bottom: 28px; }
/* A trailing margin inside a container would escape the row maths. */
.jot-demo-out .jot-quote > :last-child,
.jot-demo-out .jot-card > :last-child,
.jot-demo-out .jot-body li > :last-child { margin-bottom: 0; }
/* Clearance around a drawn block is ONE ROW BELOW, not half a row on each side.
   Half-and-half was designed for inline flow; every block is now its own grid
   cell, so the gap between two blocks is already the sum of one block's bottom
   margin and nothing else. It also survives the first-child margin reset, which
   zeroes margin-top and used to leave the first card half a row short. */
.jot-demo-out .jot-body > .jot-card,
.jot-demo-out .jot-body > .jot-columns,
.jot-demo-out .jot-body > .jot-callout { margin: 0 0 28px; }

/* ── Text on the grid ───────────────────────────────────────────────── */
/* Every one of these is a whole number of rows. The token line-heights are
   deliberately overridden: grid discipline outranks the type scale, because a
   36px line-height in a 28px grid desynchronises the whole page. */
.jot-demo-out .jot-body p,
.jot-demo-out .jot-body li,
.jot-demo-out .jot-body blockquote p {
  margin: 0;
  line-height: 28px;
  font-size: 16px;
}
/* A blank line between two paragraphs is a row of space (UX-71). The rule
   above zeroes every paragraph's margin, and it outranks the row each block
   gets below it, so a blank line used to show as nothing at all: two
   paragraphs read as one that happened to break. Only between two PLAIN
   paragraphs — a card's kicker and title, a cover's title and subtitle, a
   column's heading are paragraphs too, with a class, and stay tight. */
.jot-demo-out .jot-body p:not([class]) + p:not([class]) { margin-top: 28px; }
/* …and a block of prose gets the row below it that every other block gets.
   The same zeroing rule took it away, so a card, a table or a diagram written
   after a paragraph sat directly under its last line, and a heading after one
   got half the space it gets after anything else. */
.jot-demo-out .jot-body > p:not([class]):last-child { margin-bottom: 28px; }


/* ── Headings: six levels, six looks ────────────────────────────────── */
/* There were three. Levels 4, 5 and 6 carried .jot-h3 and came out identical
   to it in size, weight and everything else, which makes @h4 and @h5
   decoration rather than structure — if the language offers six levels they
   have to be six visibly different things, or it should not offer six.

   Below level 3 the sizes run out: 22, 18, and then there is nowhere to go
   that is still readable. So the last two carry their rank with WEIGHT and
   case instead of size — h5 sits at body size and is heavier than the prose
   around it, h6 is a small label. That is how a type scale normally bottoms
   out, and it keeps every level on the 28px grid. */
.jot-demo-out .jot-h1,
.jot-demo-out .jot-h2,
.jot-demo-out .jot-h3,
.jot-demo-out .jot-h4,
.jot-demo-out .jot-h5,
.jot-demo-out .jot-h6 {
  font-family: var(--jot-font-heading);
  color: var(--jot-ink);
  margin-top: 28px;
  font-weight: 600;
}
.jot-demo-out .jot-h1 { font-size: 36px; line-height: 56px; letter-spacing: -0.02em; padding-top: 6.68px; margin-bottom: 21.32px; }
.jot-demo-out .jot-h2 { font-size: 28px; line-height: 56px; letter-spacing: -0.015em; padding-top: 9.608px; margin-bottom: 18.392px; }
.jot-demo-out .jot-h3 { font-size: 22px; line-height: 28px; letter-spacing: -0.01em; padding-top: 25.804px; margin-bottom: 2.196px; }
.jot-demo-out .jot-h4 { font-size: 18px; line-height: 28px; padding-top: 27.268px; margin-bottom: 0.732px; }
/* Body size, but heavier than the prose it introduces — a run-in heading. */
.jot-demo-out .jot-h5 { font-size: 16px; line-height: 28px; font-weight: 700; padding-top: 0px; margin-bottom: 28px; }
/* The bottom of the scale is a label, not a smaller heading. */
.jot-demo-out .jot-h6 {
  font-family: var(--jot-font-label);
  font-size: 12px;
  line-height: 28px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--jot-ink-muted);
}
.jot-demo-out .jot-doc > .jot-row:first-child > .jot-body > :first-child { margin-top: 0; }

/* Bold is one step heavier than whatever it is inside, so it has to sit above
   the 600 the document already uses for emphasis-by-role — a heading, a pill,
   a table header, a timeline event. At 600 it was a no-op in every one of
   those: correct markup, correct stylesheet, identical glyphs. Applied inside
   figures too, which is where it was noticed, because .jot-figure lives in
   .jot-body and a figure's labels are exactly the 600 text this is about. */
.jot-demo-out .jot-body strong,
.jot-demo-out .jot-body b { font-weight: 700; }
/* `==highlight==`. Like inline code, its box is capped below the line strut so
   a highlighted phrase cannot stretch the row it sits in. */
.jot-demo-out .jot-body mark {
  background: linear-gradient(transparent 12%, var(--jot-color-accent-terracotta-pale) 12%, var(--jot-color-accent-terracotta-pale) 88%, transparent 88%);
  color: inherit;
  padding: 0 2px;
  line-height: 20px;
}
.jot-demo-out[data-mode="doc"] .jot-body mark {
  background: var(--jot-color-accent-terracotta-pale);
}
.jot-demo-out .jot-body em { font-style: italic; }
.jot-demo-out .jot-body a { color: var(--jot-accent); text-underline-offset: 3px; }
.jot-demo-out .jot-body code {
  font-family: var(--jot-font-mono);
  font-size: 13px;
  background: var(--jot-surface-elevated);
  border-radius: var(--jot-shape-border-radius-sm);
  padding: 0 4px;
  /* An inline box taller than the line's strut GROWS the line. The mono face at
     13px inheriting a 28px line-height did exactly that: every line
     containing inline code became 30px, so a paragraph mentioning a filename
     drifted 2px per line. Capping it below the strut keeps the row at 28px
     while leaving the highlight tall enough to read as a token. */
  line-height: 20px;
}

/* ── Fenced code ────────────────────────────────────────────────────── */
/* A drawn block like any other: it clears the ruling and its chrome totals one
   row. Code lines get a full 28px each rather than the token's 20px, because
   a 20px line inside a 28px grid desynchronises everything below it. The
   size is nudged up to suit the looser leading. */
.jot-demo-out .jot-body pre {
  background: var(--jot-surface-elevated);
  border: 1px solid var(--jot-rule);
  border-radius: var(--jot-shape-border-radius-base);
  padding: 13px 18px;
  /* Wrap rather than scroll. `overflow-x: auto` adds a ~15px horizontal
     scrollbar when a line is long, which is not a row multiple and knocks
     everything below it off the ruling. Wrapping keeps every line 28px. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.jot-demo-out .jot-body pre code {
  background: none;
  border-radius: 0;
  padding: 0;
  font-size: 15px;
  line-height: 28px;
  display: block;
}

/* ── Markdown tables ────────────────────────────────────────────────── */
/* `.jot` has no pipe-table syntax of its own, but a pasted .md file may well
   contain one, and the superset promise covers it. Collapsed borders and zero
   vertical padding keep each row a whole number of 28px lines; the header
   underline is an inset shadow rather than a border so it costs no height. */
.jot-demo-out .jot-body table {
  border-collapse: collapse;
  width: 100%;
  font-size: 16px;
}
.jot-demo-out .jot-body th,
.jot-demo-out .jot-body td {
  padding: 0 14px 0 0;
  line-height: 28px;
  vertical-align: top;
  text-align: left;
  border: 0;
}
.jot-demo-out .jot-body thead th {
  font-family: var(--jot-font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--jot-ink-muted);
  box-shadow: inset 0 -1px 0 var(--jot-rule);
}

/* ── Lists ──────────────────────────────────────────────────────────── */
.jot-demo-out .jot-body ul,
.jot-demo-out .jot-body ol { padding-left: 28px; }
.jot-demo-out .jot-body ul ul,
.jot-demo-out .jot-body ol ol,
.jot-demo-out .jot-body ul ol,
.jot-demo-out .jot-body ol ul { margin-bottom: 0; }
.jot-demo-out .jot-body li::marker { color: var(--jot-accent); }
/* A block under a list item (UX-65) sits a row clear of the point above it,
   like a block inside a card, and the next point waits a row below it. This
   comes after the rule that zeroes a last child's margin, and outranks it by
   source order: the margin collapses out through the item and any sub-list,
   so the gap is one row however deep the block sits, and at the end of the
   list it merges with the list's own. */
.jot-demo-out .jot-body li > .jot-nested { margin-bottom: 28px; }
/* And a drawn block there clears the ruling across the whole row, the list's
   indent included, the way one on the page does (UX-40): otherwise the rules
   ran up to its left edge and on past its right. The wrapper paints paper under
   itself, and its shadow is a copy of itself moved back to the page's edge —
   one list level (one row) per --jot-depth. A table is left out on purpose:
   it sits ON the ruling, which draws its row lines (UX-41). */
.jot-demo-out[data-mode="notebook"] .jot-body li > .jot-nested:has(> .jot-figure, > .jot-card, > .jot-callout) {
  background: var(--jot-surface);
  box-shadow: calc(var(--jot-depth, 1) * -28px) 0 0 var(--jot-surface);
}

/* ── The host's defaults stop at the paper ──────────────────────────── */
/* The theme is careful never to restyle its host. The converse has to be true
   as well, and was not: a host may inject element defaults into the page the
   document is embedded in, and VS Code gives every webview a stylesheet with
   blockquote, table and link rules in the EDITOR's colours.

   A quote came out as a dark grey box on cream paper because of it — our quote
   rule set a border and a colour and never a background, so the editor's
   blockquote background won by default. Nothing was wrong with the markup or
   with any rule we had written; the gap WAS the rule we had not written.

   So the document declares its own value for anything a host is likely to
   claim, rather than relying on it to leave the element alone. */
.jot-demo-out .jot-quote,
.jot-demo-out .jot-body blockquote,
.jot-demo-out .jot-body table,
.jot-demo-out .jot-body kbd,
.jot-demo-out .jot-body figure { background: none; }

/* ── Quote ──────────────────────────────────────────────────────────── */
.jot-demo-out .jot-quote {
  padding-left: 27px;
  border-left: 1px solid var(--jot-accent);
  font-style: italic;
  color: var(--jot-ink-muted);
}
.jot-demo-out .jot-quote cite {
  display: block;
  font-family: var(--jot-font-label);
  font-size: 12px;
  font-style: normal;
  line-height: 28px;
  color: var(--jot-ink-muted);
}

/* ── Divider ────────────────────────────────────────────────────────── */
/* A full-width line drawn ON a ruled line is invisible by construction — it
   just makes one rule slightly darker. A section break has to read as
   deliberate, so it is a SHORT CENTRED mark instead: clearly not part of the
   ruling, while still sitting on the grid. The schema offers three styles and
   all three are implemented rather than falling through to the same line. */
.jot-demo-out .jot-divider {
  border: 0;
  height: 28px;
  background: none;
  position: relative;
}

/* ── @pagebreak ─────────────────────────────────────────────────────── */
/* Drawn on screen, not only in print. A break is the one thing an author
   cannot check without printing, so the editor shows where the sheet ends:
   a dashed rule across the page with the reason written into it. One row
   tall, like a divider, so it costs the ruling nothing.
   The mark itself never prints — by then the paper has already obeyed it. */
.jot-demo-out .jot-pagebreak {
  height: 28px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jot-demo-out .jot-pagebreak::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--jot-rule-offset) - 1px);
  border-top: 1px dashed var(--jot-accent);
}
.jot-demo-out .jot-pagebreak-label {
  position: relative;
  font-family: var(--jot-font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--jot-accent);
  background: var(--jot-surface);
  padding: 0 14px;
  line-height: 28px;
}
.jot-demo-out .jot-divider::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--jot-rule-offset) - 1px);
  /* 40%, not 18%. The reasoning for a short centred mark stands — a full-width
     line drawn ON a rule just makes one rule slightly darker — but at 18% it
     read as something that had been cut off rather than as a deliberate
     ornament. Wide enough to look chosen, short enough not to be mistaken for
     the ruling. */
  width: 40%;
  min-width: 84px;
  border-top: 2px solid var(--jot-accent);
}
/* The three styles are three treatments of ONE mark, so they are the same
   width. They were not: widening the line to 40% left dots at 64px and the
   wave at 96px, so switching style shrank the divider to a quarter of itself
   and read as the style not working at all. */
.jot-demo-out .jot-divider[data-style="dots"]::after {
  border-top: 0;
  height: 3px;
  top: calc(var(--jot-rule-offset) - 3px);
  background-image: radial-gradient(circle, var(--jot-accent) 2px, transparent 2.1px);
  background-size: 18px 4px;
  background-repeat: repeat-x;
}
.jot-demo-out .jot-divider[data-style="wave"]::after {
  border-top: 0;
  height: 8px;
  top: calc(var(--jot-rule-offset) - 5px);
  background-image:
    radial-gradient(circle at 50% 100%, transparent 5px, var(--jot-accent) 5px, var(--jot-accent) 6.4px, transparent 6.5px),
    radial-gradient(circle at 50% 0%,   transparent 5px, var(--jot-accent) 5px, var(--jot-accent) 6.4px, transparent 6.5px);
  background-size: 24px 8px, 24px 8px;
  background-position: 0 0, 12px 0;
  background-repeat: repeat-x;
}

/* ── Drawn blocks ───────────────────────────────────────────────────── */
/* Rule 2: opaque background masks the ruling so the card breathes.
   Rule 3: 1px border + 13px padding, top and bottom, totals exactly 28px of
   chrome. Inner content is row-multiples, so the card's height is always a whole
   number of rows and the text after it resumes in phase.
   Rule 4: 14px margin top and bottom is the half-row clearance. */
.jot-demo-out .jot-card {
  background: var(--jot-surface-elevated);
  border: 1px solid var(--jot-rule);
  border-radius: var(--jot-shape-border-radius-base);
  box-shadow: var(--jot-card-shadow);
  padding: 13px 18px;
  margin: 0 0 28px;
}
.jot-demo-out .jot-card .jot-card-title {
  font-family: var(--jot-font-heading);
  font-size: 18px;
  font-weight: 600;
  line-height: 28px;
  margin: 0;
  color: var(--jot-ink);
}
.jot-demo-out .jot-card .jot-card-kicker {
  font-family: var(--jot-font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 28px;
  color: var(--jot-accent);
  margin: 0;
}
.jot-demo-out .jot-fields { margin: 0; }
.jot-demo-out .jot-field {
  display: grid;
  grid-template-columns: 7rem 1fr;
  column-gap: 14px;
  line-height: 28px;
}
.jot-demo-out .jot-field-key {
  font-family: var(--jot-font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--jot-ink-muted);
}
.jot-demo-out .jot-field-value { font-size: 16px; }
.jot-demo-out .jot-field-list { margin: 0; padding-left: 28px; }
.jot-demo-out .jot-field-list li { line-height: 28px; }

/* A decision's date, after its status (UX-67). Quiet on purpose: the status is
   what the card is read for, the date is what makes it findable later. Same
   line, same face, so it cannot grow the row. */
.jot-demo-out .jot-card .jot-card-date {
  margin-left: 14px;
  color: var(--jot-ink-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Badge beside the kicker: the card's status at a glance. Inline-block with a
   capped line-height so it cannot grow the row it sits in. */
.jot-demo-out .jot-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 0 7px;
  border-radius: var(--jot-shape-border-radius-full);
  background: var(--jot-color-accent-terracotta-pale);
  color: var(--jot-color-accent-sepia);
  font-family: var(--jot-font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 18px;
  vertical-align: baseline;
}
.jot-demo-out .jot-badge[data-alert="true"] { background: #f7d9d4; color: #8c1d18; }
.jot-demo-out .jot-card[data-alert="true"] { border-color: var(--jot-color-accent-terracotta); }

/* @metric leads with the number. */
/* A 28px number does not fit a 28px line box — Lora's content height is
   about 1.28em — so the figure takes two rows rather than overflowing by 6px. */
/* Two rows for the figure, as a plain line box rather than flex.
   Flex baseline alignment stretched the row: a 28px number's inline ascent
   exceeds the strut's, and the line grows to fit it. Capping the number's own
   line-height keeps its inline box inside the strut, so the row stays exactly
   two. Scoped under .jot-body to out-specify the generic `.jot-body p` rule. */
.jot-demo-out .jot-body p.jot-metric { line-height: 56px; }
.jot-demo-out .jot-body .jot-metric > * + * { margin-left: 14px; }
.jot-demo-out .jot-body .jot-metric-value {
  font-family: var(--jot-font-heading);
  font-size: 28px;
  font-weight: 600;
  /* line-height 1 keeps this inline box smaller than the surrounding strut,
     so a large figure cannot stretch the line it sits on. */
  line-height: 1;
}
.jot-demo-out .jot-body .jot-metric-target,
.jot-demo-out .jot-body .jot-trend {
  font-family: var(--jot-font-label);
  font-size: 12px;
  color: var(--jot-ink-muted);
  line-height: 1;
}
.jot-demo-out .jot-trend[data-trend="up"] { color: var(--jot-color-accent-sage); }
.jot-demo-out .jot-trend[data-trend="down"] { color: var(--jot-color-accent-terracotta); }

/* ── @columns ───────────────────────────────────────────────────────── */
/* One mechanic for what used to be two primitives: a two-page spread and a row
   of feature pillars are both "regions side by side". Gaps are whole rows so a
   column that wraps on a narrow screen cannot break the ruling. */
.jot-demo-out .jot-columns { display: flex; flex-wrap: wrap; gap: 0 28px; }
/* A small basis so columns actually sit side by side in a narrow preview pane;
   they still wrap on a phone, where stacking is the right answer. */
.jot-demo-out .jot-col { flex: 1 1 150px; min-width: 0; }
.jot-demo-out .jot-col > :last-child { margin-bottom: 0; }
/* A block that is a column of its own starts at the top, level with the
   headings of the columns beside it. */
.jot-demo-out .jot-col > .jot-nested:first-child { margin-top: 0; }
/* A drawn block in a column (UX-65) clears the ruling across its column and
   the gap either side, so rules do not run in the gutter between two boxes.
   Text in another column keeps its own rules on the same rows. */
.jot-demo-out[data-mode="notebook"] .jot-col > .jot-nested:has(> .jot-figure, > .jot-card, > .jot-callout) {
  background: var(--jot-surface);
  box-shadow: -28px 0 0 var(--jot-surface), 28px 0 0 var(--jot-surface);
}
.jot-demo-out .jot-columns .jot-col-heading {
  font-family: var(--jot-font-label);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--jot-ink-muted);
  line-height: 28px;
  margin: 0;
}

/* ── Panel accents ──────────────────────────────────────────────────── */
/* The accent is what makes a panel read as what it IS before the label is
   read. Presets set it; @panel takes it directly. */
.jot-demo-out .jot-card[data-accent="alert"]    { border-left: 3px solid var(--jot-color-accent-terracotta); }
.jot-demo-out .jot-card[data-accent="positive"] { border-left: 3px solid var(--jot-color-accent-sage); }
.jot-demo-out .jot-card[data-accent="info"]     { border-left: 3px solid var(--jot-color-accent-slate-blue); }
.jot-demo-out .jot-card[data-accent="quiet"] {
  background: none;
  box-shadow: none;
  border-style: dashed;
}


/* ── @cover: a band across the page ─────────────────────────────────── */
/* Spans the margin channel. That is the whole difference between a cover and
   a large heading: a heading belongs to the text column, an opener sits
   across the page. */
.jot-demo-out .jot-body:has(> .jot-cover[data-width="full"]) { grid-column: 1 / -1; }

.jot-demo-out .jot-cover {
  /* The height the renderer counted, in rows. Not min-height: a band that
     grows past its own count puts every ruled line below it out of phase. */
  height: calc(28 * var(--u, 1px));
  height: calc(var(--jot-cover-rows) * calc(28 * var(--u, 1px)));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Two classes, not one. The title is a <p>, so the prose rule
   .jotstak .jot-body p reaches it at (0,2,1); a single extra class is (0,2,0),
   which LOSES, silently, and the title renders at 16px while this file says
   36. ENG-18, for the fourth block in a row. */
.jot-demo-out .jot-cover .jot-cover-title {
  font-family: var(--jot-font-heading);
  color: var(--jot-ink);
  margin: 0;
  font-weight: 600;
  font-size: 36px;
  line-height: calc(56 * var(--u, 1px));
  letter-spacing: -0.02em;
}

.jot-demo-out .jot-cover .jot-cover-subtitle {
  font-family: var(--jot-font-label);
  color: var(--jot-ink-muted);
  margin: 0;
  font-size: 16px;
  line-height: calc(28 * var(--u, 1px));
}

/* ── default: rules above and below ──────────────────────────────────── */
/* var(--jot-accent), not var(--jot-rule). The ruling is TRANSPARENT in doc
   mode, and a cover's rules are structure rather than ruling: drawing them in
   the ruling colour would have made the whole band vanish the moment somebody
   switched to doc. Terracotta is what the divider and the quote already use
   for a mark that is meant to be seen. */
.jot-demo-out .jot-cover[data-style="default"] {
  border-top: 1px solid var(--jot-accent);
  border-bottom: 1px solid var(--jot-accent);
  padding: calc(27 * var(--u, 1px)) 0 calc(27 * var(--u, 1px));
}

/* ── minimal: one hairline underneath, and the title comes down a size ── */
/* At h1 size a "minimal" cover is louder than the h1 it sits above, which is
   the wrong way round. */
.jot-demo-out .jot-cover[data-style="minimal"] {
  border-bottom: 1px solid var(--jot-accent);
  padding: 0 0 calc(27 * var(--u, 1px));
}
.jot-demo-out .jot-cover[data-style="minimal"] .jot-cover-title {
  font-size: 22px;
  line-height: calc(28 * var(--u, 1px));
  letter-spacing: -0.01em;
}

/* ── bold: the rules become a field ──────────────────────────────────── */
/* Tinted rather than reversed out. Reversed white-on-ink is a print job the
   cream paper is not doing — a solid black band on a notebook page reads as a
   redaction, not a cover. */
.jot-demo-out .jot-cover[data-style="bold"] {
  background: var(--jot-color-accent-terracotta-pale);
  border-left: calc(4 * var(--u, 1px)) solid var(--jot-accent);
  padding: calc(28 * var(--u, 1px)) calc(14 * var(--u, 1px)) calc(56 * var(--u, 1px));
}

/* A drawn block clears the ruling across its whole row, like every other one. */
[data-mode="notebook"] .jot-demo-out .jot-body:has(> .jot-cover) { background-image: none; }



/* ── @sticky: a wall of notes ───────────────────────────────────────── */
/* A run of stickies is ONE figure and one row of the document. Two in a row
   rendering as two blocks down the page would be a list with coloured
   backgrounds, which is not what cluster synthesis looks like. */
.jot-demo-out .jot-body:has(> .jot-sticky-wall) { grid-column: 1 / -1; }

/* Groups STACK; notes inside a group wrap. A cluster is a line of the wall,
   which is also how a wall works on an actual wall. Laying the groups out side
   by side instead let a second cluster wrap below the wall's own height and
   run over the paragraph underneath — and the wall's height being fixed meant
   declared and drawn agreed the whole time it was happening. */
/* The wall's height is not declared. It cannot be.
   
   It used to be: the renderer worked out how many notes fit across a printable
   page, how many lines that made, and wrote the total in. That is right for
   exactly one width. Under the reflow below REFLOW_BELOW a phone gives the
   document 343px, two notes fit across instead of four, and a wall declared at
   12 rows drew 24 — 338px of stickies over whatever came next.
   
   A grid gets it right at every width instead of guessing at one. And the
   height stays a whole number of rows by ARITHMETIC rather than by arrangement:
   a note is 5 rows, the gap between lines is 1, so any wall is 6n-1 rows
   whatever the column count turns out to be. */
.jot-demo-out .jot-sticky-wall {
  display: flex;
  flex-direction: column;
}

.jot-demo-out .jot-sticky-group { display: flex; flex-direction: column; }
.jot-demo-out .jot-sticky-notes {
  display: grid;
  grid-template-columns: repeat(auto-fill, calc(140 * var(--u, 1px)));
  column-gap: calc(14 * var(--u, 1px));
  row-gap: calc(28 * var(--u, 1px));
}

/* The cluster's name, in the label face, on its own row above the notes. */
.jot-demo-out .jot-sticky-wall .jot-sticky-cluster {
  font-family: var(--jot-font-label);
  font-size: calc(12 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--jot-ink-muted);
}

.jot-demo-out .jot-sticky {
  width: calc(140 * var(--u, 1px));
  height: calc(var(--jot-sticky-rows) * calc(28 * var(--u, 1px)));
  box-sizing: border-box;
  padding: calc(12 * var(--u, 1px));
  border: 1px solid;
  /* A sticky is paper on paper, so it casts a short shadow rather than
     carrying a heavy outline. */
  box-shadow: 0 1px 2px rgba(44, 37, 35, 0.14);
  rotate: var(--jot-sticky-tilt, 0deg);
  overflow: hidden;
}

/* Two classes, not one: the text is a <p>, so .jotstak .jot-body p reaches it
   at (0,2,1) and a single extra class would lose. ENG-18. */
.jot-demo-out .jot-sticky .jot-sticky-text {
  font-family: var(--jot-font-body);
  color: var(--jot-ink);
  margin: 0;
}
.jot-demo-out .jot-sticky[data-step="0"] .jot-sticky-text { font-size: calc(14 * var(--u, 1px)); line-height: calc(20 * var(--u, 1px)); }
.jot-demo-out .jot-sticky[data-step="1"] .jot-sticky-text { font-size: calc(12 * var(--u, 1px)); line-height: calc(17 * var(--u, 1px)); }

.jot-demo-out .jot-sticky[data-color="yellow"] { background: #f5e6a8; border-color: #e8d488; }
.jot-demo-out .jot-sticky[data-color="green"] { background: #cfdcc0; border-color: #b9caa6; }
.jot-demo-out .jot-sticky[data-color="coral"] { background: #f5c9b8; border-color: #e8b09a; }
.jot-demo-out .jot-sticky[data-color="blue"] { background: #c3d4dd; border-color: #a7bfcc; }
.jot-demo-out .jot-sticky[data-color="pink"] { background: #eccdd4; border-color: #dcb2bd; }
.jot-demo-out .jot-sticky[data-color="purple"] { background: #d6cde0; border-color: #bfb2cf; }

/* A drawn block clears the ruling across its whole row, like every other one. */
[data-mode="notebook"] .jot-demo-out .jot-body:has(> .jot-sticky-wall) { background-image: none; }

/* Doc mode keeps the colours — a sticky with no colour is not a sticky — but
   loses the tilt and the shadow, which are notebook mannerisms. */
.jot-demo-out[data-mode="doc"] .jot-sticky { rotate: none; box-shadow: none; }


/* ── @tree: a figure that always fits its page (UX-31) ──────────────── */
/* The renderer measures the tree (ARC-15) and writes its natural size as
   --jot-w and --jot-h. The figure takes that width, or all the room it has if
   that is less, and --u shrinks every length inside by the same ratio. Its
   height rounds UP to whole rows, so a scaled figure still hands the ruling
   back in phase. An outline wraps like prose and sets neither, so all of this
   resolves to "invalid", which CSS turns back into ordinary auto sizing. */
.jot-demo-out .jot-body:has(> .jot-figure) { container-type: inline-size; }
/* A figure inside another block fits THAT block, not the page. With only the
   row above as a container, 100cqw inside a card still meant the whole sheet:
   a star model in a panel drew at full size in a box 38px narrower and ran
   19px out of its right edge. The fluid figures hid it by stretching. */
.jot-demo-out .jot-nested:has(> .jot-figure),
.jot-demo-out .jot-col:has(> .jot-figure) { container-type: inline-size; }
.jot-demo-out .jot-body:has(> .jot-figure[data-width="full"]) { grid-column: 1 / -1; }
.jot-demo-out .jot-figure {
  --u: min(1px, calc(100cqw / var(--jot-w)));
  width: calc(var(--jot-w) * var(--u));
  height: round(up, calc(var(--jot-h) * var(--u)), 28px);
  max-width: 100%;
  margin-inline: 0;
  background: var(--jot-surface);
}
/* A figure that is a REGION rather than a drawing — a matrix, a timeline —
   takes the whole width it is given instead of shrinking to its contents. A
   2×2 sized to five short labels reads as a stamp on the page, and two of them
   at different sizes read as two different kinds of thing. --jot-w still sets
   the scale: below it, everything inside shrinks together. */
.jot-demo-out .jot-figure[data-fill] { width: 100%; }
.jot-demo-out .jot-figure[data-look="chart"],
.jot-demo-out .jot-figure[data-look="split"] { margin-inline: auto; }

.jot-demo-out .jot-tree {
  --jot-tree-line: var(--jot-color-accent-slate-blue);
  color: var(--jot-ink);
  font-size: calc(16 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
}
/* A tree is built from lists, so the prose list rules reach into it unless
   they are out-ranked. `.jot-body li { font-size: 16px }` did exactly that: a
   scaled tree kept 16px text inside shrunken columns, and 69px of labels ran
   past the edge of its frame. Hence these selectors carry a class more than
   the prose ones, rather than relying on coming later in the file. */
.jot-demo-out .jot-tree .jot-tree-root,
.jot-demo-out .jot-tree .jot-tree-kids { list-style: none; margin: 0; padding: 0; }
.jot-demo-out .jot-tree .jot-tree-node {
  position: relative;
  margin: 0;
  font-size: calc(16 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
}
.jot-demo-out .jot-tree[data-style="dashed"] { --jot-tree-line-style: dashed; }

/* ── Pills: nodes=boxed (UX-29) ─────────────────────────────────────── */
/* Every node the same shape, sized to its own text with even padding, one
   line, text centred. Two shades carry the structure — a branch is darker than
   the leaves inside it — and the root is heaviest. Each shade is tested for
   WCAG AA contrast against the ink it carries. */
.jot-demo-out .jot-tree[data-nodes="boxed"] {
  --pill-leaf-fill: var(--jot-color-notebook-paper-elevated);
  --pill-leaf-line: var(--jot-color-notebook-rule-lines);
  --pill-branch-fill: var(--jot-color-notebook-rule-lines);
  --pill-branch-line: color-mix(in srgb, var(--jot-color-notebook-rule-lines), var(--jot-color-notebook-ink) 22%);
  --pill-root-fill: var(--jot-color-accent-terracotta-pale);
  --pill-root-line: var(--jot-color-accent-terracotta);
}
.jot-demo-out[data-mode="doc"] .jot-tree[data-nodes="boxed"] {
  --pill-leaf-fill: var(--jot-color-doc-sheet);
  --pill-leaf-line: var(--jot-color-doc-sheet-border);
  --pill-branch-fill: var(--jot-color-doc-viewport);
  --pill-branch-line: color-mix(in srgb, var(--jot-color-doc-sheet-border), var(--jot-color-doc-ink) 22%);
}
.jot-demo-out .jot-tree[data-nodes="boxed"] .jot-tree-text {
  display: inline-block;
  position: relative;
  box-sizing: border-box;
  height: calc(24 * var(--u, 1px));
  line-height: calc(calc(24 * var(--u, 1px)) - 2px);
  margin: calc(2 * var(--u, 1px)) 0;
  padding: 0 calc(10 * var(--u, 1px));
  border: 1px solid var(--pill-line, var(--pill-leaf-line));
  border-radius: 999px;
  background: var(--pill-fill, var(--pill-leaf-fill));
  font-size: calc(14 * var(--u, 1px));
  white-space: nowrap;
  text-align: center;
  /* An inline-block sits on the text baseline and leaves descender space under
     it, which made a boxed split 2px taller than its rows (measured). */
  vertical-align: top;
}
.jot-demo-out .jot-tree[data-nodes="boxed"] [data-role="branch"] > .jot-tree-label > .jot-tree-text {
  --pill-fill: var(--pill-branch-fill);
  --pill-line: var(--pill-branch-line);
}
.jot-demo-out .jot-tree[data-nodes="boxed"] [data-role="root"] > .jot-tree-label > .jot-tree-text {
  --pill-fill: var(--pill-root-fill);
  --pill-line: var(--pill-root-line);
  font-weight: 600;
}

/* ── dir=down, text: the outline ────────────────────────────────────── */
/* Unchanged from the look first approved. Connectors are borders on
   pseudo-elements of each node, so they cannot drift from the box they belong
   to; two per node, never three — ::before the spine, ::after the elbow, and
   they MEET at the elbow row. A version that patched the last child with a
   third element left a one-pixel seam. */
.jot-demo-out .jot-tree[data-look="outline"] .jot-tree-label {
  display: inline-block;
  line-height: calc(28 * var(--u, 1px));
  padding: 0 calc(7 * var(--u, 1px));
}
.jot-demo-out .jot-tree[data-look="outline"] .jot-tree-node { line-height: calc(28 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="outline"] .jot-tree-kids { padding-left: calc(28 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="outline"] .jot-tree-kids > .jot-tree-node { padding-left: calc(14 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="outline"] .jot-tree-kids > .jot-tree-node::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-left: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
.jot-demo-out .jot-tree[data-look="outline"] .jot-tree-kids > .jot-tree-node:last-child::before {
  bottom: auto;
  height: calc(14 * var(--u, 1px));
}
.jot-demo-out .jot-tree[data-look="outline"] .jot-tree-kids > .jot-tree-node::after {
  content: "";
  position: absolute;
  left: 0;
  top: calc(14 * var(--u, 1px));
  width: calc(14 * var(--u, 1px));
  border-top: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
.jot-demo-out .jot-tree[data-look="outline"] > .jot-tree-root > .jot-tree-node > .jot-tree-label {
  font-weight: 600;
  background: var(--jot-surface-elevated);
  border-radius: var(--jot-shape-border-radius-sm);
}

/* ── dir=right: aligned columns (UX-28) ─────────────────────────────── */
/* One grid for the whole tree, one column per level, and every list a SUBGRID
   of it — so each column is as wide as its widest label and every label in a
   level starts at the same left edge, however the families above it are
   shaped. A parent shares the row of its first child; a family takes all the
   rows it needs before the next begins. That is the reference exactly: if the
   labels in a column were ragged, the columns would stop reading as columns. */
.jot-demo-out .jot-tree[data-look="columns"] .jot-tree-root {
  display: grid;
  column-gap: calc(28 * var(--u, 1px));
  align-items: start;
}
.jot-demo-out .jot-tree[data-look="columns"][data-depth="1"] .jot-tree-root { grid-template-columns: repeat(1, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="2"] .jot-tree-root { grid-template-columns: repeat(2, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="3"] .jot-tree-root { grid-template-columns: repeat(3, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="4"] .jot-tree-root { grid-template-columns: repeat(4, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="5"] .jot-tree-root { grid-template-columns: repeat(5, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="6"] .jot-tree-root { grid-template-columns: repeat(6, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="7"] .jot-tree-root { grid-template-columns: repeat(7, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="8"] .jot-tree-root { grid-template-columns: repeat(8, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="9"] .jot-tree-root { grid-template-columns: repeat(9, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="10"] .jot-tree-root { grid-template-columns: repeat(10, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="11"] .jot-tree-root { grid-template-columns: repeat(11, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="12"] .jot-tree-root { grid-template-columns: repeat(12, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="13"] .jot-tree-root { grid-template-columns: repeat(13, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="14"] .jot-tree-root { grid-template-columns: repeat(14, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="15"] .jot-tree-root { grid-template-columns: repeat(15, max-content); }
.jot-demo-out .jot-tree[data-look="columns"][data-depth="16"] .jot-tree-root { grid-template-columns: repeat(16, max-content); }
.jot-demo-out .jot-tree[data-look="columns"] .jot-tree-node {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  align-items: start;
}
.jot-demo-out .jot-tree[data-look="columns"] .jot-tree-kids {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 2 / -1;
  grid-row: 1;
}
.jot-demo-out .jot-tree[data-look="columns"] .jot-tree-label {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: flex-start;
  height: calc(28 * var(--u, 1px));
  position: relative;
  white-space: nowrap;
}
/* The line leaving a parent runs from its label to the spine in the middle of
   the gap. As a flex item it fills whatever its column has left over, so a
   short label's line is simply longer. */
.jot-demo-out .jot-tree[data-look="columns"] .jot-tree-node:has(> .jot-tree-kids) > .jot-tree-label::after {
  content: "";
  flex: 1 0 calc(8 * var(--u, 1px));
  margin: calc(14 * var(--u, 1px)) calc(-14 * var(--u, 1px)) 0 calc(6 * var(--u, 1px));
  border-top: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
.jot-demo-out .jot-tree[data-look="columns"][data-nodes="boxed"] .jot-tree-node:has(> .jot-tree-kids) > .jot-tree-label::after {
  margin-left: 0;
}
/* The spine, one child's length at a time: from the first child's middle to the
   last child's middle, down the centre of the gap. */
.jot-demo-out .jot-tree[data-look="columns"] .jot-tree-kids > .jot-tree-node::before {
  content: "";
  position: absolute;
  left: calc(-14 * var(--u, 1px));
  top: 0;
  bottom: 0;
  border-left: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
.jot-demo-out .jot-tree[data-look="columns"] .jot-tree-kids > .jot-tree-node:first-child::before { top: calc(14 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="columns"] .jot-tree-kids > .jot-tree-node:last-child::before { bottom: auto; height: calc(14 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="columns"] .jot-tree-kids > .jot-tree-node:only-child::before { display: none; }
/* The line into each child. Text looks stop just short of the label; pills end
   in an arrowhead at the pill's edge. */
.jot-demo-out .jot-tree[data-look="columns"] .jot-tree-kids > .jot-tree-node > .jot-tree-label::before {
  content: "";
  position: absolute;
  left: calc(-14 * var(--u, 1px));
  top: calc(14 * var(--u, 1px));
  width: calc(10 * var(--u, 1px));
  border-top: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
.jot-demo-out .jot-tree[data-look="columns"][data-nodes="boxed"] .jot-tree-kids > .jot-tree-node > .jot-tree-label::before {
  width: calc(8 * var(--u, 1px));
}
.jot-demo-out .jot-tree[data-look="columns"][data-nodes="boxed"] .jot-tree-kids > .jot-tree-node > .jot-tree-label > .jot-tree-text::before {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% + 1px);
  transform: translateY(-50%);
  border-left: calc(6 * var(--u, 1px)) solid var(--jot-tree-line);
  border-top: calc(4 * var(--u, 1px)) solid transparent;
  border-bottom: calc(4 * var(--u, 1px)) solid transparent;
}
/* Rounded: the last child's corner is one element, so the curve is continuous. */
.jot-demo-out .jot-tree[data-look="columns"][data-style="rounded"] .jot-tree-kids > .jot-tree-node:last-child:not(:only-child)::before { display: none; }
.jot-demo-out .jot-tree[data-look="columns"][data-style="rounded"] .jot-tree-kids > .jot-tree-node:last-child:not(:only-child) > .jot-tree-label::before {
  top: 0;
  height: calc(14 * var(--u, 1px));
  border-top: 0;
  border-left: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
  border-bottom: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
  border-bottom-left-radius: calc(7 * var(--u, 1px));
}

/* ── dir=down, boxed: the chart (UX-29, UX-30) ──────────────────────── */
/* Depth is distance from the top. A family whose children are all leaves
   STACKS them down a rail; any other family SPREADS its children in a row.
   That one rule stands in for the packing a designer does by hand: stacking
   the last level is what stops a top-down tree getting wider than the page.
   Lines run from pill edge to pill edge, bend at right angles, and end in an
   arrowhead pointing from parent to child. */
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-root {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-root > .jot-tree-node { padding: 0 calc(7 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-label { display: block; height: calc(28 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids { position: relative; }

/* Spread: a stem down from the parent, a bar across, a drop into each child. */
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="spread"] {
  display: flex;
  align-items: flex-start;
  padding-top: calc(28 * var(--u, 1px));
}
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="spread"] > .jot-tree-node { padding: 0 calc(7 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="spread"]::before {
  content: "";
  position: absolute;
  top: calc(-2 * var(--u, 1px));
  left: 50%;
  height: calc(16 * var(--u, 1px));
  border-left: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
/* Each child draws the half of the bar on either side of where it is entered,
   so siblings' halves meet and the bar runs exactly from the first drop to the
   last. --attach is where a child is entered: its centre, unless it is a stack
   hanging from a rail (below). */
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="spread"] > .jot-tree-node::before {
  content: "";
  position: absolute;
  top: calc(-14 * var(--u, 1px));
  left: 0;
  width: var(--attach, 50%);
  border-top: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="spread"] > .jot-tree-node::after {
  content: "";
  position: absolute;
  top: calc(-14 * var(--u, 1px));
  left: var(--attach, 50%);
  right: 0;
  height: calc(10 * var(--u, 1px));
  border-top: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
  border-left: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="spread"] > .jot-tree-node:first-child::before { border-top: 0; }
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="spread"] > .jot-tree-node:last-child::after { border-top: 0; }
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="spread"] > .jot-tree-node > .jot-tree-label > .jot-tree-text::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 1px);
  left: var(--pill-attach, 50%);
  transform: translateX(-50%);
  border-top: calc(6 * var(--u, 1px)) solid var(--jot-tree-line);
  border-left: calc(4 * var(--u, 1px)) solid transparent;
  border-right: calc(4 * var(--u, 1px)) solid transparent;
}
.jot-demo-out .jot-tree[data-look="chart"][data-style="rounded"] .jot-tree-kids[data-flow="spread"] > .jot-tree-node:first-child:not(:only-child)::after { border-top-left-radius: calc(7 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="chart"][data-style="rounded"] .jot-tree-kids[data-flow="spread"] > .jot-tree-node:last-child:not(:only-child)::before {
  border-top: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
  border-right: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
  border-top-right-radius: calc(7 * var(--u, 1px));
  height: calc(10 * var(--u, 1px));
}
.jot-demo-out .jot-tree[data-look="chart"][data-style="rounded"] .jot-tree-kids[data-flow="spread"] > .jot-tree-node:last-child:not(:only-child)::after { border-left: 0; }

/* Stack: leaves hang down a rail, each entered from the side. */
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="stack"] {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: calc(22 * var(--u, 1px));
}
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="stack"] > .jot-tree-node::before {
  content: "";
  position: absolute;
  left: calc(-22 * var(--u, 1px));
  top: calc(14 * var(--u, 1px));
  width: calc(16 * var(--u, 1px));
  border-top: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="stack"] > .jot-tree-node > .jot-tree-label > .jot-tree-text::before {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% + 1px);
  transform: translateY(-50%);
  border-left: calc(6 * var(--u, 1px)) solid var(--jot-tree-line);
  border-top: calc(4 * var(--u, 1px)) solid transparent;
  border-bottom: calc(4 * var(--u, 1px)) solid transparent;
}

/* UX-32, settled 2026-09-27: the parent pill stays CENTRED over its family.
   Its line drops from the centre, turns, and runs down the rail the children
   hang off, which costs one row per stack.
   
   The alternative was a rail dropping straight from near the pill's left end:
   a row shorter, no corner anywhere, and about 14px wider per stack level.
   Both were built and looked at side by side. Centre won on two counts — it
   is what the reference did, and width is the axis that decides whether a
   tree stays in the text column or is scaled onto a landscape page (UX-31),
   so its saving is on the scarcer one. The left rail's real cost was legibility:
   with the parent over the left edge of its family, a stack reads as a heading
   above a list rather than as a parent with children, which is the one thing
   the diagram exists to show. */
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="stack"] { padding-top: calc(28 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="stack"]::after {
  content: "";
  position: absolute;
  top: calc(-2 * var(--u, 1px));
  left: 0;
  right: 50%;
  height: calc(16 * var(--u, 1px));
  border-right: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
  border-bottom: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
.jot-demo-out .jot-tree[data-look="chart"][data-style="rounded"] .jot-tree-kids[data-flow="stack"]::after { border-bottom-right-radius: calc(7 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="stack"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(14 * var(--u, 1px));
  bottom: calc(14 * var(--u, 1px));
  border-left: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}

/* A label that was asked to break takes the rows the break costs.
   
   Every look holds a label at exactly one row, and most of them hold it on one
   LINE as well, because a tree is a diagram: a label left free to wrap would
   re-shape a figure the renderer has already measured and placed. The escape
   is the one thing that releases it, and only for the node that asked.
   
   Height is set from data-rows rather than left auto, because auto is how a
   label silently takes a row the measurement did not count. */
.jot-demo-out [data-rows] > .jot-tree-label,
.jot-demo-out [data-rows] > .jot-tree-label > .jot-tree-text {
  white-space: normal;
}
.jot-demo-out .jot-tree[data-look="columns"] [data-rows] > .jot-tree-label,
.jot-demo-out .jot-tree[data-look="chart"] [data-rows] > .jot-tree-label,
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] [data-rows] > .jot-tree-label {
  height: calc(var(--rows) * calc(28 * var(--u, 1px)));
}
.jot-demo-out [data-rows="2"] { --rows: 2; }
.jot-demo-out [data-rows="3"] { --rows: 3; }
.jot-demo-out [data-rows="4"] { --rows: 4; }

/* A pill grows to hold its lines, and is entered where every node is: the
   middle of its FIRST row (UX-59). It used to be entered there by its line and
   in its middle by its arrow, a row apart, so on a two-line pill the line
   stopped in mid-air above the arrowhead it was meant to end in.

   Its corners stay those of a one-line pill rather than going round. A line
   arriving at the first row meets a fully rounded pill on its curve; at a
   one-line pill's radius the side is straight from exactly that height down. */
.jot-demo-out .jot-tree[data-nodes="boxed"] [data-rows] > .jot-tree-label > .jot-tree-text {
  height: calc(var(--rows) * calc(28 * var(--u, 1px)) - calc(4 * var(--u, 1px)));
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: calc(calc(24 * var(--u, 1px)) - 2px);
  border-radius: calc(12 * var(--u, 1px));
}
/* Every look that enters a pill from the side. A spread chart enters from
   above, at the pill's top edge, and keeps its own arrow. */
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="stack"] > .jot-tree-node[data-rows] > .jot-tree-label > .jot-tree-text::before,
.jot-demo-out .jot-tree[data-look="columns"][data-nodes="boxed"] .jot-tree-kids > .jot-tree-node[data-rows] > .jot-tree-label > .jot-tree-text::before,
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-side[data-side] .jot-tree-kids > .jot-tree-node[data-rows] > .jot-tree-label > .jot-tree-text::before {
  /* [data-side] outranks the split's own arrows, which come later. */
  top: calc(12 * var(--u, 1px));
}
/* A stack's rail ends where its last child is entered, which for a child of
   several rows is not one half-row above the bottom. */
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="stack"]:has(> .jot-tree-node:last-child[data-rows="2"])::before { bottom: calc(42 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="stack"]:has(> .jot-tree-node:last-child[data-rows="3"])::before { bottom: calc(70 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="chart"] .jot-tree-kids[data-flow="stack"]:has(> .jot-tree-node:last-child[data-rows="4"])::before { bottom: calc(98 * var(--u, 1px)); }

/* ── dir=split: a bilateral mind map ────────────────────────────────── */
/* Three columns — left branches, the hub, right branches — not one column per
   branch, which gave four columns for four branches and an off-centre hub. The
   renderer chooses each branch's side, balancing by subtree weight; < and >
   override it. The grid fills the figure, so both sides are always equal and
   the hub always centred. */
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-split {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  column-gap: calc(28 * var(--u, 1px));
}
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-label {
  display: inline-block;
  line-height: calc(28 * var(--u, 1px));
  padding: 0 calc(7 * var(--u, 1px));
  white-space: nowrap;
}
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-node { line-height: calc(28 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-kids { padding-left: calc(28 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-kids > .jot-tree-node { padding-left: calc(14 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-kids > .jot-tree-node::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-left: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-kids > .jot-tree-node:last-child::before { bottom: auto; height: calc(14 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-kids > .jot-tree-node::after {
  content: "";
  position: absolute;
  left: 0;
  top: calc(14 * var(--u, 1px));
  width: calc(14 * var(--u, 1px));
  border-top: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
/* Where a parent sits BESIDE its children rather than above them — the hub and
   a side's first level, and every level of a boxed split — the spine starts at
   the first child's middle, where the parent's line arrives. Started at the top
   of the row, it left a stray tick poking up above every such junction. */
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side > .jot-tree-kids > .jot-tree-node:first-child::before,
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-kids > .jot-tree-node:first-child::before { top: calc(14 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side > .jot-tree-kids > .jot-tree-node:only-child::before,
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-kids > .jot-tree-node:only-child::before { display: none; }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-hub { display: flex; justify-content: center; }
.jot-demo-out .jot-tree[data-look="split"][data-nodes="text"] .jot-tree-hub > .jot-tree-label {
  font-weight: 600;
  background: var(--jot-surface-elevated);
  border-radius: var(--jot-shape-border-radius-sm);
  border: 1px solid var(--jot-rule);
  padding: 0 calc(14 * var(--u, 1px));
}
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-hub > .jot-tree-label { padding: 0; }
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-hub > .jot-tree-label > .jot-tree-text {
  --pill-fill: var(--pill-root-fill);
  --pill-line: var(--pill-root-line);
  font-weight: 600;
}
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side > .jot-tree-kids { padding: 0; }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side[data-side="right"] > .jot-tree-kids { padding-left: calc(28 * var(--u, 1px)); }
/* The left side mirrors completely — text, spine and elbow all flip — at EVERY
   level. Mirroring only the top level once left deeper levels with no indent,
   so a three-deep branch collapsed onto a single spine. */
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side[data-side="left"] { text-align: right; }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side[data-side="left"] .jot-tree-kids { padding-left: 0; padding-right: calc(28 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side[data-side="left"] > .jot-tree-kids { padding-right: calc(28 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side[data-side="left"] .jot-tree-kids > .jot-tree-node {
  padding-left: 0;
  padding-right: calc(14 * var(--u, 1px));
}
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side[data-side="left"] .jot-tree-kids > .jot-tree-node::before,
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side[data-side="left"] .jot-tree-kids > .jot-tree-node::after {
  left: auto;
  right: 0;
}
/* Each side connects inward to the hub, so the hub visibly joins both — from
   the hub's own edge, across the gap between the columns, to the side's spine.
   It used to stop at the side's edge and leave the gap bare, so the lines
   seemed to start in mid-air rather than at the hub. */
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side { position: relative; }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side::after {
  content: "";
  position: absolute;
  top: calc(14 * var(--u, 1px));
  width: calc(56 * var(--u, 1px));
  border-top: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side[data-side="right"]::after { left: calc(-28 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side[data-side="left"]::after { right: calc(-28 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="split"] .jot-tree-side:has(.jot-tree-kids:empty)::after { display: none; }
/* Boxed split: depth as columns, each pill followed by its children, mirrored
   in FLOW on the left as well as in text, or a left branch's children would
   march back toward the hub. Arrowheads point away from the hub. */
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-node { display: flex; align-items: flex-start; }
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-label { padding: 0; flex: none; display: block; height: calc(28 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-side[data-side="left"] .jot-tree-node { flex-direction: row-reverse; }
/* A boxed node's children sit BESIDE it, not below it, so the line from the
   pill to their spine has to be drawn — it spans the list's indent. Without it
   a second level floated free of its parent (the old version did this too). */
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-label { position: relative; }
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-node:has(> .jot-tree-kids) > .jot-tree-label::after {
  content: "";
  position: absolute;
  top: calc(14 * var(--u, 1px));
  width: calc(28 * var(--u, 1px));
  border-top: 1px var(--jot-tree-line-style, solid) var(--jot-tree-line);
}
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-side[data-side="right"] .jot-tree-node:has(> .jot-tree-kids) > .jot-tree-label::after { left: 100%; }
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-side[data-side="left"] .jot-tree-node:has(> .jot-tree-kids) > .jot-tree-label::after { right: 100%; }
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-kids > .jot-tree-node::after { width: calc(8 * var(--u, 1px)); }
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-side[data-side="right"] .jot-tree-kids > .jot-tree-node > .jot-tree-label > .jot-tree-text::before {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(100% + 1px);
  transform: translateY(-50%);
  border-left: calc(6 * var(--u, 1px)) solid var(--jot-tree-line);
  border-top: calc(4 * var(--u, 1px)) solid transparent;
  border-bottom: calc(4 * var(--u, 1px)) solid transparent;
}
.jot-demo-out .jot-tree[data-look="split"][data-nodes="boxed"] .jot-tree-side[data-side="left"] .jot-tree-kids > .jot-tree-node > .jot-tree-label > .jot-tree-text::before {
  content: "";
  position: absolute;
  top: 50%;
  left: calc(100% + 1px);
  transform: translateY(-50%);
  border-right: calc(6 * var(--u, 1px)) solid var(--jot-tree-line);
  border-top: calc(4 * var(--u, 1px)) solid transparent;
  border-bottom: calc(4 * var(--u, 1px)) solid transparent;
}
/* Extra roots under a split hub are drawn as outlines. */
.jot-demo-out .jot-tree[data-look="split"] > .jot-tree-root .jot-tree-label { white-space: normal; }


/* ── @matrix: two axes, four equal quadrants ────────────────────────── */
.jot-demo-out .jot-matrix {
  --jot-matrix-cross: var(--jot-color-accent-slate-blue);
  --jot-matrix-frame: var(--jot-color-notebook-rule-lines);
  --jot-matrix-axis-ink: var(--jot-ink-muted);
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--jot-ink);
}
.jot-demo-out[data-mode="doc"] .jot-matrix { --jot-matrix-frame: var(--jot-color-doc-sheet-border); }

.jot-demo-out .jot-matrix .jot-matrix-title,
.jot-demo-out .jot-matrix .jot-matrix-axis {
  font-family: var(--jot-font-label);
  font-size: calc(12 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
  margin: 0;
  color: var(--jot-matrix-axis-ink);
  letter-spacing: 0.04em;
}
.jot-demo-out .jot-matrix .jot-matrix-title {
  font-size: calc(12 * var(--u, 1px));
  text-transform: uppercase;
  font-weight: 600;
  color: var(--jot-ink);
}
/* The y label sits above the plot at the left and the x label under it at the
   right, each with an arrow towards "high". No rotated text: it cannot sit on
   a rule, and on paper it makes the reader turn the page. */
.jot-demo-out .jot-matrix .jot-matrix-axis[data-axis="y"] { text-align: left; }
.jot-demo-out .jot-matrix .jot-matrix-axis[data-axis="x"] { text-align: right; }

/* The plot takes whatever height is left after the labels, which is a whole
   number of rows because the figure's height is. */
.jot-demo-out .jot-matrix-plot {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
/* Two framings, both wanted (UX-39).
   style=axes draws the cross alone, in the same slate as a tree's connectors,
   so a matrix reads as something drawn on the page. style=boxed adds the outer
   border in the paler rule colour, which reads closer to a table. The cross is
   the axis either way, so it is always the stronger of the two lines. */
.jot-demo-out .jot-matrix[data-style="boxed"] .jot-matrix-plot { border: 1px solid var(--jot-matrix-frame); }
.jot-demo-out .jot-matrix-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(4 * var(--u, 1px));
  padding: calc(10 * var(--u, 1px));
  min-width: 0;
  overflow: hidden;
}
/* One cross through the middle, drawn as two borders rather than four, so the
   lines meet exactly at the centre. */
.jot-demo-out .jot-matrix-cell[data-q="tr"],
.jot-demo-out .jot-matrix-cell[data-q="br"] { border-left: 1px solid var(--jot-matrix-cross); }
.jot-demo-out .jot-matrix-cell[data-q="bl"],
.jot-demo-out .jot-matrix-cell[data-q="br"] { border-top: 1px solid var(--jot-matrix-cross); }

/* The chip is the tree's boxed node, to the pixel: one voice for every figure
   in the document. */
.jot-demo-out .jot-matrix-chip {
  display: block;
  max-width: 100%;
  box-sizing: border-box;
  font-family: var(--jot-font-body);
  font-size: calc(14 * var(--u, 1px));
  line-height: calc(calc(24 * var(--u, 1px)) - 2px);
  padding: 0 calc(10 * var(--u, 1px));
  border: 1px solid var(--jot-color-accent-terracotta-pale);
  border-radius: calc(12 * var(--u, 1px));
  background: var(--jot-surface-elevated);
  color: var(--jot-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* A chip is held on one line so a long label cannot stretch the quadrant. A
   break the author asked for is the one thing that releases it, and then the
   chip is as tall as the lines it was given. */
.jot-demo-out .jot-matrix-chip[data-wrap] {
  white-space: normal;
  text-align: center;
  line-height: calc(calc(24 * var(--u, 1px)) - 2px);
  height: auto;
}
.jot-demo-out[data-mode="doc"] .jot-matrix-chip {
  background: var(--jot-color-doc-sheet);
  border-color: var(--jot-color-doc-sheet-border);
}


/* ── @timeline: events on a line ────────────────────────────────────── */
.jot-demo-out .jot-timeline {
  --jot-timeline-line: var(--jot-color-accent-slate-blue);
  color: var(--jot-ink);
}
.jot-demo-out .jot-timeline .jot-timeline-title {
  margin: 0;
  font-family: var(--jot-font-label);
  font-size: calc(12 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--jot-ink);
}
.jot-demo-out .jot-timeline .jot-timeline-date {
  margin: 0;
  font-family: var(--jot-font-label);
  font-size: calc(12 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--jot-ink-muted);
  white-space: nowrap;
}
.jot-demo-out .jot-timeline .jot-timeline-label {
  margin: 0;
  font-family: var(--jot-font-body);
  font-size: calc(14 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
  font-weight: 600;
}
.jot-demo-out .jot-timeline .jot-timeline-detail {
  margin: 0;
  font-family: var(--jot-font-body);
  font-size: calc(13 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
  color: var(--jot-ink-muted);
}
.jot-demo-out .jot-timeline-dot {
  width: calc(7 * var(--u, 1px));
  height: calc(7 * var(--u, 1px));
  border-radius: 50%;
  background: var(--jot-timeline-line);
}

/* ── Horizontal ─────────────────────────────────────────────────────── */
/* Two sub-columns per event, so a card can be centred on its own dot and
   stop exactly where its same-side neighbour's card begins. That doubling is
   what alternation BUYS: each side holds half the events, so each card gets
   two columns instead of one. The renderer writes the span per card, because
   it knows how many events there are and CSS would have to be told anyway. */
.jot-demo-out .jot-timeline-plot {
  display: grid;
  grid-template-columns: repeat(calc(var(--jot-tl-n) * 2), 1fr);
  grid-template-rows:
    calc(var(--jot-tl-above) * calc(28 * var(--u, 1px)))
    calc(28 * var(--u, 1px))
    calc(var(--jot-tl-below) * calc(28 * var(--u, 1px)));
}
.jot-demo-out .jot-timeline-axis {
  grid-row: 2;
  grid-column: 1 / -1;
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--jot-tl-n), 1fr);
  align-items: center;
}
/* The line runs the whole width and the dots sit on top of it. Its position
   inside the row is free: a figure clears the ruling across its whole block,
   so there is no rule here to land on. */
.jot-demo-out .jot-timeline-axis::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--jot-timeline-line);
}
.jot-demo-out .jot-timeline-axis .jot-timeline-dot {
  justify-self: center;
  position: relative;
}
.jot-demo-out .jot-timeline-event {
  min-width: 0;
  padding-inline: calc(8 * var(--u, 1px));
  text-align: center;
}
/* A card grows towards the line, not away from it, so every card on a side
   finishes level with the axis however tall it is. */
.jot-demo-out .jot-timeline-event[data-side="above"] { grid-row: 1; align-self: end; }
.jot-demo-out .jot-timeline-event[data-side="below"] { grid-row: 3; align-self: start; }

/* ── Vertical ───────────────────────────────────────────────────────── */
/* No sides, no measuring, no scaling: it runs down the page and wraps like
   prose, which is why it is the answer when there are too many events for a
   line across a page. */
.jot-demo-out .jot-timeline[data-dir="vertical"] .jot-timeline-rail {
  list-style: none;
  margin: 0;
  padding: 0 0 0 21px;
}
.jot-demo-out .jot-timeline[data-dir="vertical"] .jot-timeline-event {
  position: relative;
  margin: 0 0 28px;
  text-align: left;
  padding: 0;
}
/* The rail is drawn in segments, one per event, each running from its own dot
   down to the next one — rather than as a single line down the whole list.
   A single line has to end somewhere, and it ended level with the bottom of
   the last event's detail, which left it hanging past the final dot as though
   the timeline had been cut off. This way it ends exactly on the last mark. */
.jot-demo-out .jot-timeline[data-dir="vertical"] .jot-timeline-event::before {
  content: "";
  position: absolute;
  /* Measured back from the item rather than forward from the list, because
     the segment now hangs off the item: the rail sits railX from the list's
     edge, and the item starts railGap in. */
  left: -14px;
  top: 14px;
  bottom: -42px;
  border-left: 1px solid var(--jot-timeline-line);
}
.jot-demo-out .jot-timeline[data-dir="vertical"] .jot-timeline-event:last-child { margin-bottom: 0; }
.jot-demo-out .jot-timeline[data-dir="vertical"] .jot-timeline-event:last-child::before { display: none; }
.jot-demo-out .jot-timeline[data-dir="vertical"] .jot-timeline-dot {
  position: absolute;
  left: -17.5px;
  top: 10.5px;
}


/* ── @journey: stages across, and how each one felt ─────────────────── */
.jot-demo-out .jot-journey {
  --jot-journey-line: var(--jot-color-notebook-rule-lines);
  --jot-journey-happy: var(--jot-color-accent-sage);
  --jot-journey-neutral: var(--jot-color-accent-slate-blue);
  --jot-journey-frustrated: var(--jot-color-accent-terracotta);
  color: var(--jot-ink);
}
.jot-demo-out[data-mode="doc"] .jot-journey { --jot-journey-line: var(--jot-color-doc-sheet-border); }

.jot-demo-out .jot-journey .jot-journey-title,
.jot-demo-out .jot-journey .jot-journey-track {
  margin: 0;
  font-family: var(--jot-font-label);
  font-size: calc(12 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--jot-ink);
}
.jot-demo-out .jot-journey .jot-journey-track { color: var(--jot-ink-muted); }
.jot-demo-out .jot-journey .jot-journey-name {
  margin: 0;
  font-family: var(--jot-font-body);
  font-size: calc(14 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
  font-weight: 600;
}
.jot-demo-out .jot-journey .jot-journey-item {
  margin: 0;
  font-family: var(--jot-font-body);
  font-size: calc(13 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
  color: var(--jot-ink-muted);
}

/* ── Horizontal ─────────────────────────────────────────────────────── */
/* Three bands down: the stage names, the emotion band, then what happens at
   each stage. Equal columns, because a stage with more written under it is
   not a longer stage. */
.jot-demo-out .jot-journey-lane {
  display: grid;
  grid-template-columns: calc(78 * var(--u, 1px)) repeat(var(--jot-j-n), 1fr);
  grid-template-rows:
    calc(var(--jot-j-name) * calc(28 * var(--u, 1px)))
    calc(3 * calc(28 * var(--u, 1px)))
    calc(var(--jot-j-items) * calc(28 * var(--u, 1px)));
}
/* The stage is a wrapper for authoring, not for layout: its three parts belong
   in three different rows of the lane's grid, so it generates no box of its
   own and hands them straight to the grid. */
.jot-demo-out .jot-journey-stage { display: contents; }
.jot-demo-out .jot-journey .jot-journey-name,
.jot-demo-out .jot-journey-items { padding-inline: calc(10 * var(--u, 1px)); min-width: 0; }
.jot-demo-out .jot-journey .jot-journey-name { grid-row: 1; align-self: end; }
.jot-demo-out .jot-journey-items { grid-row: 3; align-self: start; }

/* The band holds the line; the dots sit in it, one per stage, at the height of
   their own feeling. The dots come after it in the markup, so they paint on
   top of the line without needing a stacking context. */
.jot-demo-out .jot-journey-band {
  grid-row: 2;
  /* Column 2 onwards: the band belongs over the stages, not over the scale
     that labels it. */
  grid-column: 2 / -1;
  position: relative;
}

/* The scale the arc is read against. Three words down the left, one per
   level, each on its own row of the band so a label is level with the dots it
   describes. Without it the band was three invisible rows and a dashed line,
   and which way was good had to be inferred from the colours. */
.jot-demo-out .jot-journey-scale {
  grid-row: 2;
  grid-column: 1;
  display: grid;
  grid-template-rows: repeat(3, calc(28 * var(--u, 1px)));
  padding-right: calc(10 * var(--u, 1px));
}
.jot-demo-out .jot-journey .jot-journey-level {
  font-family: var(--jot-font-label);
  font-size: calc(11 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--jot-ink-muted);
}
.jot-demo-out .jot-journey-level[data-feeling="happy"] { color: var(--jot-journey-happy); }
.jot-demo-out .jot-journey-level[data-feeling="frustrated"] { color: var(--jot-journey-frustrated); }
/* Neutral, drawn faintly, so rising above it and dropping below it both mean
   something at a glance. */
.jot-demo-out .jot-journey-band::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(calc(28 * var(--u, 1px)) + calc(14 * var(--u, 1px)));
  border-top: 1px dashed var(--jot-journey-line);
}
.jot-demo-out .jot-journey-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--jot-journey-neutral);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.jot-demo-out .jot-journey-dot {
  grid-row: 2;
  justify-self: center;
  align-self: start;
  /* Level 0, 1 or 2 down the band, centred in its own row. */
  margin-top: calc(var(--jot-j-level) * calc(28 * var(--u, 1px)) + calc(9.5 * var(--u, 1px)));
  width: calc(9 * var(--u, 1px));
  height: calc(9 * var(--u, 1px));
  border-radius: 50%;
  background: var(--jot-journey-neutral);
}
.jot-demo-out .jot-journey-stage[data-feeling="happy"] > .jot-journey-dot { background: var(--jot-journey-happy); }
.jot-demo-out .jot-journey-stage[data-feeling="frustrated"] > .jot-journey-dot { background: var(--jot-journey-frustrated); }
/* Every stage name takes its own feeling's colour.
   
   Only the frustrated one used to, which meant one orange word among three
   dark ones: it read as a mistake rather than a highlight, because nothing
   else on the row was colour-coded at all. With all three coded, the colour
   is a scale you read rather than an exception you interpret. */
.jot-demo-out .jot-journey-stage[data-feeling="happy"] > .jot-journey-name { color: var(--jot-journey-happy); }
.jot-demo-out .jot-journey-stage[data-feeling="neutral"] > .jot-journey-name { color: var(--jot-ink); }
.jot-demo-out .jot-journey-stage[data-feeling="frustrated"] > .jot-journey-name { color: var(--jot-journey-frustrated); }

/* ── Vertical ───────────────────────────────────────────────────────── */
/* No band and no curve: down the page the feeling is carried by the mark
   beside each stage, which is what a rail can say. Never measured or scaled. */
.jot-demo-out .jot-journey[data-dir="vertical"] .jot-journey-rail {
  list-style: none;
  margin: 0;
  padding: 0 0 0 21px;
}
.jot-demo-out .jot-journey[data-dir="vertical"] .jot-journey-step {
  position: relative;
  margin: 0 0 28px;
}
.jot-demo-out .jot-journey[data-dir="vertical"] .jot-journey-step::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 14px;
  bottom: -42px;
  border-left: 1px solid var(--jot-journey-line);
}
.jot-demo-out .jot-journey[data-dir="vertical"] .jot-journey-step:last-child { margin-bottom: 0; }
.jot-demo-out .jot-journey[data-dir="vertical"] .jot-journey-step:last-child::before { display: none; }
.jot-demo-out .jot-journey[data-dir="vertical"] .jot-journey-dot {
  position: absolute;
  left: -18.5px;
  top: 9.5px;
  margin-top: 0;
}


/* ── @star_model: a fact in the middle, dimensions around it ────────── */
.jot-demo-out .jot-star {
  --jot-star-line: var(--jot-color-accent-slate-blue);
  --jot-star-fact-fill: var(--jot-color-accent-terracotta-pale);
  --jot-star-fact-line: var(--jot-color-accent-terracotta);
  --jot-star-dim-fill: var(--jot-surface-elevated);
  --jot-star-dim-line: var(--jot-color-notebook-rule-lines);
  color: var(--jot-ink);
}
.jot-demo-out[data-mode="doc"] .jot-star {
  --jot-star-fact-fill: var(--jot-color-doc-sheet);
  --jot-star-dim-fill: var(--jot-color-doc-sheet);
  --jot-star-dim-line: var(--jot-color-doc-sheet-border);
}
.jot-demo-out .jot-star .jot-star-title {
  margin: 0;
  font-family: var(--jot-font-label);
  font-size: calc(12 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.jot-demo-out .jot-star-plot { position: relative; }
/* The lines are drawn first so the boxes paint over their ends; connectors run
   between EDGES rather than centres, so none of them passes under a label. */
.jot-demo-out .jot-star-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  stroke: var(--jot-star-line);
  stroke-width: 1;
  fill: none;
}
.jot-demo-out .jot-star-fact,
.jot-demo-out .jot-star-dim {
  position: absolute;
  box-sizing: border-box;
  text-align: center;
}
/* The fact is the thing everything else is about, so it is the only filled
   box in the figure. */
.jot-demo-out .jot-star-fact {
  border: 1px solid var(--jot-star-fact-line);
  border-radius: var(--jot-shape-border-radius-sm);
  background: var(--jot-star-fact-fill);
  padding: 0 calc(14 * var(--u, 1px));
}
.jot-demo-out .jot-star .jot-star-name {
  margin: 0;
  font-family: var(--jot-font-body);
  font-size: calc(15 * var(--u, 1px));
  line-height: calc(calc(28 * var(--u, 1px)) - 2px);
  font-weight: 600;
}
.jot-demo-out .jot-star .jot-star-field {
  margin: 0;
  font-family: var(--jot-font-mono);
  font-size: calc(12 * var(--u, 1px));
  line-height: calc(28 * var(--u, 1px));
  color: var(--jot-ink-muted);
  text-align: left;
  white-space: nowrap;
}
.jot-demo-out .jot-star-dim {
  font-family: var(--jot-font-body);
  font-size: calc(14 * var(--u, 1px));
  line-height: calc(calc(28 * var(--u, 1px)) - 2px);
  padding: 0 calc(12 * var(--u, 1px));
  border: 1px solid var(--jot-star-dim-line);
  border-radius: calc(14 * var(--u, 1px));
  background: var(--jot-star-dim-fill);
  white-space: nowrap;
}

/* ── layout=list ────────────────────────────────────────────────────── */
/* Not a fallback with an apology: a star model with fifteen dimensions IS a
   list of fifteen dimensions, and a wheel of tiny text helps nobody. Never
   measured, never scaled, wraps like prose. */
/* block + fit-content, not inline-block: an inline-block sits on the text
   baseline, so its line box reserves room for descenders underneath it and the
   figure came out a pixel over a whole row. */
.jot-demo-out .jot-star[data-layout="list"] .jot-star-fact {
  position: static;
  display: block;
  width: fit-content;
  text-align: left;
  font-family: var(--jot-font-body);
  font-size: 15px;
  line-height: 26px;
  font-weight: 600;
  margin: 0;
  padding: 0 14px;
}
/* A field that names a dimension is a JOIN, and the line leaving its row says
   so. Marking the row in the same ink ties the two together: you can read the
   schema down the fact, or follow it out to the dimension, and both say the
   same thing. A field that is only a column stays quiet. */
.jot-demo-out .jot-star .jot-star-field[data-linked] { color: var(--jot-ink); }
.jot-demo-out .jot-star-lines line[data-linked] { stroke: var(--jot-color-accent-terracotta); }

.jot-demo-out .jot-star[data-layout="list"] .jot-star-field {
  font-size: 12px;
  padding-left: 14px;
}
/* A whole row of gap, not half of one. An unsized figure is only in phase if
   every part of it is a whole number of rows, and a 14px margin here put the
   list layout 12.54 rows tall — so every line after it landed off the rule. */
.jot-demo-out .jot-star-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0 0 0 28px;
}
.jot-demo-out .jot-star-list li {
  position: relative;
  font-size: 14px;
  line-height: 28px;
}
/* One tick per dimension, pointing back at the fact above them. */
.jot-demo-out .jot-star-list li::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 14px;
  width: 10px;
  border-top: 1px solid var(--jot-star-line);
}


/* ── @table ─────────────────────────────────────────────────────────── */
.jot-demo-out .jot-table-wrap {
  --jot-table-line: var(--jot-color-accent-slate-blue);
}
/* A table with nothing in the margin beside it already spans both tracks, the
   same as any other free block (UX-37), and a table with a note beside it
   narrows for it. The exception is a width the AUTHOR pinned: that outranks
   the note, because they asked. */
.jot-demo-out .jot-body:has(> .jot-table-wrap[data-width="full"][data-pinned]) { grid-column: 1 / -1; }

.jot-demo-out .jot-table-wrap .jot-table-caption {
  margin: 0;
  font-family: var(--jot-font-label);
  font-size: 12px;
  line-height: 28px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--jot-ink);
}

/* A short header is held on one line, and that is what makes a squeezed table
   divide itself up correctly: automatic table layout gives every column at
   least its minimum content width, so an unwrappable header becomes the floor
   its column cannot be pushed below, and the columns of prose — which were
   going to wrap anyway — absorb the shortfall. Without it, CONFIDENCE over a
   column of "0.9" broke into CONFIDE / NCE.

   A header past 18 characters is a phrase, so it wraps — between
   words, never inside one. A cell may break inside a word, because one long
   URL should not push a table off the page. */
.jot-demo-out .jot-table-wrap .jot-table { table-layout: auto; }
.jot-demo-out .jot-table th { white-space: nowrap; }
.jot-demo-out .jot-table th[data-wrap] { white-space: normal; }
.jot-demo-out .jot-table td { overflow-wrap: break-word; }

/* Figures in a right-aligned column line up under each other. */
.jot-demo-out .jot-table td[style*="right"] { font-variant-numeric: tabular-nums; }

/* sketch: the table someone drew on the page, rather than the one the page's
   own ruling gave them. Every line is an inset shadow, never a border: a
   border adds a pixel to the row it is on and a table of five rows would hand
   the ruling back five pixels out of phase. The shadows cost no height, so
   every row stays exactly 28px and the paper stays in step. */
.jot-demo-out .jot-table[data-style="sketch"] th,
.jot-demo-out .jot-table[data-style="sketch"] td {
  padding: 0 10px;
  box-shadow: inset -1px 0 0 var(--jot-table-line), inset 0 -1px 0 var(--jot-table-line);
}
.jot-demo-out .jot-table[data-style="sketch"] tr > :first-child {
  box-shadow: inset 1px 0 0 var(--jot-table-line), inset -1px 0 0 var(--jot-table-line), inset 0 -1px 0 var(--jot-table-line);
}
.jot-demo-out .jot-table[data-style="sketch"] thead th {
  box-shadow: inset -1px 0 0 var(--jot-table-line), inset 0 1px 0 var(--jot-table-line), inset 0 -1px 0 var(--jot-table-line);
  color: var(--jot-ink);
}
.jot-demo-out .jot-table[data-style="sketch"] thead tr > :first-child {
  box-shadow: inset 1px 0 0 var(--jot-table-line), inset -1px 0 0 var(--jot-table-line), inset 0 1px 0 var(--jot-table-line), inset 0 -1px 0 var(--jot-table-line);
}
/* A drawn table brings its own grid, so the paper's rules go quiet behind it —
   two sets of horizontal lines at the same pitch read as a printing fault. */
.jot-demo-out[data-mode="notebook"] .jot-body:has(> .jot-table-wrap[data-drawn]) { background-image: none; }
.jot-demo-out[data-mode="doc"] .jot-table-wrap { --jot-table-line: var(--jot-color-doc-sheet-border); }

/* ── Nested blocks ──────────────────────────────────────────────────── */
/* A block inside a block. Chrome is deliberately lighter at depth: a card
   inside a card with the same border and shadow reads as clutter. The nested
   container adds a half-row above so the child is visibly inside its parent,
   and the child's own half-row margin completes the row. */
/* Same discipline as a body cell, for the same reason. `.jot-body > *` only
   normalises DIRECT children, so a nested blockquote kept its browser-default
   16px margin and pushed its parent card 2px off a whole row. flow-root also
   stops the children's margins collapsing out of the container. */
.jot-demo-out .jot-nested { display: flow-root; margin-top: 28px; }
.jot-demo-out .jot-nested > * { margin-top: 0; margin-bottom: 28px; }
.jot-demo-out .jot-nested > :last-child { margin-bottom: 0; }
.jot-demo-out .jot-nested .jot-card {
  box-shadow: none;
  background: var(--jot-surface);
}
.jot-demo-out .jot-nested .jot-card-kicker { font-size: 10px; }

/* ── Callouts: the flavor is the shortcode, so it drives the colour ─── */
.jot-demo-out .jot-callout {
  padding: 13px 18px;
  border-radius: var(--jot-shape-border-radius-base);
  border: 1px solid var(--jot-rule);
  border-left-width: 3px;
  background: var(--jot-surface-elevated);
}
.jot-demo-out .jot-callout .jot-callout-label {
  font-family: var(--jot-font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 28px;
  margin: 0;
}
.jot-demo-out .jot-callout[data-flavor="info"]     { border-left-color: var(--jot-color-accent-slate-blue); }
.jot-demo-out .jot-callout[data-flavor="info"] .jot-callout-label { color: var(--jot-color-accent-slate-blue); }
.jot-demo-out .jot-callout[data-flavor="tip"]      { border-left-color: var(--jot-color-accent-sage); }
.jot-demo-out .jot-callout[data-flavor="tip"] .jot-callout-label { color: var(--jot-color-accent-sage); }
.jot-demo-out .jot-callout[data-flavor="warn"]     { border-left-color: var(--jot-color-accent-terracotta); }
.jot-demo-out .jot-callout[data-flavor="warn"] .jot-callout-label { color: var(--jot-color-accent-terracotta); }
.jot-demo-out .jot-callout[data-flavor="question"] { border-left-color: var(--jot-color-accent-sepia); }
.jot-demo-out .jot-callout[data-flavor="question"] .jot-callout-label { color: var(--jot-color-accent-sepia); }

/* ── @meta: a chip row of document metadata ─────────────────────────── */
/* Row-gap must be 0: when the chips wrap, any gap is added BETWEEN the wrapped
   lines and is not a row multiple, so the whole document below slips off the
   ruling. The 28px line-height already separates the lines. */
.jot-demo-out .jot-meta { display: flex; flex-wrap: wrap; gap: 0 14px; line-height: 28px; }
.jot-demo-out .jot-chip {
  font-family: var(--jot-font-label);
  font-size: 12px;
  color: var(--jot-ink);
  line-height: 28px;
}
.jot-demo-out .jot-chip-key {
  color: var(--jot-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
  margin-right: 6px;
}

/* ── Margin notes ───────────────────────────────────────────────────── */
/* Placed in the grid's second column on the same row as their anchor, so
   vertical alignment falls out of the layout rather than being computed. */
.jot-demo-out .jot-note {
  font-family: var(--jot-font-margin);
  font-size: 18px;
  line-height: 28px;
  color: var(--jot-color-accent-sepia);
  position: relative;
  padding-left: 14px;
}
.jot-demo-out .jot-note::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--jot-rule-offset) - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--jot-layout-margin-tick-color, var(--jot-accent));
}
.jot-demo-out[data-mode="doc"] .jot-note {
  font-family: var(--jot-font-body);
  font-size: 14px;
  font-style: italic;
}

/* A note beside TEXT wraps it (UX-68). The whole block used to narrow for as
   long as it was tall, so one short note beside a long list pulled every
   point in; and the note sat at the top of its row, beside the first point,
   wherever it had been written. Now the note floats inside the text, at the
   line it was written after, as wide as the margin column would have been.
   The lines beside it make room; one row below it they take the full width
   back. A box cannot wrap, so a card, a table or a diagram keeps the column
   and narrows beside it (UX-37). */
.jot-demo-out .jot-row[data-notes="wrap"] > .jot-body { grid-column: 1 / -1; container-type: inline-size; }
.jot-demo-out .jot-row[data-notes="wrap"] > .jot-aside { display: none; }
/* .jot-body in the selector, to outrank .jot-body li > :last-child: in an item
   that is otherwise plain text the note IS the last element, and that rule
   zeroed the row of clearance below it. */
.jot-demo-out .jot-body .jot-note[data-wrap] {
  display: block;
  float: right;
  clear: right;
  box-sizing: border-box;
  width: calc((100cqw - 28px) * 0.23);
  margin: 0 0 28px 28px;
  /* Its own paper, and its gutter's: the rules stop where the text stops, as
     they always have beside a note, and come back below it. */
  background: var(--jot-surface);
  box-shadow: -28px 0 0 var(--jot-surface);
  /* It sits inside a list item or a heading; it keeps its own face. */
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

/* ── Diagnostics surfaced in the output ─────────────────────────────── */
.jot-demo-out .jot-error {
  font-family: var(--jot-font-mono);
  font-size: 13px;
  line-height: 28px;
  color: #b3261e;
  background: #fdecea;
  border-left: 2px solid #b3261e;
  padding: 0 14px;
}

/* ── Print: real A4 pages (ARC-14) ──────────────────────────────────── */
/* Page size and margins live in renderPageCss() (page.ts), because @page cannot
   be scoped. What follows is scoped like everything else. */
@media print {
  /* Browsers drop backgrounds when printing unless told otherwise. Here the
     paper, the ruling and the card fills ARE the document. */
  .jot-demo-out { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* The page is the frame now; its margins come from @page. */
  /* The sheet IS the paper now, so it prints at 1:1 and neither the fit nor
     the reflow applies. Declared here rather than reset by each host: they
     used to carry their own zoom reset, and when the zoom moved onto .jotstak
     the playground went on cancelling it on the wrapper around it, which is
     how printing breaks with nothing on screen changing. */
  .jot-demo-out { --jot-fit: 1; }
  .jot-demo-out .jot-doc { max-width: none; margin: 0; padding: 0; }
  .jot-demo-out[data-mode="doc"] { background: none; padding: 0; }
  .jot-demo-out[data-mode="doc"] .jot-doc { border: 0; box-shadow: none; border-radius: 0; padding: 0; }
  /* A block moves to the next page whole rather than being cut in two… */
  .jot-demo-out .jot-row:has(> .jot-body[data-kind="block"]) { break-inside: avoid; }
  /* …unless it is taller than a page, which the renderer knows and marks. */
  .jot-demo-out .jot-row:has(.jot-figure[data-tall]) { break-inside: auto; }
  /* A heading never ends a page. */
  .jot-demo-out .jot-row:has(> .jot-body[data-kind="heading"]) { break-after: avoid; }
  /* A figure too wide for portrait gets a landscape page of its own. */
  .jot-demo-out .jot-row:has(.jot-figure[data-page="landscape"]) { page: jot-landscape; }
  /* A break the author asked for. Set on the ROW, like the landscape page
     above and for the same reason: a browser honours this on a block in
     normal flow, and the rows are the blocks. The marker itself is hidden —
     the paper has already obeyed it, so printing the label would be printing
     an instruction to the printer. */
  .jot-demo-out .jot-row:has(> .jot-body[data-primitive="pagebreak"]) { break-before: page; }
  .jot-demo-out .jot-pagebreak { display: none; }

  /* Never leave a cover stranded at the foot of a page with its section
     overleaf. That is the one thing a cover must not do. */
  .jot-demo-out .jot-cover { break-after: avoid; break-inside: avoid; }

  /* A wall is one thought. Splitting it across two sheets loses the thought. */
  .jot-demo-out .jot-sticky-wall { break-inside: avoid; }
  /* Backgrounds are the content here, not decoration. */
  .jot-demo-out .jot-sticky { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* A table is the one block that may be TALLER than a page and still has
     to be cut, because the alternative is a mostly-empty sheet. So it breaks
     between rows, never through one, and the header comes with it. */
  .jot-demo-out .jot-row:has(.jot-table) { break-inside: auto; }
  .jot-demo-out .jot-table thead { display: table-header-group; }
  .jot-demo-out .jot-table tr { break-inside: avoid; }
}

/* ── Responsive: below the two-column threshold the margin channel folds
   underneath its anchor rather than being dropped. ─────────────────── */
/* Keyed to the PAGE's own width, not the viewport's, and that is the whole
   point of the rule.

   Every surface shows a whole A4 sheet zoomed to fit (UX-36), so on a phone
   the sheet is still 681.7px wide internally — it is only
   drawn smaller. A viewport query fired anyway, which folded the margin
   channel of a document that had plenty of room for it, and left the notes
   stacked underneath their anchors inside a sheet that was already scaled.
   The worst of both: a layout for a narrow page, shrunk as if it were a wide
   one.

   A container query asks the question that actually matters — how much room
   does this document have — so it stays quiet under a zoom and still fires
   for a host that lets the document reflow instead.

   520px is where the channel stops being able to hold a note: it is
   0.23 of the width less the gutter, which at
   that point is about 113px —
   a couple of words of handwriting. */
@container jot-page (max-width: 520px) {
  .jot-demo-out .jot-row { grid-template-columns: 1fr; }
  .jot-demo-out .jot-body, .jot-demo-out .jot-aside { grid-column: 1; }
  .jot-demo-out .jot-note { padding-left: 28px; margin-bottom: 28px; }
  /* No room to wrap: the folded copy under the block is the one shown. */
  .jot-demo-out .jot-body .jot-note[data-wrap] { display: none; }
  .jot-demo-out .jot-row[data-notes="wrap"] > .jot-aside { display: flow-root; }
}

/* Source above, rendered page below. The two used to sit side by side, which
   left the page about 340px wide — under half a sheet — and every figure is
   measured against a real page (ARC-15), so the docs then scaled them down to
   fit the demo: a split tree reached the reference at 57% of its size, with
   the margin channel folded under its anchor because there was no room for it.
   A demo exists to show what you actually get. Stacked, it is a sheet of A4 at
   very nearly full size, laid out exactly as it prints. */
.jot-demo { margin: 1rem 0 1.5rem; }
.jot-demo-src { margin: 0 0 10px; padding: 12px 14px; font-size: 12.5px; line-height: 20px; border-radius: 6px;
  background: var(--sl-color-gray-6, #f6f6f6); border: 1px solid var(--sl-color-gray-5, #e0e0e0);
  overflow-x: auto; white-space: pre; }
.jot-demo-src code { background: none; padding: 0; font-size: inherit; }
/* Zoomed to fit the column, never past 1:1 — the same fit the playground
   preview uses. No overflow:hidden: if something ever fails to fit it should
   hang over the edge where it can be seen, not be quietly cut. */
.jot-demo-out { border-radius: 6px; border: 1px solid #e4d5be; container-type: inline-size; container-name: jot-host; }
.jot-demo-out > .jotstak { zoom: var(--jot-fit); }
.jot-demo-out .jot-doc { padding-inline: 56px; }
