/* Clear Seeing (project dharma-machine) — site styles. Tokens and rules: see ../../DESIGN.md */

:root {
  /* Design v2, "drawing set" (decision 44): drafting paper, drawing ink, graphite, and one robe-saffron
     accent for where the practitioner acts. Dark mode is the same drawing printed as a blueprint. */
  --field: #F1F2EE;          /* drafting paper */
  --ink: #1B1F24;            /* drawing ink */
  --ink-2: #4D555D;          /* graphite */
  --ink-3: #5E666F;          /* light graphite */
  --rule: #CDD1CB;
  --rule-strong: #A6ADA7;
  --line: #80888A;           /* quiet line that carries meaning: fields, faint arrows, help boxes (3.2:1) */
  --accent: #8F5A00;         /* robe saffron, text-safe (5.1:1) */
  --accent-wash: rgba(196, 128, 16, 0.12);
  --grid: rgba(27, 31, 36, 0.055);
  --grid-major: rgba(27, 31, 36, 0.10);

  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans: "IBM Plex Sans", "Source Sans 3", system-ui, sans-serif;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;

  --measure: 36em;
  --margin-col: 16rem;
  --t-caption: 0.8125rem;   /* 13px */
  --t-note: 0.9rem;         /* 14.4px */
  --t-h3: 1.40625rem;       /* 22.5px */
  --t-h2: 1.75rem;          /* 28px */
  --t-h1: clamp(2.4rem, 1.6rem + 1.9vw, 3.25rem);   /* 38-52px, display cut */

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --field: #13202F;
    --ink: #E6EAEE;
    --ink-2: #AEB7C1;
    --ink-3: #909AA5;
    --rule: #2B3B4D;
    --rule-strong: #4A5D72;
    --line: #5F6F81;
    --accent: #F0A83C;
    --accent-wash: rgba(240, 168, 60, 0.13);
    --grid: rgba(230, 234, 238, 0.05);
    --grid-major: rgba(230, 234, 238, 0.09);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --field: #13202F;
  --ink: #E6EAEE;
  --ink-2: #AEB7C1;
  --ink-3: #909AA5;
  --rule: #2B3B4D;
  --rule-strong: #4A5D72;
  --line: #5F6F81;
  --accent: #F0A83C;
  --accent-wash: rgba(240, 168, 60, 0.13);
  --grid: rgba(230, 234, 238, 0.05);
  --grid-major: rgba(230, 234, 238, 0.09);
  color-scheme: dark;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--field);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  font-optical-sizing: auto;
  font-feature-settings: "kern", "liga", "onum";
  text-rendering: optimizeLegibility;
}

p { margin: 0 0 var(--s4); }
h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -0.005em; }
h1, h2 { font-weight: 500; }
::selection { background: var(--accent-wash); }
em, i { font-style: italic; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 1px; }

.label, .sec-code, figcaption, .note, .site-header, .site-footer, .panel-meta, .sources, .layer {
  font-family: var(--sans);
  font-feature-settings: "kern", "lnum", "tnum";
}

.pali { font-style: italic; }

.skip { position: absolute; left: -999px; top: 0; }
#main:focus { outline: none; }
.skip:focus { left: var(--s4); top: var(--s4); background: var(--field); padding: var(--s2) var(--s3); z-index: 50; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  font-size: var(--t-note);
}
.site-header .inner {
  max-width: calc(var(--measure) + var(--margin-col) + 2 * var(--s8) + 22rem);   /* 16rem until the tenth nav item (decision 59) */
  margin: 0 auto;
  padding: var(--s4) var(--s6);
  display: flex;
  align-items: baseline;
  gap: var(--s6);
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span {
  font-family: var(--sans); font-size: var(--t-note); color: var(--ink-3); font-weight: 400;
  margin-left: var(--s2); padding-left: var(--s3); border-left: 1px solid var(--rule-strong);
}
.site-nav { flex: 1; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
@media (max-width: 1280px) and (min-width: 721px) { .wordmark span { display: none; } }
@media (max-width: 1100px) and (min-width: 721px) { .site-header .inner { gap: var(--s5); } .site-nav ul { gap: var(--s1) var(--s3); } }  /* ten nav items on one line from 1024 px */
@media (max-width: 359px) { .wordmark span { display: none; } }  /* at 320 px the subtitle would push the theme switch onto its own line */
.site-nav a { text-decoration: none; color: var(--ink-2); padding: var(--s1) 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
a[aria-disabled="true"] { color: var(--ink-3); pointer-events: none; text-decoration: none; }
.theme-toggle {
  font: inherit; color: var(--ink-2); background: none; border: 0; padding: var(--s1) 0; cursor: pointer;
  white-space: nowrap;
}
.theme-toggle:hover { color: var(--ink); }

/* ---------- page grid ---------- */

.page {
  max-width: calc(var(--measure) + var(--margin-col) + 2 * var(--s8) + 6rem);
  margin: 0 auto;
  padding: var(--s8) var(--s6) var(--s9);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) var(--margin-col);
  column-gap: var(--s8);
  align-items: start;
}
.row > .main { min-width: 0; }

.page-head { margin-bottom: var(--s8); }
.kicker { font-family: var(--sans); font-size: var(--t-note); color: var(--ink-3); letter-spacing: 0.01em; margin-bottom: var(--s3); font-feature-settings: "kern", "lnum", "tnum"; }
.page-head h1 { font-size: var(--t-h1); font-weight: 300; line-height: 1.06; letter-spacing: -0.02em; margin-bottom: var(--s5); }
.lede { font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); max-width: 32em; }

.toc { font-family: var(--sans); font-size: var(--t-note); color: var(--ink-2); }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.toc li { padding: var(--s1) 0 var(--s1) var(--s4); }
.toc a { text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc .n { color: var(--ink-3); display: inline-block; min-width: 2.4em; }

/* ---------- sections ---------- */

.section { padding-top: var(--s8); margin-top: var(--s8); border-top: 1px solid var(--rule); }
.section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.sec-code { font-size: var(--t-note); color: var(--ink-3); letter-spacing: 0.01em; margin-bottom: var(--s2); }
.section h2 { font-size: var(--t-h2); line-height: 1.15; letter-spacing: -0.01em; margin-bottom: var(--s3); }
/* A section number is a reference, so it hangs in the left margin like the numbers of a scholarly edition. */
@media (min-width: 1240px) {
  .section .main { position: relative; }
  .section .main > .sec-code:first-child { position: absolute; right: calc(100% + var(--s5)); top: 0.7em; margin: 0; white-space: nowrap; }
}
/* Where to practise (centres.html): teaching lines and places from content/centres.json */
.line { margin: 0 0 var(--s6); }
.line-tell { font-family: var(--sans); font-size: var(--t-note); line-height: 1.5; color: var(--ink-2); border-left: 3px solid var(--line); padding-left: var(--s4); }
.line-tell .label, .line-terms .label { display: block; font-size: var(--t-caption); font-weight: 600; margin-bottom: 2px; }
.line-terms { font-family: var(--sans); font-size: var(--t-note); line-height: 1.5; color: var(--ink-2); padding-left: calc(var(--s4) + 3px); }
table.report.lines td { font-family: var(--sans); font-size: var(--t-note); line-height: 1.45; color: var(--ink); min-width: 9em; white-space: normal; }
table.report.lines thead th { vertical-align: bottom; white-space: normal; }
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table.report.lines th.row-head { font-size: var(--t-note); color: var(--ink); min-width: 6.5em; text-align: left; vertical-align: top; padding: var(--s3) var(--s4) var(--s3) 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 721px) { .places-controls { grid-template-columns: minmax(12rem, 2fr) minmax(11rem, 1fr) auto; } }
.place-country { font-size: var(--t-h3); font-weight: 500; border-bottom: 1px solid var(--ink); padding-bottom: var(--s1); margin: var(--s6) 0 0; }
.centres-note { font-family: var(--sans); font-size: var(--t-note); line-height: 1.5; color: var(--ink-2); margin: var(--s4) 0 var(--s2); }
.centres { list-style: none; padding: 0; margin: 0 0 var(--s4); }
.centres li { padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.centres li > a { font-weight: 600; }
.centres .where { font-family: var(--sans); font-size: var(--t-note); color: var(--ink-2); margin-left: var(--s2); }
.centres .what { display: block; margin-top: var(--s1); }
.centres .covers { display: block; font-family: var(--sans); font-size: var(--t-note); line-height: 1.5; color: var(--ink-2); margin-top: var(--s1); }
.line-tag { display: inline-block; font-family: var(--sans); font-size: var(--t-caption); line-height: 20px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 2px; padding: 1px var(--s2); margin-right: var(--s2); text-decoration: none; white-space: nowrap; }
.line-tag:hover { color: var(--ink); border-color: var(--ink); }
.line-sources { font-family: var(--sans); font-size: var(--t-note); line-height: 1.6; padding-left: 1.2em; }
.takeaway { font-size: 1.25rem; line-height: 1.5; color: var(--ink-2); margin-bottom: var(--s6); }
.section h3 { font-size: var(--t-h3); margin: var(--s6) 0 var(--s3); }

/* margin notes */
.note {
  font-size: var(--t-note);
  line-height: 1.5;
  color: var(--ink-2);
  padding-top: 0.2em;
}
.note p { margin-bottom: var(--s2); }
.note .pali { color: var(--ink); }
.note .label { display: block; color: var(--ink-2); font-size: var(--t-caption); font-weight: 600; letter-spacing: 0.01em; margin-bottom: var(--s1); }
.note .marks { list-style: none; margin: 0 0 var(--s2); padding: 0; }
.note .marks li { padding-left: 1.4em; text-indent: -1.4em; }
.note .marks b { display: inline-block; min-width: 1.4em; text-indent: 0; }

/* terms */
.term {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.term:hover, .term[aria-expanded="true"] { text-decoration-color: var(--accent); }

/* layer labels */
.layer { font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-2); white-space: nowrap; }
.layer::before { margin-right: 0.35em; color: var(--ink-3); }
.layer[data-layer="canon"]::before { content: "●"; }
.layer[data-layer="commentary"]::before { content: "◐"; }
.layer[data-layer="later-tradition"]::before { content: "○"; }
.layer[data-layer="modern-map"]::before { content: "◇"; }
.layer[data-layer="science"]::before { content: "△"; }
.layer[data-layer="site"]::before { content: "□"; }
.contested { font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink); white-space: nowrap; }
.contested::before { content: "≠"; margin-right: 0.35em; color: var(--accent); }

/* ---------- figures ---------- */

figure { margin: var(--s7) 0; }
figure svg { display: block; width: 100%; height: auto; color: var(--ink); overflow: visible; }
figcaption { font-size: var(--t-note); line-height: 1.5; color: var(--ink-2); margin-top: var(--s4); max-width: 40em; }
figcaption b { color: var(--ink); font-weight: 600; margin-right: 0.5em; }
.fig-wide { margin-left: 0; margin-right: 0; }

.dgm text { font-family: var(--sans); fill: currentColor; font-feature-settings: "kern", "lnum"; }
.dgm .pali-t { font-family: var(--serif); font-style: italic; font-size: 15px; }
.dgm .en-t { font-size: 12.5px; fill: var(--ink-2); }
.dgm .num-t { font-size: 11px; fill: var(--ink-3); }
.dgm .band-t { font-size: 11.5px; fill: var(--ink-3); letter-spacing: 0.01em; }
.dgm .edge-t { font-size: 11.5px; fill: var(--ink-2); }
.dgm .box { fill: var(--field); stroke: currentColor; stroke-width: 1.25; }
.dgm .edge { fill: none; stroke: currentColor; stroke-width: 1.25; }
.dgm .faint { stroke: var(--line); }
.dgm .band { fill: none; stroke: var(--line); stroke-width: 1; }
.dgm .lever { stroke: var(--accent); fill: none; stroke-width: 1.5; }
.dgm .lever-t { fill: var(--accent); font-size: 12px; font-weight: 500; }
.dgm .lever-dot { fill: var(--accent); }
.dgm a { cursor: pointer; outline: none; }
.dgm a:hover .box, .dgm a:focus-visible .box, .dgm a[aria-expanded="true"] .box { stroke: var(--accent); stroke-width: 1.75; }
.dgm a:focus-visible .box { fill: var(--accent-wash); }
.dgm marker path { fill: currentColor; }
.dgm .m-accent path { fill: var(--accent); }

.dgm-tall { display: none; }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin: var(--s6) 0; position: relative; }
table.report { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.45; }
table.report caption { caption-side: bottom; text-align: left; font-family: var(--sans); font-size: var(--t-note); color: var(--ink-2); padding-top: var(--s3); }
table.report th { font-family: var(--sans); font-weight: 500; font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-3); text-align: left; padding: 0 var(--s4) var(--s2) 0; border-bottom: 1px solid var(--ink); vertical-align: bottom; }
table.report td { padding: var(--s3) var(--s4) var(--s3) 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.report td:first-child { font-family: var(--sans); font-size: var(--t-note); color: var(--ink-3); white-space: nowrap; }
table.report .row-head { font-weight: 600; }

/* parts list */
.parts { list-style: none; padding: 0; margin: var(--s5) 0; border-top: 1px solid var(--rule); }
.parts li { display: grid; grid-template-columns: 2.5em minmax(8em, 11em) 1fr; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.parts .n { font-family: var(--sans); font-size: var(--t-note); color: var(--ink-3); }
.parts .t { font-weight: 600; }
.parts .t .pali { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.9em; }
.parts .d { color: var(--ink); }

/* ---------- concept panel ---------- */

.tip {
  position: absolute;
  z-index: 30;
  max-width: 22rem;
  padding: var(--s3) var(--s4);
  background: var(--field);
  border: 1px solid var(--rule-strong);
  font-family: var(--sans);
  font-size: var(--t-note);
  line-height: 1.45;
  color: var(--ink);
}
.tip .tip-term { font-weight: 600; display: block; margin-bottom: var(--s1); }
.tip .tip-more { display: block; margin-top: var(--s2); color: var(--ink-3); font-size: var(--t-caption); }

.panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(30rem, 100vw);
  z-index: 40;
  background: var(--field);
  border-left: 1px solid var(--rule-strong);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 160ms ease-out, visibility 0s linear 160ms;
}
.panel.open { transform: none; visibility: visible; transition: transform 160ms ease-out, visibility 0s; }
.panel-bar {
  flex: none;
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s3) var(--s6);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-3);
}
.panel-inner { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--s5) var(--s6) var(--s8); }
.panel-close {
  font-family: var(--sans); font-size: var(--t-note); color: var(--ink-2);
  background: var(--field); border: 1px solid var(--rule); padding: var(--s1) var(--s3); cursor: pointer;
}
.panel-close:hover { color: var(--ink); border-color: var(--rule-strong); }
.panel-page { margin-left: auto; margin-right: var(--s4); font-size: var(--t-note); color: var(--ink-2); text-decoration-color: var(--rule-strong); }
.panel-page:hover { color: var(--ink); }
.panel-meta { font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin-bottom: var(--s3); }
.panel h2 { font-size: var(--t-h2); margin-bottom: var(--s1); }
.panel .terms-alt { color: var(--ink-2); margin-bottom: var(--s5); }
.panel .definition { font-size: 1.2rem; line-height: 1.5; margin-bottom: var(--s5); padding-left: var(--s4); border-left: 2px solid var(--accent); }
.panel h3 { font-family: var(--sans); font-size: var(--t-caption); font-weight: 500; letter-spacing: 0.01em; color: var(--ink-3); margin: var(--s6) 0 var(--s2); }
.panel .role { font-size: 1rem; }
.panel .panel-note { font-family: var(--sans); font-size: var(--t-note); color: var(--ink-2); padding-left: var(--s3); border-left: 2px solid var(--accent); }
.panel dl { margin: 0; display: grid; grid-template-columns: 7.5em 1fr; gap: var(--s2) var(--s4); font-size: 1rem; line-height: 1.5; }
.panel dt { font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-3); padding-top: 0.25em; }
.panel dd { margin: 0; }
.panel .contested-box { font-size: 1rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: var(--s3) 0; margin-top: var(--s5); }
.panel .rel { font-size: 1rem; }
.panel .rel ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.panel .rel .rel-kind { font-family: var(--sans); font-size: var(--t-caption); color: var(--ink-3); letter-spacing: 0.01em; display: block; margin: var(--s3) 0 var(--s1); }
.panel .rel .missing { color: var(--ink-3); }
.panel blockquote { margin: var(--s5) 0; padding: 0; font-size: 1.05rem; color: var(--ink-2); }
.panel blockquote footer { font-family: var(--sans); font-size: var(--t-caption); color: var(--ink-3); margin-top: var(--s1); }
.sources { list-style: none; padding: 0; margin: 0; font-size: var(--t-note); line-height: 1.5; color: var(--ink-2); }
.sources li { padding: var(--s2) 0; border-top: 1px solid var(--rule); }
.sources .src-work { color: var(--ink); }
.sources a { color: var(--ink); text-decoration-color: var(--rule-strong); }
.scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, 0.18); opacity: 0; visibility: hidden; transition: opacity 160ms, visibility 0s linear 160ms; }
.scrim.open { opacity: 1; visibility: visible; transition: opacity 160ms, visibility 0s; }

/* ---------- components (build-time renderers, tools/render.py) ---------- */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* definition lists inside routes, lookups and protocols */
dl.mini { margin: var(--s2) 0 0; display: grid; grid-template-columns: 8.5em 1fr; gap: var(--s1) var(--s4); font-size: 0.95rem; line-height: 1.5; }
dl.mini dt { font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-3); padding-top: 0.2em; }
dl.mini dd { margin: 0; }
dt.help { color: var(--ink); font-weight: 500; }
dt.help .policy { font-weight: 400; color: var(--ink-3); }
dd.help { padding-left: var(--s3); border-left: 2px solid var(--accent); }
.panel dt.help { color: var(--ink); }

/* checklist: prerequisites */
.checklist li { grid-template-columns: 2.5em minmax(8em, 11em) 1fr; }
.checklist .n::before { content: ""; display: inline-block; width: 0.8em; height: 0.8em; border: 1.25px solid var(--ink-2); vertical-align: -0.05em; }

/* route: stages as a vertical line with numbered stations */
.route { list-style: none; margin: var(--s5) 0; padding: 0; position: relative; }
.route::before { content: ""; position: absolute; left: 0.95em; top: 0.6em; bottom: 0.6em; border-left: 1px solid var(--rule-strong); }
.route li { position: relative; display: grid; grid-template-columns: 2.6em 1fr; gap: var(--s3); padding: 0 0 var(--s5); }
.route-n { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 1.9em; height: 1.9em;
  background: var(--field); border: 1.25px solid var(--ink); font-family: var(--sans); font-size: var(--t-caption); }
.route-t { margin: 0; font-weight: 600; }
.route-t .pali { font-weight: 400; color: var(--ink-2); margin-left: 0.3em; }
.route-d { margin: var(--s1) 0 0; }

/* concept written out in the page */
.block { padding: var(--s5) 0; border-top: 1px solid var(--rule); }
.block:first-child { border-top: 0; padding-top: 0; }
.block-t { font-size: var(--t-h3); margin: 0 0 var(--s1); }
.block-meta { font-family: var(--sans); font-size: var(--t-caption); color: var(--ink-3); margin-bottom: var(--s3); display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); align-items: baseline; }
.block-meta .pali { font-family: var(--serif); font-size: 1rem; color: var(--ink-2); }
.block-def { font-size: 1.15rem; line-height: 1.5; padding-left: var(--s4); border-left: 2px solid var(--rule-strong); }
.block-contested { font-size: 1rem; color: var(--ink-2); }
.contacts { font-family: var(--sans); font-size: var(--t-note); line-height: 1.5; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.contacts .label { display: block; font-size: var(--t-caption); font-weight: 600; color: var(--ink-2); margin-bottom: var(--s1); }
.help-rule { color: var(--ink-2); }
.block-more { font-family: var(--sans); font-size: var(--t-note); }

/* OKR scoreboard */
table.okr { border-collapse: collapse; width: 100%; max-width: 44rem; font-family: var(--sans); font-size: var(--t-note); }
table.okr th, table.okr td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--rule); text-align: left; }
table.okr thead th { font-weight: 500; font-size: var(--t-caption); letter-spacing: 0.02em; vertical-align: bottom; border-bottom: 1px solid var(--ink); }
table.okr tbody th { font-weight: 400; font-family: var(--serif); font-size: 1rem; }
table.okr tr.grp th { font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-3); padding-top: var(--s4); border-bottom: 0; }
table.okr td.m { text-align: center; width: 6.5em; font-size: 1.05rem; position: relative; }
table.okr .m-a { color: var(--ink); }
table.okr .m-w { color: var(--ink-2); }
table.okr .m-o { color: var(--ink-3); }

/* filters */
.filter { display: flex; flex-direction: column; gap: var(--s1); }
.filter .label { font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-3); }
.filter input, .filter select {
  font: inherit; font-family: var(--sans); font-size: 1rem; color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 0; padding: var(--s2) var(--s3); min-width: 0;
}
.filter input:focus, .filter select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.filter-empty { font-family: var(--sans); font-size: var(--t-note); color: var(--ink-2); }

/* troubleshooting lookup */
.lookup > .filter { max-width: 28rem; margin-bottom: var(--s5); }
.trouble { padding: var(--s4) 0; border-top: 1px solid var(--rule); }
.trouble h3 { font-size: 1.1rem; margin: 0 0 var(--s1); }
.trouble h3 .kind { font-family: var(--sans); font-size: var(--t-caption); font-weight: 400; letter-spacing: 0.01em; color: var(--ink-3); margin-left: var(--s2); }

/* experiment protocols */
.protocols { list-style: none; margin: var(--s5) 0; padding: 0; }
.protocol { display: grid; grid-template-columns: 3em 1fr; gap: var(--s3); padding: var(--s5) 0; border-top: 1px solid var(--rule); }
.protocol .n { font-family: var(--sans); font-size: var(--t-note); color: var(--ink-3); padding-top: 0.2em; }
.protocol h3 { font-size: 1.1rem; margin: 0 0 var(--s2); }
.protocol .hyp { font-style: italic; margin-bottom: var(--s2); }
.protocol-meta { font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.02em; color: var(--ink-3); margin: 0 0 var(--s2); }

/* maps crosswalk */
.xw-wrap { margin-top: var(--s5); }
table.xw { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: var(--t-caption); line-height: 1.4; }
table.xw th, table.xw td { padding: var(--s2) var(--s2); border-bottom: 1px solid var(--rule); vertical-align: top; text-align: left; }
table.xw thead th { font-weight: 500; letter-spacing: 0.02em; border-bottom: 1px solid var(--ink); }
table.xw tbody th { font-family: var(--serif); font-size: 0.95rem; font-weight: 600; width: 14%; }
table.xw td { width: 14.3%; color: var(--ink); }
table.xw .mk { display: inline-block; min-width: 1em; font-weight: 600; }
table.xw td.m-eq .mk { color: var(--ink); }
table.xw td.m-ap .mk { color: var(--accent); }
table.xw td.m-no { color: var(--ink-3); }
table.xw td.m-in .mk { color: var(--ink-2); font-style: italic; }
.xw-details { margin-top: var(--s6); }
.xw-details .label { font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-3); }
.xw-row { border-top: 1px solid var(--rule); padding: var(--s2) 0; }
.xw-row summary { cursor: pointer; font-weight: 600; padding: var(--s1) 0; }
.xw-row summary::marker { color: var(--ink-3); }
.xw-row dl.mini { grid-template-columns: 11em 1fr; }
.xw-row .src { display: block; font-family: var(--sans); font-size: var(--t-caption); color: var(--ink-3); margin-top: 2px; word-break: break-word; }

/* ox-herding strip */
.dgm.ox .lever { stroke-width: 1.25; }

/* glossary */
.gl-controls { display: grid; grid-template-columns: minmax(12rem, 2fr) minmax(9rem, 1fr) minmax(9rem, 1fr) auto; gap: var(--s4); align-items: end; margin-bottom: var(--s4); }
.gl-count { font-family: var(--sans); font-size: var(--t-note); color: var(--ink-3); margin: 0 0 var(--s2); white-space: nowrap; }
.letters { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); font-family: var(--sans); font-size: var(--t-note); margin-bottom: var(--s6); }
.letters a { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; text-decoration: none; color: var(--ink-2); }
.letters a:hover { color: var(--ink); }
.gl-group { margin-bottom: var(--s5); }
.gl-letter { font-size: var(--t-h3); font-weight: 500; border-bottom: 1px solid var(--ink); padding-bottom: var(--s1); margin-bottom: var(--s2); }
dl.gl { margin: 0; }
.gl-item { display: grid; grid-template-columns: minmax(12rem, 1fr) 2fr; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.gl-item dt { font-weight: 600; }
.gl-item dt .pali { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.92em; }
.gl-item dd { margin: 0; }
.gl-meta { display: block; font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.02em; color: var(--ink-3); margin-bottom: 2px; }
.gl-meta .layer, .gl-meta .contested { margin-left: var(--s2); }

/* bibliography */
table.biblio td.num { text-align: right; font-family: var(--sans); font-size: var(--t-note); color: var(--ink-2); }
table.report.biblio td:first-child { font-family: var(--serif); font-size: 1rem; color: var(--ink); white-space: normal; }

/* callout used for safety notes */
.callout { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); padding: var(--s4) 0; margin: var(--s5) 0; }
.callout .label { display: block; font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--accent); margin-bottom: var(--s2); }

/* overview */
.contents { list-style: none; padding: 0; margin: var(--s5) 0; border-top: 1px solid var(--rule); }
.contents li { display: grid; grid-template-columns: 4.5em minmax(9em, 13em) 1fr; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.contents .n { font-family: var(--sans); font-size: var(--t-note); color: var(--ink-3); }
.contents a { font-weight: 600; text-decoration-color: var(--rule-strong); text-underline-offset: 0.18em; }
.contents .q { color: var(--ink-2); }

/* ---------- home: Sheet 0 ----------
   The one bold element of the site (DESIGN.md, design v2): the opening is a drawing sheet. A drafting
   grid, the control loop drawn large, and a title block whose cells carry the figure's caption,
   source and layer. Everything else on the site stays quiet. */

.page.page-index { padding-top: var(--s6); }
.sheet { border: 1.25px solid var(--ink); background: var(--field); margin: 0 0 var(--s8); }
.sheet-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: var(--s7);
  align-items: end;
  padding: var(--s7) var(--s7) var(--s6);
}
.sheet h1 {
  font-size: clamp(2.6rem, 1.4rem + 2.6vw, 3.9rem);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
  text-wrap: balance;
}
.sheet .lede { font-size: 1.1875rem; margin: 0; }
/* the drawing area: a drafting grid, the figure drawn on it */
.sheet-fig {
  margin: 0;
  padding: var(--s7) var(--s7) var(--s6);
  border-top: 1px solid var(--ink);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}
.sheet-fig svg { max-width: 52rem; margin: 0 auto; }
.sheet + .section { border-top: 0; margin-top: 0; padding-top: var(--s2); }
.sheet .dgm .edge-t, .sheet .dgm .lever-t { paint-order: stroke; stroke: var(--field); stroke-width: 5px; stroke-linejoin: round; }
.dgm .head { fill: currentColor; }

.title-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 15rem) minmax(7rem, 9rem);
  margin: 0;
  border-top: 1.25px solid var(--ink);
  background: var(--field);
  font-family: var(--sans);
  font-size: var(--t-note);
  line-height: 1.5;
}
.title-block > div { padding: var(--s3) var(--s4) var(--s4); border-left: 1px solid var(--ink); min-width: 0; }
.title-block > div:first-child { border-left: 0; }
.title-block dt { font-size: var(--t-caption); color: var(--ink-3); margin-bottom: 2px; }
.title-block .tb-cap dt { color: var(--ink); font-weight: 600; }
.title-block dd { margin: 0; color: var(--ink-2); }
.title-block a { color: var(--ink); text-decoration-color: var(--rule-strong); }

/* The figure assembles once, in the order of the argument: problem and cause, the arrow that
   produces, the method, the lever that removes (in the accent), then the end it realises. */
@media (prefers-reduced-motion: no-preference) {
  .sheet .dgm .step { animation: cs-fade 420ms ease-out var(--d, 0ms) both; }
  .sheet .dgm .draw { stroke-dasharray: var(--len); animation: cs-draw 520ms ease-in-out var(--d, 0ms) both; }
  /* With script, it waits (first frame held) until site.js sees the figure; without script it plays on load. */
  .js .sheet:not(.play) .dgm .step, .js .sheet:not(.play) .dgm .draw { animation-play-state: paused; }
}
@keyframes cs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cs-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }

@media (max-width: 1080px) {
  .sheet-head { grid-template-columns: minmax(0, 1fr); row-gap: var(--s5); padding: var(--s7) var(--s6) var(--s6); }
  .sheet .lede { max-width: var(--measure); }
  .sheet-fig { padding: var(--s6); }
}
@media (max-width: 720px) {
  .page.page-index { padding-top: 0; }
  .sheet { margin: 0 calc(-1 * var(--s4)) var(--s7); border-left: 0; border-right: 0; border-top: 0; }
  .sheet-head { padding: var(--s6) var(--s4) var(--s5); }
  .sheet-fig { padding: var(--s5) var(--s4) var(--s4); }
  .title-block { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .title-block .tb-cap { grid-column: 1 / -1; }
  .title-block > div { border-left: 0; padding: var(--s3) var(--s4); }
  .title-block > div + div { border-top: 1px solid var(--ink); }
  .title-block > div:last-child { border-left: 1px solid var(--ink); }
}

/* ---------- flow chart (site/src/flow.html) ---------- */

.flow { margin: var(--s5) 0 var(--s7); }
.flow-phase { font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-3); margin: var(--s3) 0 var(--s2); }
.flow-phase .n { display: inline-block; min-width: 1.6em; color: var(--ink); font-weight: 600; }
.flow-phase a { margin-left: var(--s3); color: var(--ink-2); letter-spacing: 0; text-decoration-color: var(--rule-strong); }
.flow-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); column-gap: var(--s7); align-items: start; }
.flow-row > .flow-node, .flow-row > .flow-split { grid-column: 1; }
.flow-node { border: 1.25px solid var(--ink); background: var(--field); padding: var(--s3) var(--s4); }
.flow-node.small { padding: var(--s2) var(--s3); }
.flow-node.objective { border-width: 2px; }
.flow-node .t { margin: 0; font-weight: 600; }
.flow-node .d { margin: 2px 0 0; font-size: 0.95rem; line-height: 1.45; color: var(--ink-2); }
.flow-node.small .d { font-size: 0.9rem; }
.flow-node .kr { font-family: var(--sans); font-size: var(--t-caption); font-weight: 400; letter-spacing: 0.01em; color: var(--ink-3); margin-left: var(--s2); }
.flow-chain { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: var(--s1) 0 0; font-size: 1rem; }
.flow-chain .sep { color: var(--ink-3); }
.flow-chain .lever { font-family: var(--sans); font-size: var(--t-caption); color: var(--accent); white-space: nowrap; }
.flow-chain .lever .term { color: var(--accent); text-decoration-color: var(--accent); }
.flow-arrow { position: relative; height: 30px; grid-column: 1; width: calc(66.66% - var(--s7) / 2); }
.flow-arrow.short { height: 20px; width: 100%; }
.flow-arrow::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 6px; border-left: 1.25px solid var(--ink); }
.flow-arrow::after { content: ""; position: absolute; left: calc(50% - 4.4px); bottom: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 7px solid var(--ink); }
.flow-arrow .lbl { position: absolute; left: calc(50% + 12px); top: 50%; transform: translateY(-50%); font-family: var(--sans); font-size: var(--t-caption); color: var(--ink-2); white-space: nowrap; }
.flow-split { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s5); align-items: start; }
.flow-track-label { font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-3); margin: 0 0 var(--s2); }
.flow-support { grid-column: 1 / -1; margin: var(--s4) 0 0; padding-top: var(--s2); border-top: 1.25px dashed var(--rule-strong); font-family: var(--sans); font-size: var(--t-note); color: var(--ink-2); text-align: center; }
.flow-branches { grid-column: 2; display: flex; flex-direction: column; gap: var(--s4); padding-top: var(--s6); }
.flow-branch { grid-column: 2; position: relative; border: 1.25px dashed var(--line); padding: var(--s2) var(--s3); font-size: 0.92rem; line-height: 1.45; }
.flow-branch::before { content: ""; position: absolute; left: calc(-1 * var(--s7) - 1px); top: 1.4em; width: var(--s7); border-top: 1.25px dashed var(--line); }
.flow-branches .flow-branch::before { display: none; }
.flow-branch .k { display: block; font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-3); margin-bottom: 2px; }
.flow-branch.help { border-left: 2px solid var(--accent); }

/* ---------- field guide (site/src/journey.html, tools/journey.py, assets/js/journey.js) ---------- */

.page.page-journey { max-width: none; width: 100%; margin: 0; padding: 0; }
.jr-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5);
  padding: var(--s3) var(--s6); border-bottom: 1px solid var(--rule);
  font-family: var(--sans); font-size: var(--t-note); position: relative; z-index: 3; background: var(--field);
}
.jr-h1 { font-family: var(--serif); font-size: 1.3rem; white-space: nowrap; }
.jr-h1 span { font-family: var(--sans); font-size: var(--t-note); font-weight: 400; color: var(--ink-3); margin-left: var(--s2); }
.jr-go, .jr-tools, .jr-zoom { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.jr-tools { margin-left: auto; gap: var(--s3); }
.jr-bar button, .jr-go a {
  font: inherit; color: var(--ink); background: none; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 2px; padding: 3px 10px; line-height: 1.5; text-decoration: none;
}
.jr-bar button:hover, .jr-go a:hover { border-color: var(--ink); }
.jr-zoom button[data-zoom="in"], .jr-zoom button[data-zoom="out"] { width: 2.1em; padding: 3px 0; }
.jr-go .jr-helplink { border-color: var(--line); border-left: 3px solid var(--accent); }
.jr-mode[aria-pressed="true"] { border-color: var(--ink); }
.jr-find { position: relative; }
.jr-find input {
  font: inherit; color: var(--ink); background: var(--field); width: 15rem;
  border: 1px solid var(--line); border-radius: 2px; padding: 3px 8px; line-height: 1.5;
}
.jr-find input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.jr-results {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: 22rem;
  list-style: none; margin: 0; padding: var(--s1) 0; background: var(--field);
  border: 1px solid var(--rule-strong); z-index: 5;
}
.jr-results li { padding: var(--s1) var(--s3); cursor: pointer; display: flex; justify-content: space-between; gap: var(--s4); }
.jr-results li:hover, .jr-results li:focus { background: var(--accent-wash); outline: none; }
.jr-results .l { color: var(--ink-3); font-size: var(--t-caption); white-space: nowrap; }
.jr-results .none { color: var(--ink-2); cursor: default; }

/* Without JavaScript the map is a static picture and the text version follows it. */
html:not(.jr-js) .jr-go, html:not(.jr-js) .jr-tools,
html:not(.jr-js) .jr-ruler, html:not(.jr-js) .jr-lanes, html:not(.jr-js) .jr-hint,
html:not(.jr-js) .jr-skip, html:not(.jr-js) .jr-mini { display: none; }
.jr-view { position: relative; }
.jr-svg { display: block; width: 100%; height: auto; }
.jr-text { padding: var(--s8) var(--s6) var(--s9); max-width: calc(var(--measure) + var(--margin-col) + 2 * var(--s8) + 6rem); margin: 0 auto; }

/* With JavaScript: the map fills the window below the header, unless the text version is on. */
html.jr-js:not(.jr-textmode) body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
html.jr-js:not(.jr-textmode) .site-footer, html.jr-js:not(.jr-textmode) .jr-text { display: none; }
html.jr-js:not(.jr-textmode) .page-journey { flex: 1; min-height: 0; display: flex; flex-direction: column; }
html.jr-js:not(.jr-textmode) .jr-view { flex: 1; min-height: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
html.jr-js:not(.jr-textmode) .jr-svg { position: absolute; inset: 0; height: 100%; }
html.jr-js .jr-view.dragging { cursor: grabbing; }
html.jr-js.jr-textmode .jr-view, html.jr-js.jr-textmode .jr-go > button, html.jr-js.jr-textmode .jr-find,
html.jr-js.jr-textmode .jr-zoom { display: none; }
.jr-view:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* the map */
.jr-svg { color: var(--ink); font-family: var(--serif); }
.jr-svg text { fill: currentColor; }
.jr-svg .box, .jr-svg .jr-e, .jr-svg .jr-grid line, .jr-svg .jr-help line, .jr-svg .jr-drop { vector-effect: non-scaling-stroke; }
.jr-grid line { stroke: var(--rule); stroke-width: 1; }
.jn { cursor: pointer; outline: none; }
.jn .box { fill: var(--field); stroke: var(--ink); stroke-width: 1.25; }
.jn.k-trouble .box { stroke: var(--ink-2); stroke-dasharray: 6 4; }
.jn.k-milestone .box { stroke-width: 2.5; }
.jn.k-help .box { stroke: var(--line); }
.jn.lever .box { stroke: var(--accent); stroke-width: 1.75; }
.jn .bar, .jr-key .bar { fill: var(--accent); }
.jn .tg { font-family: var(--sans); font-size: 11px; letter-spacing: 0.01em; fill: var(--ink-3); }
.jn.lever .tg { fill: var(--accent); }
.jn .tt { font-size: 22px; font-weight: 600; }
.jn .ts { font-size: 16px; fill: var(--ink-2); }
.jn .tl { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.01em; fill: var(--ink-3); }
.jn .td { font-family: var(--sans); font-size: 14px; fill: var(--ink-2); }
.jn:hover .box, .jn:focus-visible .box, .jn[aria-expanded="true"] .box, .jn.hl .box { stroke: var(--accent); stroke-width: 2.25; stroke-dasharray: none; }
.jr-e { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.jr-e.t-may { stroke: var(--ink-2); stroke-dasharray: 5 4; }
.jr-e.t-support { stroke: var(--ink-3); stroke-width: 1.75; stroke-dasharray: 0.1 5; stroke-linecap: round; }
.jr-e.t-loop { stroke: var(--ink-2); }
.jr-svg marker path { fill: var(--ink); }
.jr-svg marker.jr-a2 path { fill: var(--ink-2); }
.jr-svg marker.jr-a3 path { fill: var(--ink-3); }
.jr-el { font-family: var(--sans); font-size: 15px; fill: var(--ink-2); paint-order: stroke; stroke: var(--field); stroke-width: 6px; stroke-linejoin: round; }
.jr-el.mid { text-anchor: middle; }
.jr-rail { stroke: var(--accent); stroke-width: 1.5; }
.jr-tick { stroke: var(--accent); stroke-width: 1.25; }
.jr-drop { fill: none; stroke: var(--accent); stroke-width: 1.25; stroke-dasharray: 3 3; }
.jr-dot { fill: var(--accent); }
.jr-over text { text-anchor: middle; paint-order: stroke; stroke: var(--field); stroke-width: 18px; stroke-linejoin: round; }
.jr-over .on { font-family: var(--sans); font-size: 72px; fill: var(--ink-3); }
.jr-over .ot { font-size: 116px; font-weight: 600; }
.jr-over .os { font-size: 80px; fill: var(--ink-2); }

/* zoom levels: 0 overview, 1 titles, 2 short text, 3 everything */
.jr-svg:not([data-z="0"]) .jr-over { display: none; }
.jr-svg[data-z="0"] .jn text, .jr-svg[data-z="0"] .jr-el { display: none; }
.jr-svg[data-z="0"] .jn, .jr-svg[data-z="0"] .jr-e { opacity: 0.32; }
.jr-svg[data-z="1"] .jn .tg, .jr-svg[data-z="1"] .jn .tl, .jr-svg[data-z="1"] .jr-el { display: none; }
.jr-svg[data-z="1"] .jn .ts { opacity: 0.45; }
.jr-svg[data-z="1"] .jn .td, .jr-svg[data-z="2"] .jn .tl, .jr-svg[data-z="2"] .jn .td { opacity: 0.35; }

/* rulers, minimap, key, hint */
.jr-ruler { position: absolute; top: 0; left: 0; right: 0; height: 30px; background: var(--field); border-bottom: 1px solid var(--rule); pointer-events: none; overflow: hidden; z-index: 1; }
.jr-ph { position: absolute; top: 0; left: 0; height: 30px; display: flex; align-items: baseline; justify-content: center; gap: var(--s2); padding: 6px var(--s3) 0; font-family: var(--sans); font-size: var(--t-caption); white-space: nowrap; overflow: hidden; }
.jr-ph .n { color: var(--ink-3); }
.jr-ph .t { letter-spacing: 0.01em; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.jr-ph .s { display: none; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.jr-ph.wide .s { display: inline; }
.jr-lanes { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 1; }
.jr-ln { position: absolute; top: 0; left: var(--s3); white-space: nowrap; font-family: var(--sans); font-size: 11px; letter-spacing: 0.01em; color: var(--ink-2); background: var(--field); padding: 1px 6px; border: 1px solid var(--rule); }
.jr-ln .s { letter-spacing: 0; color: var(--ink-3); }
.jr-view[data-z="0"] .jr-ln .s { display: none; }
.jr-mini { position: absolute; right: var(--s4); bottom: var(--s4); width: 220px; height: auto; aspect-ratio: 2.33; background: var(--field); border: 1px solid var(--rule-strong); cursor: crosshair; z-index: 2; touch-action: none; }
html:not(.jr-js) .jr-mini { display: none; }
.jr-mini line { stroke: var(--rule); stroke-width: 12; }
.jr-mini rect.n { fill: var(--rule-strong); }
.jr-mini rect.t { fill: var(--rule); }
.jr-mini rect.h { fill: var(--accent); opacity: 0.5; }
.jr-mini .jr-mini-view { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 40; }
.jr-key { position: absolute; left: var(--s4); bottom: var(--s4); z-index: 2; max-width: 19rem; background: var(--field); border: 1px solid var(--rule-strong); font-family: var(--sans); font-size: var(--t-caption); }
html:not(.jr-js) .jr-key { position: static; max-width: none; margin: var(--s4) var(--s6); }
.jr-key summary { cursor: pointer; padding: 4px 12px; color: var(--ink-2); }
.jr-key ul { list-style: none; margin: 0; padding: 0 12px; }
.jr-key li { display: flex; align-items: center; gap: var(--s2); padding: 2px 0; }
.jr-key svg { width: 34px; height: 20px; flex: none; overflow: visible; }
.jr-key .k { fill: var(--field); stroke: var(--ink); stroke-width: 1.25; }
.jr-key .k-trouble { stroke: var(--ink-2); stroke-dasharray: 4 3; }
.jr-key .k-milestone { stroke-width: 2.5; }
.jr-key .k-help { stroke: var(--line); }
.jr-key .e { fill: none; stroke: var(--ink); stroke-width: 1.25; }
.jr-key .e-may { stroke: var(--ink-2); stroke-dasharray: 5 4; }
.jr-key .e-support { stroke: var(--ink-3); stroke-width: 1.75; stroke-dasharray: 0.1 5; stroke-linecap: round; }
.jr-key .e-help { stroke: var(--accent); stroke-dasharray: 3 3; }
.jr-key p { margin: var(--s2) 12px var(--s3); color: var(--ink-2); line-height: 1.45; }
.jr-hint { position: absolute; left: 50%; bottom: var(--s4); transform: translateX(-50%); margin: 0; padding: 4px 12px; background: var(--field); border: 1px solid var(--rule-strong); font-family: var(--sans); font-size: var(--t-caption); color: var(--ink-2); pointer-events: none; z-index: 2; white-space: nowrap; }
.jr-skip { position: absolute; left: -999px; top: 40px; z-index: 4; background: var(--field); padding: var(--s2) var(--s3); font-family: var(--sans); font-size: var(--t-note); }
.jr-skip:focus { left: var(--s4); }

/* text version */
.jr-always { border-left: 3px solid var(--accent); padding: var(--s2) 0 var(--s2) var(--s4); margin: 0 0 var(--s7); max-width: var(--measure); }
.jr-always p { margin-bottom: var(--s2); }
.jr-tphase { max-width: var(--measure); margin: 0 0 var(--s7); }
.jr-tphase h3 { font-size: var(--t-h2); margin-bottom: var(--s2); }
.jr-tphase h3 .n { font-family: var(--sans); font-size: 1rem; font-weight: 400; color: var(--ink-3); margin-right: var(--s3); }
.jr-tsum { color: var(--ink-2); }
.jr-tphase h4 { margin: var(--s5) 0 var(--s2); font-size: var(--t-caption); }
.jr-titems { list-style: none; margin: 0; padding: 0; }
.jr-titems li { padding: var(--s3) 0; border-top: 1px solid var(--rule); }
.jr-titems li p { margin: 0 0 var(--s1); }
.jr-tt { font-weight: 600; }
.jr-k { font-family: var(--sans); font-size: var(--t-caption); font-weight: 400; letter-spacing: 0.01em; color: var(--ink-3); margin-right: var(--s2); }
.jr-titems .k-help { border-left: 3px solid var(--accent); padding-left: var(--s3); }
.jr-td { font-size: 0.95rem; color: var(--ink-2); }
.jr-to { font-family: var(--sans); font-size: var(--t-caption); color: var(--ink-2); }

@media (max-width: 1080px) {
  .jr-find input { width: 11rem; }
}
@media (max-width: 720px) {
  .jr-bar { padding: var(--s2) var(--s4); gap: var(--s2); }
  .jr-h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .jr-go { width: 100%; gap: 6px; }
  .jr-bar button, .jr-go a { font-size: 13px; padding: 2px 7px; }
  .jr-tools { margin-left: 0; width: 100%; flex-wrap: nowrap; gap: var(--s2); }
  .jr-find { flex: 1; min-width: 0; }
  .jr-find input { width: 100%; }
  .jr-zoom button[data-zoom="fit"] { display: none; }
  .jr-mini { width: 132px; right: var(--s3); bottom: var(--s3); }
  .jr-key { left: var(--s3); bottom: var(--s3); max-width: calc(100% - 132px - 3 * var(--s3)); }
  .jr-hint { bottom: 84px; white-space: normal; width: calc(100% - 2 * var(--s4)); text-align: center; }
  .jr-ph.wide .s { display: none; }
  .jr-text { padding: var(--s6) var(--s4) var(--s8); }
}

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--rule); font-size: var(--t-note); color: var(--ink-2); }
.site-footer .inner { max-width: calc(var(--measure) + var(--margin-col) + 2 * var(--s8) + 6rem); margin: 0 auto; padding: var(--s6); display: flex; flex-wrap: wrap; gap: var(--s4) var(--s7); }
.site-footer a { color: var(--ink); text-decoration-color: var(--rule-strong); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .row { grid-template-columns: minmax(0, 1fr); max-width: var(--measure); margin-left: auto; margin-right: auto; }
  .row > .note, .row > .toc { margin: 0 0 var(--s5); padding: var(--s1) 0 var(--s1) var(--s4); border-left: 1px solid var(--rule); max-width: var(--measure); }
  .row > .toc { border-left: 0; padding-left: 0; }
  .fig-wide { margin-right: 0; }
  figure > figcaption { margin-left: auto; margin-right: auto; max-width: var(--measure); }
}

@media (max-width: 820px) {
  .dgm-wide { display: none; }
  .dgm-tall { display: block; max-width: 22rem; margin: 0 auto; }
}

@media (max-width: 720px) {
  body { font-size: 17px; }
  .site-header .inner { flex-wrap: wrap; gap: var(--s2) var(--s5); padding: var(--s3) var(--s4); }
  .site-nav { order: 3; flex-basis: 100%; }
  .site-nav ul { gap: var(--s1) var(--s4); }
  .page { padding: var(--s6) var(--s4) var(--s8); }
  .page-head { margin-bottom: var(--s6); }
  .page-head h1 { font-size: 2.1rem; }
  .lede, .takeaway { font-size: 1.125rem; }
  .section { padding-top: var(--s6); margin-top: var(--s6); }
  table.report thead { display: none; }
  table.report, table.report tbody { display: block; }
  table.report tr { display: grid; grid-template-columns: 2em 1fr; column-gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
  table.report td { display: block; border: 0; padding: 0 0 var(--s2); grid-column: 2; }
  table.report td:first-child { grid-column: 1; grid-row: 1 / span 3; }
  table.report td[data-label]::before { content: attr(data-label); display: block; font-family: var(--sans); font-size: var(--t-caption); letter-spacing: 0.01em; color: var(--ink-3); }
  table.report caption { display: block; }
  table.report.lines tr { display: block; padding: var(--s3) 0; border-bottom: 1px solid var(--ink); }
  table.report.lines th.row-head { display: block; min-width: 0; border: 0; padding: 0 0 var(--s2); font-size: 1rem; }
  table.report.lines td { display: block; min-width: 0; border: 0; padding: 0 0 var(--s2); }
  table.report.lines td[data-label]::before { color: var(--ink-2); font-weight: 600; }
  .parts li { grid-template-columns: 2em 1fr; }
  .checklist li { grid-template-columns: 2em 1fr; }
  .flow-row { grid-template-columns: 1fr; }
  .flow-row > .flow-node, .flow-row > .flow-split, .flow-branch, .flow-branches { grid-column: 1; }
  .flow-arrow { width: 100%; }
  .flow-arrow .lbl { white-space: normal; max-width: 45%; line-height: 1.3; }
  .flow-split { grid-template-columns: 1fr; row-gap: var(--s5); }
  .flow-branch { margin: var(--s2) 0 0 var(--s5); }
  .flow-branch::before { left: calc(-1 * var(--s4)); top: -9px; width: var(--s3); height: calc(1.4em + 9px); border-top: 0; border-left: 1.25px dashed var(--line); border-bottom: 1.25px dashed var(--line); }
  .flow-branches { padding-top: var(--s3); gap: var(--s2); }
  .flow-branches .flow-branch::before { display: block; }
  table.okr th, table.okr td { padding: var(--s2) var(--s1); }
  table.okr td.m { width: auto; }
  table.okr thead th { font-size: 0.72rem; hyphens: auto; }
  table.okr tbody th { font-size: 0.92rem; }
  dl.mini, .xw-row dl.mini { grid-template-columns: 1fr; gap: 0; }
  dl.mini dt { padding-top: var(--s2); }
  .protocol { grid-template-columns: 1fr; gap: var(--s1); }
  table.xw thead { display: none; }
  table.xw, table.xw tbody { display: block; }
  table.xw tr { display: block; padding: var(--s3) 0; border-bottom: 1px solid var(--ink); }
  table.xw tbody th { display: block; width: auto; border: 0; padding: 0 0 var(--s2); font-size: 1rem; }
  table.xw td { display: block; width: auto; border: 0; padding: 0 0 var(--s2); }
  table.xw td::before { content: attr(data-label); display: block; color: var(--ink-3); letter-spacing: 0.01em; }
  .gl-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gl-controls .filter:first-child { grid-column: 1 / -1; }
  .gl-item { grid-template-columns: 1fr; gap: var(--s1); }
  .contents li { grid-template-columns: 3.5em 1fr; }
  .contents .q { grid-column: 2; }
  .parts .d { grid-column: 2; }
  .panel { top: auto; left: 0; width: 100%; max-height: 85vh; border-left: 0; border-top: 1px solid var(--rule-strong); transform: translateY(100%); }
  .panel-inner { padding: var(--s5) var(--s4) var(--s7); }
  .panel-bar { padding: var(--s3) var(--s4); }
  .panel dl { grid-template-columns: 1fr; gap: 0 0; }
  .panel dt { padding-top: var(--s3); }
  .site-footer .inner { padding: var(--s5) var(--s4); }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .panel.open, .scrim, .scrim.open { transition: none; }
}

.callout .block-t { display: none; }
.callout .block { padding-top: 0; }

/* ---------- a concept's own page (c/<id>.html): the panel's entry, as a page ---------- */

.entry-head .terms-alt { color: var(--ink-2); margin: calc(-1 * var(--s3)) 0 var(--s4); }
.entry-head .block-meta { margin: var(--s4) 0 0; }
.entry .entry-h { font-family: var(--sans); font-size: var(--t-caption); font-weight: 500; letter-spacing: 0.01em; color: var(--ink-3); margin: var(--s6) 0 var(--s2); }
.entry .entry-h:first-child { margin-top: 0; }
.entry .panel-note { font-family: var(--sans); font-size: var(--t-note); color: var(--ink-2); padding-left: var(--s3); border-left: 2px solid var(--accent); }
.entry dl.mini { font-size: 1rem; }
.entry .contested-box { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: var(--s3) 0; margin: var(--s5) 0 0; }
.entry blockquote { margin: var(--s5) 0; padding: 0; font-size: 1.05rem; color: var(--ink-2); }
.entry blockquote footer { font-family: var(--sans); font-size: var(--t-caption); color: var(--ink-3); margin-top: var(--s1); }
.entry .rel ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.entry .rel .rel-kind { font-family: var(--sans); font-size: var(--t-caption); color: var(--ink-3); letter-spacing: 0.01em; display: block; margin: var(--s3) 0 var(--s1); }
.entry .rel .rel-kind:first-child { margin-top: 0; }
.page-404 ul { padding-left: 1.2em; }
.page-404 li { margin-bottom: var(--s2); }

/* ---------- print: the text, without the site's controls ---------- */

@media print {
  .skip, .site-nav, .theme-toggle, .panel, .scrim, .tip, .filter, .letters, .jr-bar, .jr-view, .jr-mini, .jr-key, .block-more, .panel-page { display: none !important; }
  html.jr-js:not(.jr-textmode) body { height: auto; display: block; overflow: visible; }
  html.jr-js:not(.jr-textmode) .jr-text, html.jr-js:not(.jr-textmode) .site-footer { display: block; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page { max-width: none; padding: 0; }
  .row { display: block; }
  .note { margin: var(--s3) 0 var(--s4); padding-left: var(--s3); border-left: 1px solid #999; }
  .section, .block, .trouble, .protocol, figure, table, .gl-item { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  a { text-decoration: none; }
  .sources a[href^="http"]::after, .centres a[href^="http"]::after { content: " <" attr(href) ">"; font-size: 0.85em; word-break: break-all; }
  .sheet .dgm .step, .sheet .dgm .draw { animation: none !important; opacity: 1 !important; stroke-dashoffset: 0 !important; }
}
