/* kit.css: the default look of every Sunday page. Stored pages from before 2026-11-14 name it explain.css.
   Tokens and color ramps come from OpenIntelligentUI (MIT, CopilotKit). See ../NOTICE.md.
   The kit is where a page starts, not a rule. A page uses these classes and tokens, and it may add its own styles to
   extend them. A style that uses the tokens (--bg, --p, --s, --link and the ramps) keeps working in light and dark. */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600&family=Spline+Sans+Mono:wght@400;500&display=swap');

/* ─── Tokens ─────────────────────────────────────────────────────── */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg2: #f5f5f4;
  --bg3: #ebebe9;
  --p: #1a1a1a; /* primary text */
  --s: #73726c; /* secondary text */
  --t: #9c9a92; /* tertiary text */
  --b: rgba(0, 0, 0, 0.12); /* hairline border */
  --b2: rgba(0, 0, 0, 0.3); /* strong border */
  --link: #185fa5;

  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Spline Sans Mono', 'SF Mono', ui-monospace, monospace;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --gap: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #141414;
    --bg2: #262626;
    --bg3: #1c1c1c;
    --p: #ececec;
    --s: #a0a0a0;
    --t: #707070;
    --b: rgba(255, 255, 255, 0.14);
    --b2: rgba(255, 255, 255, 0.35);
    --link: #85b7eb;
  }
}
:root[data-theme='light'] {
  color-scheme: light;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #141414;
  --bg2: #262626;
  --bg3: #1c1c1c;
  --p: #ececec;
  --s: #a0a0a0;
  --t: #707070;
  --b: rgba(255, 255, 255, 0.14);
  --b2: rgba(255, 255, 255, 0.35);
  --link: #85b7eb;
}

/* A sheet: the host draws a document as a sheet on a desk (data-page-edge="sheet") and sets data-k-sheet.
   The paper is a step lighter than the page color in light, and a step lighter than the desk in dark. */
:root[data-k-sheet] {
  --bg: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root[data-k-sheet]:not([data-theme='light']) {
    --bg: #1a1a1a;
  }
}
:root[data-k-sheet][data-theme='dark'] {
  --bg: #1a1a1a;
}

/* ─── Color ramps ────────────────────────────────────────────────────
   One class sets four variables. HTML parts and SVG parts both read them.
   --fill: background · --line: border and arrows · --ink: strong text · --sub: weak text */
.c-gray {
  --fill: #f1efe8;
  --line: #5f5e5a;
  --ink: #444441;
  --sub: #5f5e5a;
}
.c-purple {
  --fill: #eeedfe;
  --line: #534ab7;
  --ink: #3c3489;
  --sub: #534ab7;
}
.c-teal {
  --fill: #e1f5ee;
  --line: #0f6e56;
  --ink: #085041;
  --sub: #0f6e56;
}
.c-coral {
  --fill: #faece7;
  --line: #993c1d;
  --ink: #712b13;
  --sub: #993c1d;
}
.c-pink {
  --fill: #fbeaf0;
  --line: #993556;
  --ink: #72243e;
  --sub: #993556;
}
.c-blue {
  --fill: #e6f1fb;
  --line: #185fa5;
  --ink: #0c447c;
  --sub: #185fa5;
}
.c-green {
  --fill: #eaf3de;
  --line: #3b6d11;
  --ink: #27500a;
  --sub: #3b6d11;
}
.c-amber {
  --fill: #faeeda;
  --line: #854f0b;
  --ink: #633806;
  --sub: #854f0b;
}
.c-red {
  --fill: #fcebeb;
  --line: #a32d2d;
  --ink: #791f1f;
  --sub: #a32d2d;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .c-gray {
    --fill: #3f3f3f;
    --line: #b4b4b4;
    --ink: #dcdcdc;
    --sub: #b4b4b4;
  }
  :root:not([data-theme='light']) .c-purple {
    --fill: #3c3489;
    --line: #afa9ec;
    --ink: #cecbf6;
    --sub: #afa9ec;
  }
  :root:not([data-theme='light']) .c-teal {
    --fill: #085041;
    --line: #5dcaa5;
    --ink: #9fe1cb;
    --sub: #5dcaa5;
  }
  :root:not([data-theme='light']) .c-coral {
    --fill: #712b13;
    --line: #f0997b;
    --ink: #f5c4b3;
    --sub: #f0997b;
  }
  :root:not([data-theme='light']) .c-pink {
    --fill: #72243e;
    --line: #ed93b1;
    --ink: #f4c0d1;
    --sub: #ed93b1;
  }
  :root:not([data-theme='light']) .c-blue {
    --fill: #0c447c;
    --line: #85b7eb;
    --ink: #b5d4f4;
    --sub: #85b7eb;
  }
  :root:not([data-theme='light']) .c-green {
    --fill: #27500a;
    --line: #97c459;
    --ink: #c0dd97;
    --sub: #97c459;
  }
  :root:not([data-theme='light']) .c-amber {
    --fill: #633806;
    --line: #ef9f27;
    --ink: #fac775;
    --sub: #ef9f27;
  }
  :root:not([data-theme='light']) .c-red {
    --fill: #791f1f;
    --line: #f09595;
    --ink: #f7c1c1;
    --sub: #f09595;
  }
}
:root[data-theme='dark'] .c-gray {
  --fill: #3f3f3f;
  --line: #b4b4b4;
  --ink: #dcdcdc;
  --sub: #b4b4b4;
}
:root[data-theme='dark'] .c-purple {
  --fill: #3c3489;
  --line: #afa9ec;
  --ink: #cecbf6;
  --sub: #afa9ec;
}
:root[data-theme='dark'] .c-teal {
  --fill: #085041;
  --line: #5dcaa5;
  --ink: #9fe1cb;
  --sub: #5dcaa5;
}
:root[data-theme='dark'] .c-coral {
  --fill: #712b13;
  --line: #f0997b;
  --ink: #f5c4b3;
  --sub: #f0997b;
}
:root[data-theme='dark'] .c-pink {
  --fill: #72243e;
  --line: #ed93b1;
  --ink: #f4c0d1;
  --sub: #ed93b1;
}
:root[data-theme='dark'] .c-blue {
  --fill: #0c447c;
  --line: #85b7eb;
  --ink: #b5d4f4;
  --sub: #85b7eb;
}
:root[data-theme='dark'] .c-green {
  --fill: #27500a;
  --line: #97c459;
  --ink: #c0dd97;
  --sub: #97c459;
}
:root[data-theme='dark'] .c-amber {
  --fill: #633806;
  --line: #ef9f27;
  --ink: #fac775;
  --sub: #ef9f27;
}
:root[data-theme='dark'] .c-red {
  --fill: #791f1f;
  --line: #f09595;
  --ink: #f7c1c1;
  --sub: #f09595;
}

/* The page always paints its own background. A transparent page can show dark-mode text
   on a light host, because the host and the page can read different color schemes. */

/* ─── Base ───────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  background: var(--bg);
}
body {
  margin: 0;
  font: 400 16px/1.6 var(--sans);
  color: var(--p);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 0;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
code,
kbd,
pre {
  font-family: var(--mono);
  font-size: 0.875em;
}
:not(pre) > code {
  background: var(--bg2);
  padding: 1px 5px;
  border-radius: 4px;
}
pre {
  background: var(--bg2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  overflow-x: auto;
  line-height: 1.5;
  margin: 0;
}
strong,
b {
  font-weight: 600;
}
/* A highlight is a soft marker stroke under the text. The text keeps its own color, so the contrast stays as in plain text. */
:root {
  --hl: rgba(250, 204, 21, 0.38);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --hl: rgba(250, 204, 21, 0.26);
  }
}
:root[data-theme='dark'] {
  --hl: rgba(250, 204, 21, 0.26);
}
mark {
  background: var(--hl);
  color: inherit;
  padding: 0 0.1em;
  margin: 0 -0.1em;
  border-radius: 3px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
/* A checklist: <ul class="k-checks"> with <li data-checked="true|false">. The box is drawn by CSS, so the page needs no script. */
ul.k-checks {
  list-style: none;
  padding-left: 0;
}
ul.k-checks ul.k-checks {
  padding-left: 26px;
}
ul.k-checks > li {
  position: relative;
  padding-left: 28px;
}
ul.k-checks > li::before {
  content: '';
  position: absolute;
  left: 1px;
  top: calc(0.8em - 8px);
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 1.5px solid var(--b2);
  border-radius: 5px;
  background: var(--bg) center / 12px 12px no-repeat;
  transition:
    background-color 0.12s,
    border-color 0.12s;
}
ul.k-checks > li[data-checked='true']::before {
  border-color: var(--p);
  background-color: var(--p);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) ul.k-checks > li[data-checked='true']::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23141414' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  }
}
:root[data-theme='dark'] ul.k-checks > li[data-checked='true']::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23141414' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
ul.k-checks > li[data-checked='true'] {
  color: var(--s);
}
ul.k-checks > li[data-checked='false'] {
  color: var(--p);
}
@media (prefers-reduced-motion: reduce) {
  ul.k-checks > li::before {
    transition: none;
  }
}
s,
del,
strike {
  text-decoration-line: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--s);
}
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* ─── Page ───────────────────────────────────────────────────────── */
.k-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 56px;
}
:root[data-host='inline'] .k-page {
  padding: 8px 4px 16px;
}
.k-page > header h1 {
  font-size: 26px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.k-stamp {
  font: 400 13px/1.4 var(--sans);
  color: var(--t);
  margin-top: 6px;
}
.k-lede {
  font-size: 18px;
  line-height: 1.5;
  color: var(--p);
  margin: 16px 0 0;
  max-width: 62ch;
}

.k-claim {
  margin-top: 40px;
}
.k-claim > h2 {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
  margin: 0 0 12px;
  max-width: 60ch;
}
.k-claim > p,
.k-note {
  color: var(--s);
  font-size: 15px;
  margin: 12px 0 0;
  max-width: 64ch;
}
.k-claim > p:first-of-type:not(.k-note) {
  color: var(--p);
}

figure {
  margin: 0;
  min-width: 0;
}
/* Separate exhibits from introductory text without adding space below headings. */
.k-claim > :is(p, ul, ol) + :is(figure, .k-scroll, .k-grid, .k-stats, .k-bars, .k-scale, .k-layers, .k-steps, .k-callout, .k-model) {
  margin-top: 16px;
}
figcaption {
  font-size: 13px;
  color: var(--s);
  margin-top: 8px;
}
/* An image that a person adds in the editor: <img class="k-img k-img-s|m|l" src alt width height>.
   The width and height attributes give the shape before the file loads, so the page does not jump.
   The image never passes the column: s is up to 240 px, m up to 440 px, l is the full column. */
.k-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px 0 0;
  border-radius: var(--r-md);
  box-shadow: 0 0 0 1px var(--b);
}
.k-img-s {
  width: 240px;
}
.k-img-m {
  width: 440px;
}
.k-img-l {
  width: 100%;
}
.k-scroll {
  overflow-x: auto;
}

details.k-more {
  margin-top: 12px;
  border-top: 1px solid var(--b);
  padding-top: 8px;
}
details.k-more > summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--s);
  list-style: none;
}
details.k-more > summary::before {
  content: '+ ';
  font-family: var(--mono);
}
details.k-more[open] > summary::before {
  content: '− ';
}
details.k-more > :not(summary) {
  margin-top: 12px;
}

/* ─── Chips and paths ────────────────────────────────────────────── */
.k-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--fill, var(--bg2));
  color: var(--s);
  border: 0.5px solid var(--b);
  white-space: nowrap;
}
/* Color roles. A colored part uses the hue one time. A tint carries no border, and its text is the page ink.
   .is-solid is the strong form: the full color with the page ground as text. Use it for the one item that needs attention. */
.k-chip[class*='c-'] {
  border-color: transparent;
  color: var(--p);
}
.k-chip.is-solid {
  background: var(--line, var(--p));
  border-color: transparent;
  color: var(--bg);
  font-weight: 600;
}
.k-path {
  font: 400 12px var(--mono);
  color: var(--s);
  overflow-wrap: anywhere;
}

/* ─── Dashboard: a wide page of tiles ─────────────────────────────
   <main class="k-page" data-layout="dashboard"> is a page for numbers that a person checks often: live data blocks and
   other parts, side by side. A document page keeps its reading width of 760 px. A dashboard grows to 1440 px: at that
   width four stat tiles are about 340 px each and two charts about 700 px each, near the width that a chart draws best.
   Wider than that, the eye travels too far across one row. The side margin grows with the window, 16 to 40 px.
   .k-tiles is a grid of 12 columns. A tile spans 6 columns, a stat 3, and a table the full row. data-span="3|4|6|8|12"
   sets another span. The tiles of a row have one height. Narrower windows give two stats to a row and one chart, then
   one column on a phone. */
.k-page[data-layout='dashboard'] {
  max-width: 1440px;
  padding: 28px clamp(16px, 3vw, 40px) 56px;
}
.k-page[data-layout='dashboard'] > header .k-lede {
  font-size: 15px;
  color: var(--s);
  margin-top: 6px;
}
.k-tiles {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
  margin-top: 24px;
}
.k-tiles + .k-tiles {
  margin-top: 16px;
}
/* A heading in the grid names the group of tiles under it. It takes the full row. */
.k-tiles > h2 {
  grid-column: 1 / -1;
  margin: 12px 0 -6px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  color: var(--s);
}
.k-tiles > h2:first-child {
  margin-top: 0;
}
.k-tiles > * {
  grid-column: span 6;
  min-width: 0;
  margin: 0;
}
/* A dataset block has its own margin, set later in this file. In the grid the gap spaces the tiles. */
.k-tiles > .k-data {
  margin: 0;
}
.k-tiles > :is([data-view='stat'], .is-stat) {
  grid-column: span 3;
}
.k-tiles > :is([data-view='table'], .is-wide) {
  grid-column: 1 / -1;
}
.k-tiles > [data-span='3'] {
  grid-column: span 3;
}
.k-tiles > [data-span='4'] {
  grid-column: span 4;
}
.k-tiles > [data-span='6'] {
  grid-column: span 6;
}
.k-tiles > [data-span='8'] {
  grid-column: span 8;
}
.k-tiles > [data-span='12'] {
  grid-column: 1 / -1;
}
/* A tile for a part that has no frame of its own: stats, bars, a table, a flow, a callout. A dataset block is a tile as it is. */
.k-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: inset 0 0 0 0.5px var(--b);
}
.k-tile > h3 {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--p);
}
.k-tile > :is(figure, .k-stats, .k-bars, .k-scroll, .k-callout, .k-steps, .k-layers, .k-scale) {
  margin-top: 0;
}
.k-tile > p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--s);
}
.k-tile > p:last-child {
  margin-bottom: 0;
}
.k-tile .k-stat:first-child:not(.is-solid) {
  padding-left: 0;
}
/* The body of a dataset block fills its tile, so the feet of the tiles in a row line up. */
.k-tiles > figure.k-data .k-data-body,
.k-tile > :last-child {
  flex: 1 1 auto;
}
.k-tiles .k-data-stat > output {
  font-size: 34px;
}
.k-tiles .k-data-scroll {
  max-height: 480px;
}
@media (max-width: 1100px) {
  .k-tiles > :is([data-view='stat'], .is-stat, [data-span='3']) {
    grid-column: span 6;
  }
  .k-tiles > [data-span='4'] {
    grid-column: span 6;
  }
}
@media (max-width: 860px) {
  .k-tiles > :not(:is([data-view='stat'], .is-stat, [data-span='3'])) {
    grid-column: 1 / -1;
  }
}
@media (max-width: 560px) {
  .k-tiles {
    gap: 12px;
  }
  .k-tiles > * {
    grid-column: 1 / -1 !important;
  }
  .k-tiles .k-data-stat > output {
    font-size: 30px;
  }
}

/* ─── Flow diagram (drawn by kit.js from a text spec) ────────── */
.k-flow svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: var(--w, 100%);
  margin: 0 auto;
  overflow: visible;
}
.k-flow .k-err,
.k-err {
  font: 12px/1.5 var(--mono);
  white-space: pre-wrap;
  color: #a32d2d;
  background: #fcebeb;
  padding: 8px 10px;
  border-radius: var(--r-md);
}

/* SVG classes. Hand-drawn SVG uses the same ones. */
svg text {
  font-family: var(--sans);
}
svg text.th {
  font-size: 14px;
  font-weight: 500;
  fill: var(--ink, var(--p));
}
svg text.t {
  font-size: 14px;
  font-weight: 400;
  fill: var(--ink, var(--p));
}
svg text.ts {
  font-size: 12px;
  font-weight: 400;
  fill: var(--sub, var(--s));
}
svg text.tl {
  font-size: 12px;
  font-weight: 400;
  fill: var(--s);
}
svg .box {
  fill: var(--fill, var(--bg2));
  stroke: var(--line, var(--b2));
  stroke-width: 0.75;
}
svg .arr {
  fill: none;
  stroke: var(--s);
  stroke-width: 1.5;
}
svg .arr.dash {
  stroke-dasharray: 5 4;
}
svg .arr.bold {
  stroke-width: 2.25;
  stroke: var(--p);
}
svg .lbl-bg {
  fill: var(--bg);
}
svg .grp {
  fill: none;
  stroke: var(--b2);
  stroke-width: 0.75;
  stroke-dasharray: 3 3;
}
svg .leader {
  fill: none;
  stroke: var(--t);
  stroke-width: 0.75;
  stroke-dasharray: 4 4;
}
svg .mark-new .box {
  stroke-width: 1.75;
}
svg .mark-gone {
  opacity: 0.45;
}
svg .mark-hl .box {
  stroke-width: 2.25;
}

/* ─── Flow look (after diagram-design, MIT, Cathryn Lavery. See ../NOTICE.md) ───
   The flow layout measures a name at 13 px, a sublabel at 11 px mono, an arrow label at 10 px mono caps
   and a zone label at 9.5 px mono caps. Change these sizes only together with the widths in layoutFlow. */
:root {
  --d-accent: #993c1d;
  --d-node: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --d-accent: #f0997b;
    --d-node: var(--bg2);
  }
}
:root[data-theme='dark'] {
  --d-accent: #f0997b;
  --d-node: var(--bg2);
}
.k-flow svg .box {
  fill: var(--fill, var(--d-node));
  stroke: var(--line, color-mix(in srgb, var(--p) 55%, transparent));
  stroke-width: 1;
}
.k-flow svg text.fn {
  font-size: 13px;
  font-weight: 600;
  fill: var(--ink, var(--p));
}
.k-flow svg text.fs {
  font: 400 11px var(--mono);
  fill: var(--sub, var(--s));
}
.k-flow svg .ftag {
  fill: none;
  stroke: var(--line, var(--s));
  stroke-width: 0.75;
  opacity: 0.8;
}
.k-flow svg text.ftt {
  font: 500 8px var(--mono);
  letter-spacing: 0.06em;
  fill: var(--sub, var(--s));
}
.k-flow svg .arr {
  stroke-width: 1.25;
}
.k-flow svg .arr.main {
  stroke: var(--d-accent);
  stroke-width: 1.75;
}
.k-flow svg .fm {
  fill: var(--s);
}
.k-flow svg .fm.main {
  fill: var(--d-accent);
}
.k-flow svg .lbl-bg {
  fill: var(--bg);
}
.k-flow svg text.fl {
  font: 500 10px var(--mono);
  letter-spacing: 0.05em;
  fill: var(--s);
}
.k-flow svg text.fl.main {
  fill: var(--d-accent);
}
.k-flow svg text.fe {
  font: 500 9.5px var(--mono);
  letter-spacing: 0.14em;
  fill: var(--s);
}
.k-flow svg .zone {
  fill: color-mix(in srgb, var(--p) 4.5%, transparent);
}
.k-flow svg .zone-bg {
  fill: color-mix(in srgb, var(--p) 4.5%, var(--bg));
}
.k-flow svg .grp {
  stroke: color-mix(in srgb, var(--p) 30%, transparent);
  stroke-dasharray: 4 3;
}
.k-flow svg .rule {
  stroke: var(--b);
  stroke-width: 1;
}
.k-flow svg text.flg {
  font-size: 11px;
  fill: var(--s);
}
.k-flow svg .fdot {
  fill: color-mix(in srgb, var(--p) 10%, transparent);
}
.k-flow svg .mark-hl .box {
  fill: color-mix(in srgb, var(--d-accent) 10%, var(--bg));
  stroke: var(--d-accent);
  stroke-width: 1.25;
}
.k-flow svg .mark-hl :is(text.fn, text.fs, text.ftt) {
  fill: var(--d-accent);
}
.k-flow svg .mark-hl .ftag {
  stroke: var(--d-accent);
}

/* ─── Diagram templates: <figure class="k-diagram"> ───────────────────
   The templates come from diagram-design (MIT, Cathryn Lavery). See ../NOTICE.md and kit/diagrams.
   kit.js maps each palette color in a template to one of these tokens.
   The figure grows past the text column to 1000 px when the window has room, so 8 px template text draws at 8 px.
   On a narrow window it scrolls sideways inside its own frame. A slide keeps the figure in its own box. */
.k-diagram {
  --d-ink: var(--p);
  --d-muted: var(--s);
  --d-soft: var(--s);
  --d-link: var(--link);
  --d-paper: var(--bg);
  --d-paper-2: var(--bg2);
  --d-ink-2: color-mix(in srgb, var(--d-ink) 80%, var(--d-paper));
  --d-muted-2: color-mix(in srgb, var(--d-muted) 45%, var(--d-paper));
  width: min(1000px, calc(100vw - 32px));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .k-diagram {
    --d-paper-2: var(--bg3);
  }
}
:root[data-theme='dark'] .k-diagram {
  --d-paper-2: var(--bg3);
}
.k-diagram > .k-art {
  overflow-x: auto;
}
.k-diagram > .k-art > svg {
  display: block;
  width: 100%;
  height: auto;
  min-width: var(--d-min, 0);
}
.k-diagram > figcaption {
  max-width: 712px;
  margin-left: auto;
  margin-right: auto;
}
.k-diagram svg text {
  font-family: var(--sans);
}
.k-diagram [font-family*='Mono'] {
  font-family: var(--mono);
}
.k-diagram [font-family*='Serif'] {
  font-family: var(--sans);
}
.k-diagram:not([data-paper='dots']) [fill*='dots)'] {
  display: none;
}
.k-slide .k-diagram {
  width: auto;
  left: auto;
  transform: none;
}
.k-slide .k-diagram > .k-art {
  overflow: visible;
}
.k-slide .k-diagram > .k-art > svg {
  min-width: 0;
}
/* On a figure slide, a flow or a template scales to fit the space under the heading. */
.k-slide[data-layout='figure'] > figure > :is(.k-flow, .k-art) {
  flex: 1;
  min-height: 0;
}
.k-slide[data-layout='figure'] > figure > :is(.k-flow, .k-art) > svg {
  width: 100%;
  height: 100%;
  max-width: none;
}
/* The audit measures each slide again at natural height. A fitted diagram scales instead of clipping, so that pass leaves it out. */
.k-slide.k-natural[data-layout='figure'] > figure > :is(.k-flow, .k-art) {
  display: none;
}

/* ─── Layers: stacked bands for architecture ─────────────────────── */
.k-layers {
  display: grid;
  gap: 6px;
}
.k-layer {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--fill, var(--bg2));
  border: 0.5px solid var(--line, var(--b));
}
.k-layer > b {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, var(--p));
}
.k-layer > b small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--sub, var(--s));
}
.k-layer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.k-layer .k-chip {
  background: var(--bg);
  color: var(--p);
  border-color: var(--line, var(--b));
}

/* ─── Small multiples: one card per case, same parts each time ───── */
.k-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.k-card {
  min-width: 0;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--bg);
  border: 0.5px solid var(--b2);
}
.k-card > h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}
.k-card > p {
  font-size: 14px;
  color: var(--s);
  margin: 6px 0 0;
}
.k-card > .k-chip {
  margin-bottom: 8px;
}
.k-card.c-gray,
.k-card.c-purple,
.k-card.c-teal,
.k-card.c-coral,
.k-card.c-pink,
.k-card.c-blue,
.k-card.c-green,
.k-card.c-amber,
.k-card.c-red {
  background: var(--fill);
  border-color: transparent;
}

/* ─── Scale: a score out of N for each item, with a reason ───────── */
.k-scale {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 2fr);
  gap: 10px 16px;
  align-items: baseline;
}
.k-scale > b {
  font-size: 14px;
  font-weight: 500;
}
.k-scale > span {
  font-size: 14px;
  color: var(--s);
}
.k-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  color: var(--s);
  white-space: nowrap;
}
.k-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid var(--line, var(--s));
  display: inline-block;
}
.k-dots i.on {
  background: var(--line, var(--s));
}

/* ─── Bars and stats: comparisons and highlighted values ─────────── */
.k-bars {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  gap: 8px 12px;
  align-items: center;
}
.k-bars > b {
  font-size: 14px;
  font-weight: 500;
}
.k-bars > span {
  height: 10px;
  border-radius: 5px;
  background: var(--bg3);
  overflow: hidden;
}
.k-bars > span::before {
  content: '';
  display: block;
  height: 100%;
  width: calc(var(--v, 0) * 1%);
  background: var(--line, var(--s));
  border-radius: 5px;
}
.k-bars > output {
  font: 500 13px var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--p);
}
/* A stat has no box. The number takes the hue, and a rule divides the stats. .is-solid gives one stat the full color. */
.k-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  row-gap: 16px;
}
.k-stat {
  padding: 2px 22px;
  border-left: 1px solid var(--b);
}
.k-stat:first-child {
  padding-left: 0;
  border-left: 0;
}
.k-stat > output {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--line, var(--p));
}
.k-stat > span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--s);
}
.k-stat.is-solid {
  padding: 12px 14px;
  margin-right: 22px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--line, var(--p));
}
.k-stat.is-solid + .k-stat {
  padding-left: 0;
  border-left: 0;
}
.k-stat.is-solid > output {
  color: var(--bg);
}
.k-stat.is-solid > span {
  color: color-mix(in srgb, var(--bg) 86%, transparent);
}

/* ─── Table: many rows, same columns ─────────────────────────────── */
.k-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.k-table th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--s);
  padding: 6px 10px;
  border-bottom: 1px solid var(--b2);
}
.k-table td {
  padding: 8px 10px;
  border-bottom: 0.5px solid var(--b);
  vertical-align: top;
}
.k-table td.num,
.k-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.k-table tr:last-child td {
  border-bottom: 0;
}

/* ─── Dataset block: the stored rows of a live dataset ───────────────
   The host gives the rows. kit.js draws a table, bars, lines or one number, and a note for each state with no rows.
   The series colors pass the six checks of the dataviz validator on #fff (light) and #141414 (dark). Three of them are
   under 3:1 on white, so a chart always has a legend or direct labels and a table view. */
.k-data {
  --k-s0: #2a78d6;
  --k-s1: #eb6834;
  --k-s2: #1baf7a;
  --k-s3: #eda100;
  --k-s4: #e87ba4;
  --k-s5: #008300;
  --k-warn: #b87600;
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 20px 0;
  padding: 14px 16px 10px;
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: inset 0 0 0 0.5px var(--b);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .k-data {
    --k-s0: #3987e5;
    --k-s1: #d95926;
    --k-s2: #199e70;
    --k-s3: #c98500;
    --k-s4: #d55181;
    --k-s5: #0ca30c;
    --k-warn: #ef9f27;
  }
}
:root[data-theme='dark'] .k-data {
  --k-s0: #3987e5;
  --k-s1: #d95926;
  --k-s2: #199e70;
  --k-s3: #c98500;
  --k-s4: #d55181;
  --k-s5: #0ca30c;
  --k-warn: #ef9f27;
}
.k-data > figcaption {
  order: -1;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--p);
}
.k-data-body {
  min-width: 0;
  min-height: 64px;
}
/* Loading: before the runtime draws, the block holds its place with a quiet sweep, so the page does not jump. */
.k-data:not([data-state])::after {
  content: '';
  display: block;
  height: 160px;
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--bg2) 0%, var(--bg3) 50%, var(--bg2) 100%) 0 0 / 200% 100%;
  animation: k-data-sweep 1.4s linear infinite;
}
@keyframes k-data-sweep {
  to {
    background-position: -200% 0;
  }
}
.k-data-scroll {
  max-height: 420px;
  overflow: auto;
  margin: 0 -6px;
}
.k-data-scroll:focus-visible,
.k-data-toggle:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.k-data-scroll .k-table th {
  position: sticky;
  top: 0;
  background: var(--bg);
}
.k-data-scroll .k-table td {
  white-space: nowrap;
}
/* A table wider than the block scrolls to the side. A shade at an edge shows that more columns are there, and goes at the end. */
.k-data-scroll {
  background:
    linear-gradient(to right, var(--bg) 30%, transparent) left / 28px 100% no-repeat local,
    linear-gradient(to left, var(--bg) 30%, transparent) right / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--p) 26%, transparent), transparent) left / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--p) 26%, transparent), transparent) right / 14px 100% no-repeat
      scroll;
}
@media (max-width: 560px) {
  .k-data-scroll .k-table {
    font-size: 13px;
  }
  .k-data-scroll .k-table th,
  .k-data-scroll .k-table td {
    padding-left: 7px;
    padding-right: 7px;
  }
}
.k-data .k-data-none {
  color: var(--t);
}
.k-data-plot {
  position: relative;
}
.k-data-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.k-data-svg text {
  font: 11px var(--sans);
  fill: var(--s);
  font-variant-numeric: tabular-nums;
}
.k-data-grid {
  stroke: var(--b);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.k-data-grid.is-base {
  stroke: var(--b2);
}
.k-data-svg .k-data-end {
  fill: var(--p);
  font-weight: 500;
}
.k-data-cross {
  stroke: var(--b2);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.k-data-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.k-data-s0 {
  fill: var(--k-s0);
  stroke: var(--k-s0);
}
.k-data-s1 {
  fill: var(--k-s1);
  stroke: var(--k-s1);
}
.k-data-s2 {
  fill: var(--k-s2);
  stroke: var(--k-s2);
}
.k-data-s3 {
  fill: var(--k-s3);
  stroke: var(--k-s3);
}
.k-data-s4 {
  fill: var(--k-s4);
  stroke: var(--k-s4);
}
.k-data-s5 {
  fill: var(--k-s5);
  stroke: var(--k-s5);
}
path:is(.k-data-s0, .k-data-s1, .k-data-s2, .k-data-s3, .k-data-s4, .k-data-s5) {
  stroke: none;
}
polyline.k-data-line {
  fill: none;
}
.k-data-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--s);
}
.k-data-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.k-data-legend i,
.k-data-tip i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--k-s0);
}
.k-data-legend i.k-data-s1,
.k-data-tip i.k-data-s1 {
  background: var(--k-s1);
}
.k-data-legend i.k-data-s2,
.k-data-tip i.k-data-s2 {
  background: var(--k-s2);
}
.k-data-legend i.k-data-s3,
.k-data-tip i.k-data-s3 {
  background: var(--k-s3);
}
.k-data-legend i.k-data-s4,
.k-data-tip i.k-data-s4 {
  background: var(--k-s4);
}
.k-data-legend i.k-data-s5,
.k-data-tip i.k-data-s5 {
  background: var(--k-s5);
}
.k-data-tip {
  position: absolute;
  top: 0;
  z-index: 2;
  translate: -50% 0;
  display: grid;
  gap: 2px;
  min-width: 96px;
  padding: 7px 9px;
  border-radius: var(--r-md);
  background: var(--bg);
  box-shadow:
    0 0 0 0.5px var(--b2),
    0 4px 14px rgba(0, 0, 0, 0.12);
  font-size: 12px;
  color: var(--p);
  pointer-events: none;
}
.k-data-tip[hidden] {
  display: none;
}
.k-data-tip:not([hidden]) {
  animation: k-data-tip 0.12s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes k-data-tip {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}
/* The bars rise from the base one time, one after another, when the block draws. The bars of the row under the pointer keep
   their color and the rest step back, so the row of the tooltip is plain. */
.k-data-bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: opacity 0.15s;
}
.k-data-svg.is-rise .k-data-bar {
  animation: k-data-rise 0.42s cubic-bezier(0.2, 0, 0, 1) both;
  animation-delay: calc(min(var(--i), 30) * 14ms);
}
@keyframes k-data-rise {
  from {
    transform: scaleY(0);
  }
}
.k-data-svg[data-hi] .k-data-bar:not(.is-hi) {
  opacity: 0.38;
}
.k-data-dot {
  stroke: var(--bg);
  stroke-width: 2;
  paint-order: stroke;
}
.k-data-scroll .k-table tbody tr {
  transition: background-color 0.12s;
}
.k-data-scroll .k-table tbody tr:hover {
  background: var(--bg2);
}
.k-data-toggle {
  transition:
    background-color 0.12s,
    color 0.12s,
    scale 0.12s;
}
.k-data-toggle:active {
  scale: 0.97;
}
.k-data-toggle:disabled {
  opacity: 0.5;
  cursor: default;
}
.k-data-tip b {
  font-weight: 600;
}
.k-data-tip span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--s);
}
.k-data-tip output {
  margin-left: auto;
  padding-left: 10px;
  color: var(--p);
  font-variant-numeric: tabular-nums;
}
.k-data-stat {
  display: grid;
  justify-items: start;
  gap: 2px;
  padding: 4px 0 6px;
}
.k-data-stat > output {
  font-size: 40px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--p);
}
.k-data-stat > span {
  font-size: 13px;
  color: var(--s);
}
.k-data-stat em {
  font-style: normal;
  margin-left: 6px;
  color: var(--p);
}
/* What the number is about, from data-x: one line, cut with an ellipsis, with the full text as its title. */
.k-data-stat > .k-data-about {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 500;
  color: var(--p);
}
.k-data-spark {
  width: 160px;
  height: 32px;
  margin-top: 8px;
  overflow: visible;
}
/* The foot: the time of the rows and the schedule, quiet, and one control for the table view. */
.k-data-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  min-height: 28px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--s);
}
.k-data-foot:empty {
  display: none;
}
.k-data-foot .is-stale::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--k-warn);
  vertical-align: 0;
}
.k-data-toggle {
  margin-left: auto;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--s);
  font: 500 12px var(--sans);
  cursor: pointer;
}
.k-data-toggle:hover {
  background: var(--bg2);
  color: var(--p);
}
.k-data-toggle:active {
  background: var(--bg3);
}
/* The data frame. In the page, the block keeps its frame and its caption, and the frame of the host draws the body and the
   foot. The frame is transparent and has the theme of the page, so the block looks as one piece. The kit sets the height
   of the frame from the one message that the frame sends. */
.k-data.is-framed {
  gap: 0;
}
.k-data-frame {
  display: block;
  width: 100%;
  min-height: 24px;
  border: 0;
  background: transparent;
  transition: height 0.2s cubic-bezier(0.2, 0, 0, 1);
}
@media (prefers-reduced-motion: reduce) {
  .k-data-frame {
    transition: none;
  }
}
:root[data-k-frame],
:root[data-k-frame] body {
  background: transparent;
}
.k-dframe {
  overflow: hidden;
}
.k-data.is-frame {
  margin: 0;
  padding: 0 0 2px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.k-data.is-frame > figcaption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* The mark of the member: two quiet words with a small seal. A block that a page drew by itself has no mark. */
.k-data-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--s);
  white-space: nowrap;
}
.k-data-mark i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: conic-gradient(from 45deg, var(--k-s0), var(--k-s2), var(--k-s3), var(--k-s1), var(--k-s0));
  transform: rotate(45deg) scale(0.86);
}
.k-data-visual {
  position: relative;
  min-height: 64px;
}
.k-data-visual canvas,
.k-data-visual svg {
  display: block;
  max-width: 100%;
}

/* A state with no rows: a glyph and one sentence. Each state has its own glyph, so the state never rests on color. */
.k-data-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 4px 14px;
}
.k-data-note b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--p);
}
.k-data-note p {
  margin: 2px 0 0;
  max-width: 56ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--s);
}
.k-data-glyph {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg2) center / 16px 16px no-repeat;
}
.k-data[data-state='empty'] .k-data-glyph {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2373726c' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 19h16M7 15v4M12 11v8M17 7v12'/%3E%3C/svg%3E");
}
.k-data[data-state='locked'] .k-data-glyph {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2373726c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='9.5' rx='2'/%3E%3Cpath d='M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5'/%3E%3C/svg%3E");
}
.k-data[data-state='failed'] .k-data-glyph {
  background-color: color-mix(in srgb, var(--k-warn) 16%, var(--bg));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23B87600' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17v.01'/%3E%3C/svg%3E");
}
.k-data[data-state='offline'] .k-data-glyph {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2373726c' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M3 12h4l3-7 4 14 3-7h4'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) {
  .k-data:not([data-state])::after,
  .k-data-svg.is-rise .k-data-bar,
  .k-data-tip:not([hidden]) {
    animation: none;
  }
  .k-data-bar,
  .k-data-toggle,
  .k-data-scroll .k-table tbody tr {
    transition: none;
  }
  .k-data-toggle:active {
    scale: none;
  }
}

/* ─── Callout: one fact the reader must not miss ─────────────────── */
.k-callout {
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 15px;
  background: var(--fill, var(--bg2));
  color: var(--p);
  border: 0.5px solid var(--b);
}
.k-callout[class*='c-'] {
  border-color: transparent;
}

/* ─── Model: inputs the reader moves, outputs that follow ────────── */
.k-model {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 0.5px solid var(--b2);
}
@media (max-width: 560px) {
  .k-model {
    grid-template-columns: minmax(0, 1fr);
  }
}
.k-in {
  display: grid;
  gap: 14px;
  align-content: start;
}
.k-in label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--s);
}
.k-in label > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.k-in label output {
  font: 500 13px var(--mono);
  color: var(--p);
  font-variant-numeric: tabular-nums;
}
.k-out {
  display: grid;
  gap: 10px;
  align-content: start;
}
input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--bg3);
  outline: none;
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--b2);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}
input[type='range']::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--b2);
  cursor: pointer;
}
button {
  font: 500 13px var(--sans);
  color: var(--p);
  background: transparent;
  padding: 6px 14px;
  border-radius: var(--r-md);
  border: 0.5px solid var(--b2);
  cursor: pointer;
}
button:hover {
  background: var(--bg2);
}

/* Scroll bars float: a thin rounded thumb and no track, on every scrolling element. */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
  background: transparent;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--p) 24%, transparent) padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in srgb, var(--p) 40%, transparent);
}
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--p) 25%, transparent) transparent;
  }
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ─── Steps: a process the reader moves through one stage at a time ─ */
.k-steps {
  border: 0.5px solid var(--b2);
  border-radius: var(--r-lg);
  padding: 16px;
}
.k-steps > .k-step {
  display: none;
}
.k-steps > .k-step.on {
  display: block;
}
.k-steps > .k-step > h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 8px;
}
.k-steps > .k-step > p {
  font-size: 14px;
  color: var(--s);
  margin: 8px 0 0;
}
.k-steps nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.k-steps nav .k-pos {
  font: 12px var(--mono);
  color: var(--t);
  margin-left: auto;
}
.no-js .k-steps > .k-step {
  display: block;
  margin-bottom: 16px;
}

/* ─── Mermaid (only for sequence and state diagrams) ─────────────── */
pre.mermaid {
  background: transparent;
  padding: 0;
  text-align: center;
  font-family: var(--sans);
}

/* ─── Motion ─────────────────────────────────────────────────────── */
@keyframes k-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.k-page > * {
  animation: k-in 0.35s ease-out both;
}
.k-page > *:nth-child(2) {
  animation-delay: 0.05s;
}
.k-page > *:nth-child(3) {
  animation-delay: 0.1s;
}
.k-page > *:nth-child(n + 4) {
  animation-delay: 0.15s;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 560px) {
  .k-layer {
    grid-template-columns: minmax(0, 1fr);
  }
  .k-scale {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .k-scale > span {
    grid-column: 1 / -1;
    margin-top: -6px;
  }
}

/* Dark mode: large colored areas use a softer mix, so a page of cards does not glare.
   Chips and diagram nodes keep the full ramp. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light'])
    :is(.k-card[class*='c-'], .k-layer, .k-callout):not(:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) *) {
    background: color-mix(in srgb, var(--fill, var(--bg2)) 45%, var(--bg2));
  }
}
:root[data-theme='dark'] :is(.k-card[class*='c-'], .k-layer, .k-callout):not(:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) *) {
  background: color-mix(in srgb, var(--fill, var(--bg2)) 45%, var(--bg2));
}

/* ─── Deck: a 1920×1080 canvas for each slide, scaled and never reflowed ───
   kit.js wraps each .k-slide in a .k-frame and sets --k-s, the scale for the current view.
   <html data-k-view> is slide or scroll. <html data-k-rail> shows the thumbnails. */
:root {
  --k-s: 0.5;
} /* kit.js sets the real scale on <html> */
.k-deck {
  page: deck;
}
@page deck {
  size: 1920px 1080px;
  margin: 0;
}
.k-frame {
  position: relative;
  width: calc(1920px * var(--k-s));
  height: calc(1080px * var(--k-s));
}
.k-slide {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  width: 1920px;
  height: 1080px;
  padding: 96px 128px;
  display: flex;
  flex-direction: column;
  transform: scale(var(--k-s));
  transform-origin: 0 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--p);
  font-size: 44px;
  line-height: 1.4;
}
.k-slide.k-natural {
  height: auto !important;
  max-height: none !important;
}
.k-slide h1 {
  font-size: 128px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 18ch;
  text-wrap: balance;
}
.k-slide > h2 {
  font-size: 76px;
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 56px;
  max-width: 26ch;
  text-wrap: balance;
}
.k-slide h3 {
  font-size: 52px;
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 16px;
}
.k-slide p,
.k-slide li {
  font-size: 44px;
  line-height: 1.4;
  color: var(--p);
  max-width: 44ch;
  margin: 0 0 24px;
}
.k-slide ul,
.k-slide ol {
  margin: 0;
  padding-left: 1.1em;
}
.k-slide li::marker {
  color: var(--t);
}
.k-slide .k-stamp {
  font-size: 28px;
  margin-top: 40px;
}
.k-slide .k-lede {
  font-size: 52px;
  line-height: 1.35;
  color: var(--s);
  margin-top: 40px;
  max-width: 32ch;
}
.k-slide .k-note,
.k-slide figcaption {
  color: var(--s);
}
/* .k-slide p sets margin-top to 0, so a note needs its own gap below an exhibit. A caption sits inside the 2.5x zoom, so 16px draws as 40px. */
.k-slide > .k-note {
  margin-top: 40px;
}
.k-slide figure > figcaption {
  margin-top: 16px;
}
/* Kit exhibits are sized for a 760 px page. On a slide they draw at 2.5 times that size. */
.k-slide
  :is(
    figure,
    .k-scroll,
    .k-table,
    .k-grid,
    .k-layers,
    .k-stats,
    .k-bars,
    .k-scale,
    .k-callout,
    .k-model,
    .k-steps,
    .k-flow,
    pre,
    .k-chip
  ):not(:is(figure, .k-scroll, .k-table, .k-grid, .k-layers, .k-stats, .k-bars, .k-scale, .k-callout, .k-model, .k-steps, .k-flow, pre) *) {
  zoom: 2.5;
}
.k-build {
  transition: opacity 0.2s;
}
/* The builds on the current slide keep their own layer, so a fade does not move the slide to a new layer and back. */
:root[data-k-view='slide'] .k-frame.k-cur .k-build {
  will-change: opacity;
}
.k-build:not(.on) {
  opacity: 0;
}

/* Layouts: data-layout on each slide. */
.k-slide:is([data-layout='title'], [data-layout='section'], [data-layout='statement'], [data-layout='quote']) {
  justify-content: center;
}
.k-slide[data-layout='section'] > h2 {
  font-size: 104px;
  max-width: 20ch;
  margin: 0;
}
.k-slide[data-layout='section'] > p {
  color: var(--s);
  margin-top: 32px;
}
.k-slide[data-layout='statement'] > h2 {
  font-size: 96px;
  max-width: 24ch;
}
.k-slide[data-layout='statement'] > p {
  font-size: 48px;
  color: var(--s);
  max-width: 40ch;
}
.k-slide[data-layout='split'] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 96px;
  align-content: start;
}
.k-slide[data-layout='split'] > h2 {
  grid-column: 1 / -1;
}
.k-slide[data-layout='split'] > * > :first-child {
  margin-top: 0;
}
/* A card that is a direct child of a slide draws at the slide scale. It takes the height of its text and not the height of the slide. */
.k-slide > .k-card {
  padding: 36px 40px;
  border-radius: 24px;
  align-self: start;
}
.k-slide > .k-card > h3 {
  margin: 0 0 12px;
}
.k-slide > .k-card > p {
  margin: 0;
}
.k-slide[data-layout='figure'] > figure {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.k-slide[data-layout='figure'] > figure > :is(img, svg) {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.k-slide[data-layout='stat'] .k-stat > output {
  font-size: 48px;
}
.k-slide[data-layout='quote'] > blockquote {
  font-size: 80px;
  line-height: 1.3;
  font-weight: 500;
  margin: 0;
  padding-left: 48px;
  border-left: 6px solid var(--b2);
  max-width: 28ch;
}
.k-slide[data-layout='quote'] > p {
  color: var(--s);
  font-size: 36px;
  margin-top: 40px;
  padding-left: 54px;
}
.k-slide[data-layout='code'] > pre {
  line-height: 1.45;
}

/* Free boxes: <div class="k-box" style="left:..px;top:..px;width:..px;height:..px"> as a direct child of a slide. The units
   are frame pixels from the top-left corner of the 1920×1080 frame. A box never clips or shrinks its text: the audit
   reports text that does not fit. Source order is the reading order. A .k-box anywhere else is a plain block. */
.k-slide > .k-box {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  overflow: visible;
}
.k-slide > .k-box > :first-child {
  margin-top: 0;
}
.k-slide > .k-box > :last-child {
  margin-bottom: 0;
}
.k-slide > .k-box :is(p, li, h1, h2, h3, h4, blockquote) {
  max-width: none;
}
.k-slide > .k-box h1 {
  font-size: 128px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}
.k-slide > .k-box h2 {
  font-size: 76px;
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
}
.k-slide > .k-box h3 {
  font-size: 52px;
  line-height: 1.2;
  font-weight: 600;
  margin: 0 0 16px;
}
.k-slide > .k-box h4 {
  font-size: 44px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0 0 12px;
}

/* The deck viewer: a canvas with the slide on it as a sheet, a sidebar of thumbnails, and a floating toolbar. */
:root {
  --k-canvas: #e8e6df;
  --k-sheet: 0 0 0 0.5px rgba(0, 0, 0, 0.14), 0 1px 2px rgba(0, 0, 0, 0.06), 0 6px 20px rgba(0, 0, 0, 0.05);
  --k-bar: 64px;
  --k-rail: 0px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --k-canvas: #222222;
    --k-sheet: 0 0 0 0.5px rgba(255, 255, 255, 0.14);
  }
}
:root[data-theme='dark'] {
  --k-canvas: #222222;
  --k-sheet: 0 0 0 0.5px rgba(255, 255, 255, 0.14);
}
.k-frame {
  box-shadow: var(--k-sheet);
}
:root[data-k-view],
:root[data-k-view] body {
  background: var(--k-canvas);
}

/* Slide view: one slide centered on the canvas, above the toolbar. */
:root[data-k-view='slide'] {
  overflow: hidden;
}
:root[data-k-view='slide'] .k-deck {
  position: fixed;
  top: 0;
  right: 0;
  bottom: var(--k-bar);
  left: var(--k-rail);
  background: var(--k-canvas);
}
:root[data-k-view='slide'] .k-frame {
  position: absolute;
  visibility: hidden;
  left: var(--k-fx, 0);
  top: var(--k-fy, 0);
}
:root[data-k-view='slide'] .k-frame.k-cur {
  visibility: visible;
}

/* Present: the slide alone on black. The toolbar shows while the pointer moves. */
:root[data-k-present],
:root[data-k-present] :is(body, .k-deck) {
  background: #000;
}
:root[data-k-present] .k-frame {
  box-shadow: none;
}
:root[data-k-present]:not(.k-awake) {
  cursor: none;
}

/* Thumbnails: the sidebar of all slides, next to either view. The thumbnails fill its width, so a scroll bar only narrows them. */
.k-rail {
  display: none;
}
:root[data-k-rail] .k-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: fixed;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 0;
  width: 216px;
  box-sizing: border-box;
  padding: 12px 10px 16px 4px;
  overflow: hidden auto;
  background: var(--bg);
  border-right: 0.5px solid var(--b);
}
.k-thumb {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}
.k-thumb:hover {
  background: none;
}
.k-tnum {
  font: 500 11.5px var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--t);
  text-align: right;
  padding-top: 1px;
}
.k-tframe {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 3px;
  box-shadow: 0 0 0 0.5px var(--b2);
}
.k-tframe > .k-slide {
  transform: scale(var(--k-ts, 0.09));
  pointer-events: none;
}
.k-thumb:hover .k-tframe {
  box-shadow: 0 0 0 1px var(--s);
}
.k-thumb.k-cur .k-tframe,
.k-thumb:focus-visible .k-tframe {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--link);
}
.k-thumb:focus-visible {
  outline: none;
}
.k-thumb.k-cur .k-tnum {
  color: var(--link);
  font-weight: 600;
}

/* Document: the slides in one column, read top to bottom. */
:root[data-k-view='scroll'] body {
  padding-left: var(--k-rail);
}
:root[data-k-view='scroll'] .k-deck {
  width: calc(1920px * var(--k-s));
  margin: 0 auto;
  padding: 32px 0 calc(var(--k-bar) + 40px);
}
:root[data-k-view='scroll'] .k-frame {
  margin-bottom: 28px;
}

/* The toolbar floats over the canvas, centered under the slide: thumbnails, then the arrows around one tick for each slide. */
.k-deck-bar {
  display: none;
}
:root[data-k-view] .k-deck-bar {
  position: fixed;
  z-index: 3;
  bottom: 14px;
  left: var(--k-bx, calc(var(--k-rail) + (100% - var(--k-rail)) / 2));
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 40px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 12px;
  background: var(--bg);
  box-shadow:
    0 0 0 0.5px var(--b2),
    0 4px 16px rgba(0, 0, 0, 0.08);
}
.k-bt {
  display: contents;
}
.k-sep {
  width: 0.5px;
  height: 18px;
  margin: 0 4px;
  background: var(--b2);
}
.k-ib {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: var(--s);
  background: transparent;
}
.k-ib:hover,
.k-ib[aria-pressed='true'] {
  color: var(--p);
  background: color-mix(in srgb, var(--p) 8%, transparent);
}
.k-ib:disabled {
  opacity: 0.3;
  cursor: default;
  background: none;
}
.k-ib:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 0;
}
.k-deck-bar [data-tip] {
  position: relative;
}
.k-deck-bar [data-tip]:hover::after,
.k-deck-bar [data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  translate: -50% 0;
  z-index: 4;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--p);
  color: var(--bg);
  font: 500 11.5px/1.2 var(--sans);
  white-space: pre;
  pointer-events: none;
  animation: k-tip 0.12s 0.4s both;
}
.k-deck-bar [data-tip-end]:hover::after,
.k-deck-bar [data-tip-end]:focus-visible::after {
  left: auto;
  right: 0;
  translate: none;
}
.k-deck-bar .k-bt [data-tip]:hover::after,
.k-deck-bar .k-bt [data-tip]:focus-visible::after {
  left: 0;
  translate: none;
}
@keyframes k-tip {
  from {
    opacity: 0;
  }
}
.k-ib svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.k-pos {
  min-width: 40px;
  padding: 0 8px 0 2px;
  text-align: right;
  font: 500 12.5px var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--s);
}
/* Ticks: future slides faint, past slides darker, the current slide in the accent. Title and section slides stand taller. */
.k-ticks {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 2px;
}
.k-tick {
  position: relative;
  width: 10px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  cursor: pointer;
}
.k-tick:hover {
  background: none;
}
.k-tick::before {
  content: '';
  position: absolute;
  left: 2.5px;
  right: 2.5px;
  top: 50%;
  height: 11px;
  translate: 0 -50%;
  border-radius: 2px;
  background: color-mix(in srgb, var(--p) 22%, transparent);
}
.k-tick.k-tall::before {
  height: 16px;
}
.k-tick.k-past::before {
  background: color-mix(in srgb, var(--p) 48%, transparent);
}
.k-tick:hover::before {
  background: color-mix(in srgb, var(--p) 62%, transparent);
}
/* The current tick fills from the bottom as its builds appear. */
.k-tick.k-cur::before {
  background: linear-gradient(to top, var(--link) var(--k-f, 100%), color-mix(in srgb, var(--link) 28%, transparent) var(--k-f, 100%));
}
.k-long {
  display: flex;
  align-items: center;
  width: 160px;
  height: 24px;
  padding: 0;
  margin: 0 6px;
  cursor: pointer;
  background: linear-gradient(color-mix(in srgb, var(--p) 16%, transparent), color-mix(in srgb, var(--p) 16%, transparent)) center / 100%
    4px no-repeat;
}
.k-fill {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: var(--link);
}
:root[data-k-present] .k-deck-bar {
  left: 50%;
  bottom: 24px;
  background: rgba(28, 28, 28, 0.9);
  box-shadow: none;
  opacity: 0;
  transition: opacity 0.2s;
}
:root[data-k-present].k-awake .k-deck-bar,
:root[data-k-present] .k-deck-bar:focus-within {
  opacity: 1;
}
:root[data-k-present] .k-deck-bar .k-bt {
  display: none;
}
:root[data-k-present] :is(.k-ib, .k-pos) {
  color: #d8d8d8;
}
:root[data-k-present] .k-ib:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
:root[data-k-present] .k-tick::before {
  background: rgba(255, 255, 255, 0.2);
}
:root[data-k-present] .k-tick.k-past::before {
  background: rgba(255, 255, 255, 0.5);
}
:root[data-k-present] .k-tick.k-cur::before {
  background: linear-gradient(to top, #fff var(--k-f, 100%), rgba(255, 255, 255, 0.3) var(--k-f, 100%));
}
/* On a phone, the ticks and the progress line hide, and the position sits between the arrows. */
@media (max-width: 600px) {
  .k-ticks {
    display: none;
  }
  .k-deck-bar [data-go='-1'] {
    order: 1;
  }
  .k-deck-bar .k-pos {
    order: 2;
    min-width: 48px;
    padding: 0 2px;
    text-align: center;
  }
  .k-deck-bar [data-go='1'] {
    order: 3;
  }
}
@media (max-width: 700px) {
  .k-bt {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .k-build,
  :root[data-k-present] .k-deck-bar {
    transition: none;
  }
  .k-deck-bar [data-tip]::after {
    animation: none;
  }
}

/* ─── Slide theme ────────────────────────────────────────────────────
   The host sets <html data-k-slide-theme="light|dark"> when a deck keeps its own theme. Only the slides and their
   thumbnails take that theme. The rail, the stage and the bar follow data-theme: the appearance of the app. */
:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) {
  color-scheme: light;
  color: var(--p);
  --bg: #ffffff;
  --bg2: #f5f5f4;
  --bg3: #ebebe9;
  --p: #1a1a1a;
  --s: #73726c;
  --t: #9c9a92;
  --b: rgba(0, 0, 0, 0.12);
  --b2: rgba(0, 0, 0, 0.3);
  --link: #185fa5;
  --d-accent: #993c1d;
  --d-node: #ffffff;
}
:root[data-k-slide-theme='dark'] :is(.k-frame, .k-tframe) {
  color-scheme: dark;
  color: var(--p);
  --bg: #141414;
  --bg2: #262626;
  --bg3: #1c1c1c;
  --p: #ececec;
  --s: #a0a0a0;
  --t: #707070;
  --b: rgba(255, 255, 255, 0.14);
  --b2: rgba(255, 255, 255, 0.35);
  --link: #85b7eb;
  --d-accent: #f0997b;
  --d-node: var(--bg2);
}
:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) .c-gray {
  --fill: #f1efe8;
  --line: #5f5e5a;
  --ink: #444441;
  --sub: #5f5e5a;
}
:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) .c-purple {
  --fill: #eeedfe;
  --line: #534ab7;
  --ink: #3c3489;
  --sub: #534ab7;
}
:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) .c-teal {
  --fill: #e1f5ee;
  --line: #0f6e56;
  --ink: #085041;
  --sub: #0f6e56;
}
:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) .c-coral {
  --fill: #faece7;
  --line: #993c1d;
  --ink: #712b13;
  --sub: #993c1d;
}
:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) .c-pink {
  --fill: #fbeaf0;
  --line: #993556;
  --ink: #72243e;
  --sub: #993556;
}
:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) .c-blue {
  --fill: #e6f1fb;
  --line: #185fa5;
  --ink: #0c447c;
  --sub: #185fa5;
}
:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) .c-green {
  --fill: #eaf3de;
  --line: #3b6d11;
  --ink: #27500a;
  --sub: #3b6d11;
}
:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) .c-amber {
  --fill: #faeeda;
  --line: #854f0b;
  --ink: #633806;
  --sub: #854f0b;
}
:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) .c-red {
  --fill: #fcebeb;
  --line: #a32d2d;
  --ink: #791f1f;
  --sub: #a32d2d;
}
:root[data-k-slide-theme='dark'] :is(.k-frame, .k-tframe) .c-gray {
  --fill: #3f3f3f;
  --line: #b4b4b4;
  --ink: #dcdcdc;
  --sub: #b4b4b4;
}
:root[data-k-slide-theme='dark'] :is(.k-frame, .k-tframe) .c-purple {
  --fill: #3c3489;
  --line: #afa9ec;
  --ink: #cecbf6;
  --sub: #afa9ec;
}
:root[data-k-slide-theme='dark'] :is(.k-frame, .k-tframe) .c-teal {
  --fill: #085041;
  --line: #5dcaa5;
  --ink: #9fe1cb;
  --sub: #5dcaa5;
}
:root[data-k-slide-theme='dark'] :is(.k-frame, .k-tframe) .c-coral {
  --fill: #712b13;
  --line: #f0997b;
  --ink: #f5c4b3;
  --sub: #f0997b;
}
:root[data-k-slide-theme='dark'] :is(.k-frame, .k-tframe) .c-pink {
  --fill: #72243e;
  --line: #ed93b1;
  --ink: #f4c0d1;
  --sub: #ed93b1;
}
:root[data-k-slide-theme='dark'] :is(.k-frame, .k-tframe) .c-blue {
  --fill: #0c447c;
  --line: #85b7eb;
  --ink: #b5d4f4;
  --sub: #85b7eb;
}
:root[data-k-slide-theme='dark'] :is(.k-frame, .k-tframe) .c-green {
  --fill: #27500a;
  --line: #97c459;
  --ink: #c0dd97;
  --sub: #97c459;
}
:root[data-k-slide-theme='dark'] :is(.k-frame, .k-tframe) .c-amber {
  --fill: #633806;
  --line: #ef9f27;
  --ink: #fac775;
  --sub: #ef9f27;
}
:root[data-k-slide-theme='dark'] :is(.k-frame, .k-tframe) .c-red {
  --fill: #791f1f;
  --line: #f09595;
  --ink: #f7c1c1;
  --sub: #f09595;
}
:root[data-k-slide-theme='light'] :is(.k-frame, .k-tframe) .k-diagram {
  --d-paper-2: var(--bg2);
}
:root[data-k-slide-theme='dark'] :is(.k-frame, .k-tframe) .k-diagram {
  --d-paper-2: var(--bg3);
}
:root[data-k-slide-theme='dark'] :is(.k-frame, .k-tframe) :is(.k-card[class*='c-'], .k-layer, .k-callout) {
  background: color-mix(in srgb, var(--fill, var(--bg2)) 45%, var(--bg2));
}

/* The audit marks a slide that overflows. #…&audit shows the marks; thumbnails never do. */
:root[data-k-audit='show'] .k-slide[data-k-overflow] {
  outline: 8px solid #a32d2d;
  outline-offset: -8px;
}
:root[data-k-audit='show'] .k-slide[data-k-overflow]::after {
  content: attr(data-k-overflow);
  position: absolute;
  top: 16px;
  right: 16px;
  font: 500 24px var(--mono);
  color: #fff;
  background: #a32d2d;
  padding: 6px 12px;
  border-radius: 6px;
}

/* Without JavaScript, a deck reads as a document at half size. */
.no-js .k-deck {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 0;
}
.no-js .k-slide {
  position: static;
  transform: none;
  height: auto;
  zoom: 0.5;
  border-bottom: 2px solid var(--b);
}
.no-js .k-build {
  opacity: 1;
}
/* A slide with boxes keeps its frame, so each box stays in its place. */
.no-js .k-slide:has(> .k-box) {
  position: relative;
  width: 1920px;
  height: 1080px;
  overflow: hidden;
}

/* ─── Presence: the cursor of an assistant that edits the page ────────
   kit.js adds these elements only when the host viewer asks. Each assistant has one color, in both themes.
   .k-pr scrolls with the page and holds the highlights and the carets. .k-pr-dock stays at the top of the window
   and holds a cursor that has no place in the text. .k-pr-new is the preview of the new text, inside the page text. */
.k-pr,
.k-pr-dock,
.k-pr-new {
  --c: #9e4119;
  --c-on: #fff;
}
:is(.k-pr-cur, .k-pr-box, .k-pr-new)[data-agent='chatgpt'] {
  --c: #096b54;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) :is(.k-pr, .k-pr-dock, .k-pr-new) {
    --c: #f0997b;
    --c-on: #1a1a1a;
  }
  :root:not([data-theme='light']) :is(.k-pr-cur, .k-pr-box, .k-pr-new)[data-agent='chatgpt'] {
    --c: #5dcaa5;
  }
}
:root[data-theme='dark'] :is(.k-pr, .k-pr-dock, .k-pr-new) {
  --c: #f0997b;
  --c-on: #1a1a1a;
}
:root[data-theme='dark'] :is(.k-pr-cur, .k-pr-box, .k-pr-new)[data-agent='chatgpt'] {
  --c: #5dcaa5;
}
.k-pr {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.k-pr-dock {
  position: fixed;
  z-index: 6;
  top: 12px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}
.k-pr-hl {
  position: absolute;
  border-radius: 3px;
  background: color-mix(in srgb, var(--c) 20%, transparent);
  animation: k-pr-in 0.24s ease-out;
}
.k-pr-hl.k-pr-old {
  background: color-mix(in srgb, var(--c) 8%, transparent);
  animation: none;
}
.k-pr-hl.k-pr-flash {
  background: color-mix(in srgb, var(--c) 24%, transparent);
  animation: k-pr-flash 2s ease-out forwards;
}
@keyframes k-pr-in {
  from {
    opacity: 0;
  }
}
@keyframes k-pr-flash {
  0%,
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.k-pr-cur {
  position: absolute;
  top: 0;
  left: 0;
  font: 600 11.5px/1 var(--sans);
  letter-spacing: 0;
  color: var(--c-on);
  transition: opacity 0.3s;
}
.k-pr-cur.k-pr-out {
  opacity: 0;
}
.k-pr-cur.k-pr-fade {
  animation: k-pr-flash 2s ease-out forwards;
}
.k-pr-bar {
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: -1px;
  width: 2px;
  border-radius: 1px;
  background: var(--c);
}
.k-pr-flag {
  position: absolute;
  left: -1px;
  bottom: calc(100% + 1px);
  display: flex;
  align-items: center;
  gap: 5px;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px 5px 5px 0;
  background: var(--c);
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.k-pr-low .k-pr-flag {
  top: calc(100% + 1px);
  bottom: auto;
  border-radius: 0 5px 5px 5px;
}
.k-pr-flag b {
  font-weight: 600;
}
.k-pr-flag svg {
  display: none;
  width: 11px;
  height: 11px;
  fill: currentColor;
}
.k-pr-verb {
  font-weight: 500;
  opacity: 0.85;
}
.k-pr-verb:empty {
  display: none;
}
.k-pr-cur[data-mode='dock'] {
  position: static;
}
.k-pr-cur[data-mode='dock'] .k-pr-bar {
  display: none;
}
.k-pr-cur[data-mode='dock'] .k-pr-flag {
  position: static;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  animation: k-pr-float 1.6s ease-in-out infinite alternate;
}
.k-pr-cur[data-mode='dock'] .k-pr-flag svg {
  display: block;
}
@keyframes k-pr-float {
  to {
    translate: 0 3px;
  }
}
/* The preview of an edit, in place: the new text types in where the old text starts, and the old text fades and gives up its room. */
.k-pr-new {
  border-radius: 2px;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: inherit;
  text-decoration: none;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.k-pr-was {
  opacity: 0.3;
  transition: opacity 0.4s ease-out;
}
@starting-style {
  .k-pr-was {
    opacity: 1;
  }
}

/* In the host viewer, the viewer scrolls the page, and the bar of the viewer names an assistant that has no place in the text. */
:root[data-k-host] {
  overflow: hidden;
}
:root[data-k-host] .k-pr-dock {
  display: none;
}

/* ─── Comments: the text that a comment is about ───────────────────
   The host viewer draws the comments outside the page. The page marks only the text: with the CSS Custom Highlight API,
   or with boxes in .k-cm in a browser that does not have it. The amber is not a color of an assistant.
   -on is the mark of the comment that is open, under the pointer, or not sent yet. */
::highlight(k-cm) {
  background-color: rgba(246, 190, 52, 0.3);
}
::highlight(k-cm-on) {
  background-color: rgba(246, 190, 52, 0.66);
}
.k-cm {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.k-cm-hl {
  position: absolute;
  border-radius: 2px;
  background: rgba(246, 190, 52, 0.3);
  mix-blend-mode: multiply;
}
.k-cm-hl.on {
  background: rgba(246, 190, 52, 0.66);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) ::highlight(k-cm) {
    background-color: rgba(246, 190, 52, 0.22);
  }
  :root:not([data-theme='light']) ::highlight(k-cm-on) {
    background-color: rgba(246, 190, 52, 0.46);
  }
  :root:not([data-theme='light']) .k-cm-hl {
    background: rgba(246, 190, 52, 0.22);
    mix-blend-mode: normal;
  }
  :root:not([data-theme='light']) .k-cm-hl.on {
    background: rgba(246, 190, 52, 0.46);
  }
}
:root[data-theme='dark'] ::highlight(k-cm) {
  background-color: rgba(246, 190, 52, 0.22);
}
:root[data-theme='dark'] ::highlight(k-cm-on) {
  background-color: rgba(246, 190, 52, 0.46);
}
:root[data-theme='dark'] .k-cm-hl {
  background: rgba(246, 190, 52, 0.22);
  mix-blend-mode: normal;
}
:root[data-theme='dark'] .k-cm-hl.on {
  background: rgba(246, 190, 52, 0.46);
}
:root.k-cm-over {
  cursor: pointer;
}
/* A deck: the number of comments on the thumbnail of each slide, and a dot over its tick. */
.k-cmn {
  position: absolute;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e5a823;
  color: #1a1a1a;
  font: 600 10px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.k-thumb > .k-cmn {
  top: 20px;
  left: 3px;
}
.k-tick > .k-cmn {
  top: 0;
  left: 50%;
  translate: -50% 0;
  min-width: 0;
  width: 5px;
  height: 5px;
  padding: 0;
  overflow: hidden;
  color: transparent;
}

@media print {
  html,
  body {
    background: none;
  }
  :root {
    --k-s: 1 !important;
    overflow: visible !important;
  }
  .k-deck {
    position: static !important;
    display: block !important;
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .k-frame {
    position: relative !important;
    visibility: visible !important;
    translate: none !important;
    left: auto !important;
    top: auto !important;
    width: 1920px !important;
    height: 1080px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    break-after: page;
  }
  .k-frame:last-of-type {
    break-after: auto;
  }
  .k-slide {
    transform: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    content-visibility: visible !important;
  }
  .k-slide::after {
    display: none !important;
  }
  .k-build {
    opacity: 1 !important;
  }
  .k-deck-bar,
  .k-rail,
  .k-pr,
  .k-pr-dock,
  .k-pr-new,
  .k-cm {
    display: none !important;
  }
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
