/* Clinidiary User Manual — one stylesheet for the website, the PDF and the guides. */
@font-face {
  font-family: 'Figtree';
  src: url('fonts/figtree-var.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
:root {
  --ink: #0f1720;
  --ink-2: #1e293b;
  --ink-soft: #475569;
  --ink-faint: #64748b;
  --paper: #f2f4f7;
  --surface: #ffffff;
  --sunk: #f8fafc;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --teal: #12b8b0;
  --accent: #0d9488;
  --accent-text: #0f766e;
  --accent-soft: #effcfb;
  --mark: #e5243b;
  /* The pictures' markings: one calm blue, never on top of the screen (10 Nov 2026). */
  --pin: #0071e3;
  --pin-soft: rgba(0, 113, 227, 0.12);
  --amber: #b45309;
  --amber-soft: #fff8eb;
  --red-soft: #fff1f2;
  --violet: #6d28d9;
  --violet-soft: #f6f3ff;
  --slate-soft: #f1f5f9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 32, 0.05), 0 8px 24px -12px rgba(15, 23, 32, 0.12);
  --col: 860px;
  --side: 284px;
  --top: 64px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body {
  margin: 0;
  font-family: 'Figtree', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--paper);
  font-feature-settings: 'ss01';
}
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
img, svg { max-width: 100%; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.88em; background: var(--slate-soft); padding: 0.1em 0.35em; border-radius: 5px; }
kbd {
  font-family: inherit; font-size: 0.82em; font-weight: 600; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 0.05em 0.45em;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; letter-spacing: -0.015em; }

/* ------------------------------------------------------------ site shell */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { height: 30px; width: auto; display: block; }
.brand-sep { width: 1px; height: 22px; background: var(--line-2); }
.brand-t { font-weight: 650; font-size: 15px; white-space: nowrap; }
.edition { font-size: 12px; font-weight: 650; color: var(--accent-text); background: var(--accent-soft); border: 1px solid #c9efec; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.top-search { margin-left: auto; position: relative; width: min(380px, 40vw); }
.top-search input {
  width: 100%; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--sunk);
  padding: 0 12px 0 38px; font: inherit; font-size: 15px; color: var(--ink);
}
.top-search input:focus { outline: 2px solid var(--teal); outline-offset: 1px; background: #fff; }
.top-search .ic { position: absolute; left: 11px; top: 10px; color: var(--ink-faint); }
.top-search kbd { position: absolute; right: 10px; top: 9px; }
.top-pdf {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 10px;
  background: var(--ink); color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.top-pdf:hover { color: #fff; background: #1e293b; }
.menu-btn { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); align-items: center; justify-content: center; }

.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) 220px; gap: 0; max-width: 1480px; margin: 0 auto; }
.sidebar {
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto;
  padding: 22px 14px 40px 20px; border-right: 1px solid var(--line); font-size: 14.5px;
}
.side-part { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin: 20px 10px 6px; }
.side-part:first-child { margin-top: 0; }
.side-ch { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 9px; color: var(--ink-2); text-decoration: none; line-height: 1.3; }
.side-ch:hover { background: #fff; color: var(--ink); }
.side-ch .n { font-size: 12px; font-weight: 700; color: var(--ink-faint); width: 20px; flex: none; text-align: right; }
.side-ch.is-on { background: var(--ink); color: #fff; }
.side-ch.is-on .n { color: #9fe7e2; }
.side-sub { list-style: none; margin: 4px 0 8px 30px; padding: 0 0 0 10px; border-left: 2px solid var(--line); }
.side-sub a { display: block; padding: 4px 8px; font-size: 13.5px; color: var(--ink-soft); text-decoration: none; line-height: 1.35; border-radius: 6px; }
.side-sub a:hover, .side-sub a.is-on { color: var(--ink); background: #fff; }

.content { padding: 36px 48px 80px; min-width: 0; }
.content > article { max-width: var(--col); margin: 0 auto; }
.onpage { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 36px 20px 40px 8px; font-size: 13.5px; }
.onpage-h { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 8px; }
.onpage a { display: block; color: var(--ink-soft); text-decoration: none; padding: 4px 0 4px 10px; border-left: 2px solid var(--line); line-height: 1.35; }
.onpage a:hover, .onpage a.is-on { color: var(--ink); border-left-color: var(--teal); }

/* ------------------------------------------------------------ chapter head */
.ch-hero {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 34px 36px 30px; margin-bottom: 34px; overflow: hidden; box-shadow: var(--shadow);
}
.ch-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--accent-soft); }
.ch-hero > * { position: relative; z-index: 1; }
.ch-kicker { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 650; color: var(--accent-text); letter-spacing: 0.02em; }
.ch-icon { width: 44px; height: 44px; border-radius: 13px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.ch-hero h1 { font-size: 40px; margin: 14px 0 10px; letter-spacing: -0.025em; font-weight: 760; }
.ch-sum { font-size: 18px; color: var(--ink-soft); margin: 0 0 18px; max-width: 640px; line-height: 1.55; }
.ch-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-faint); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--slate-soft); border-radius: 99px; padding: 3px 10px; }
.ch-inthis { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.ch-inthis a { font-size: 14.5px; text-decoration: none; color: var(--ink-2); display: flex; gap: 8px; }
.ch-inthis a::before { content: '→'; color: var(--teal); font-weight: 700; }

/* ------------------------------------------------------------ prose */
article p, article li { max-width: 72ch; }
article > p, .feature > p { margin: 0 0 1em; }
article h2 { font-size: 29px; margin: 64px 0 18px; padding-top: 26px; border-top: 1px solid var(--line); font-weight: 740; display: flex; gap: 12px; align-items: center; }
article h2:first-of-type { margin-top: 10px; }
article h3 { font-size: 20.5px; margin: 38px 0 12px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
article h4 { font-size: 16.5px; margin: 26px 0 8px; font-weight: 700; }
.h-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.h-anchor { margin-left: 6px; color: var(--line-2); text-decoration: none; font-weight: 500; opacity: 0; transition: opacity 0.15s; }
h2:hover .h-anchor, h3:hover .h-anchor { opacity: 1; }
article ul, article ol { padding-left: 1.3em; }
article li { margin: 0.25em 0; }
article li::marker { color: var(--ink-faint); }
.lede { font-size: 18.5px; color: var(--ink-soft); line-height: 1.6; }
strong { color: var(--ink); font-weight: 650; }

/* A label exactly as it appears on screen. */
.ui {
  display: inline; font-size: 0.86em; font-weight: 650; line-height: 1.35; color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: 7px; padding: 0.06em 0.45em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; overflow-wrap: anywhere;
  box-shadow: 0 1px 0 rgba(15, 23, 32, 0.06);
}
/* A navigation path. */
.crumbs { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; vertical-align: baseline; }
.crumb { font-size: 0.86em; font-weight: 650; color: var(--accent-text); background: var(--accent-soft); border: 1px solid #c9efec; border-radius: 7px; padding: 0.04em 0.5em; overflow-wrap: anywhere; }
.crumb-sep { color: var(--ink-faint); font-weight: 700; padding: 0 2px; }

/* ------------------------------------------------------------ at a glance */
.glance { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 6px 0 24px; box-shadow: var(--shadow); }
.g-cell { background: var(--surface); padding: 16px 18px; }
.g-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.g-label .ic { color: var(--accent); }
.g-text { font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.g-where .g-text { line-height: 1.9; }

/* ------------------------------------------------------------ roles */
.roles { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 22px; }
.role { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; border-radius: 99px; padding: 3px 10px 3px 7px; border: 1px solid; }
.role b { width: 14px; text-align: center; }
.role-yes { color: #065f46; background: #ecfdf5; border-color: #a7f3d0; }
.role-some { color: #92400e; background: var(--amber-soft); border-color: #fcd9a5; }
.role-no { color: var(--ink-faint); background: var(--sunk); border-color: var(--line); text-decoration: line-through; text-decoration-color: rgba(100, 116, 139, 0.5); }
.roles-note { font-size: 13px; color: var(--ink-faint); margin-left: 4px; }

/* ------------------------------------------------------------ steps */
.steps { list-style: none; padding: 0; margin: 10px 0 26px; counter-reset: step; }
.steps > li { position: relative; padding: 0 0 22px 52px; counter-increment: step; max-width: none; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -1px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 15px; display: grid; place-items: center;
}
.steps > li::after { content: ''; position: absolute; left: 16px; top: 38px; bottom: 4px; width: 2px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.step-body > p:first-child { margin-top: 4px; }
.step-body p { margin: 0 0 0.6em; }
.step-body .shot { margin: 14px 0 6px; }

/* ------------------------------------------------------------ callouts */
.callout { display: flex; gap: 14px; border-radius: var(--radius); padding: 16px 18px; margin: 18px 0 24px; border: 1px solid; break-inside: avoid; }
.callout-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.callout-b { min-width: 0; }
.callout-b > :last-child { margin-bottom: 0; }
.callout-b p { margin: 0 0 0.5em; }
.callout-t { font-weight: 700; color: var(--ink); margin: 3px 0 4px !important; }
.c-tip { background: var(--accent-soft); border-color: #bfeae6; }
.c-tip .callout-ic { background: #fff; color: var(--accent); }
.c-note { background: var(--slate-soft); border-color: var(--line); }
.c-note .callout-ic { background: #fff; color: var(--ink-soft); }
.c-warning { background: var(--amber-soft); border-color: #fbd9a6; }
.c-warning .callout-ic { background: #fff; color: var(--amber); }
.c-important { background: var(--red-soft); border-color: #fecdd3; }
.c-important .callout-ic { background: #fff; color: var(--mark); }
.c-example { background: var(--violet-soft); border-color: #ddd3fd; }
.c-example .callout-ic { background: #fff; color: var(--violet); }
.c-outcome { background: #fff; border-color: var(--line); box-shadow: var(--shadow); }
.c-outcome .callout-ic { background: #ecfdf5; color: #059669; }

/* ------------------------------------------------------------ connects */
.connects { margin: 22px 0 30px; }
.connects-h { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }
.connects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.conn { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink-2); transition: border-color 0.15s, transform 0.15s; break-inside: avoid; }
.conn:hover { border-color: var(--teal); transform: translateY(-1px); color: var(--ink-2); }
.conn-t { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--ink); font-size: 15px; }
.conn-arrow { color: var(--teal); }
.conn-d { display: block; font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; margin-top: 3px; }

/* ------------------------------------------------------------ figures */
figure { margin: 22px 0 28px; }
.shot { width: 100%; max-width: var(--dw, 100%); }
.shot.is-zoom { margin-left: auto; margin-right: auto; }
.shot-frame { position: relative; background: #fff; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 2px rgba(15, 23, 32, 0.06), 0 18px 40px -22px rgba(15, 23, 32, 0.35); line-height: 0; cursor: zoom-in; }
.shot.is-zoom .shot-frame { border-color: #b9d6f7; }
.shot-svg { display: block; width: 100%; height: auto; }
/* Markings (figure.mjs): a ring outside the part, a hairline to a number in the margin. */
.an-gutter { fill: #f5f5f7; }
.an-halo { fill: none; stroke: rgba(255, 255, 255, 0.92); stroke-linecap: round; }
.an-ring { fill: none; stroke: var(--pin); }
.an-lead { fill: none; stroke: var(--pin); stroke-linecap: round; }
.an-tip { fill: var(--pin); stroke: #fff; stroke-width: 1px; }
.an-num circle { fill: var(--pin); stroke: #fff; }
.an-num text { fill: #fff; font-weight: 700; font-family: 'Figtree', sans-serif; }
.an-mark { transition: opacity 0.25s ease; }
.an-mark[data-n] .an-num { cursor: pointer; }
.an-mark[data-n]:focus-visible { outline: none; }
.an-mark[data-n]:focus-visible .an-num circle { stroke: #0f1720; }
/* Pointing at one part: the others step back. */
.shot.is-pointing .an-mark { opacity: 0.25; }
.shot.is-pointing .an-mark.is-hot { opacity: 1; }
/* Zoomed into one part: only its ring stays. */
.shot.is-closer .an-mark:not(.is-hot) { opacity: 0; }
.shot.is-closer .an-mark.is-hot .an-lead, .shot.is-closer .an-mark.is-hot .an-tip, .shot.is-closer .an-mark.is-hot .an-num { opacity: 0; }
.shot.is-closer .shot-frame { cursor: zoom-out; }
.zoom-out { position: absolute; right: 10px; bottom: 10px; display: none; align-items: center; gap: 6px; padding: 7px 12px 7px 10px; border: 0; border-radius: 999px; background: rgba(29, 29, 31, 0.78); color: #fff; font: 600 13px/1 'Figtree', sans-serif; cursor: pointer; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.zoom-out svg { width: 15px; height: 15px; }
.shot.is-closer .zoom-out { display: inline-flex; }
.fig-close { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: var(--pin-soft); color: #0058b0; font-size: 12px; font-weight: 700; }
figcaption { font-size: 13.5px; color: var(--ink-faint); margin-top: 10px; line-height: 1.5; }
.fig-n { font-weight: 700; color: var(--ink-soft); margin-right: 8px; }
.legend { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 18px; }
.legend li { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; line-height: 1.4; color: var(--ink-2); margin: 0; border-radius: 8px; padding: 2px 4px 2px 2px; }
.legend li[data-n] { cursor: pointer; }
.legend li[data-n]:hover, .legend li.is-hot { background: var(--pin-soft); }
.legend-n { flex: none; width: 21px; height: 21px; border-radius: 50%; background: var(--pin); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; margin-top: 0; }
.shot-pending { border: 2px dashed var(--line-2); border-radius: 12px; padding: 40px; text-align: center; color: var(--ink-faint); font-size: 14px; background: var(--sunk); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.pair figure { margin: 10px 0; }

/* Diagrams */
.diagram { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
.dg { display: block; width: 100%; height: auto; font-family: 'Figtree', sans-serif; }
.dg-wide { max-width: var(--vw); margin: 0 auto; }
.dg-tall { display: none; max-width: 380px; margin: 0 auto; }
.dg-one { max-width: var(--vw); margin: 0 auto; }
.diagram figcaption { text-align: center; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); background: var(--sunk); font-weight: 700; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; color: var(--ink); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 70px; padding-top: 26px; border-top: 1px solid var(--line); }
.pager a { display: block; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 14px 18px; text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--teal); }
.pager small { display: block; color: var(--ink-faint); font-size: 12.5px; font-weight: 600; }
.pager b { font-weight: 700; }
.pager .next { text-align: right; grid-column: 2; }

/* Home */
.home-hero { background: var(--ink); color: #cbd5e1; border-radius: 26px; padding: 52px 52px 46px; position: relative; overflow: hidden; margin-bottom: 30px; }
.home-hero h1 { color: #fff; font-size: 46px; margin: 18px 0 12px; letter-spacing: -0.03em; font-weight: 780; max-width: 640px; }
.home-hero p { font-size: 18.5px; max-width: 600px; margin: 0 0 24px; line-height: 1.55; }
.home-hero .dot { position: absolute; width: 340px; height: 340px; right: -90px; bottom: -120px; border-radius: 50%; background: var(--teal); opacity: 0.16; }
.home-hero .brand-w { height: 36px; }
.home-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 650; font-size: 15px; text-decoration: none; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { color: var(--ink); background: #e2fbf9; }
.btn-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, 0.28); }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.parts { display: grid; gap: 30px; }
.part-h { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-decoration: none; color: var(--ink-2); transition: border-color 0.15s, transform 0.15s; }
.card:hover { border-color: var(--teal); transform: translateY(-2px); color: var(--ink-2); }
.card-top { display: flex; align-items: center; gap: 10px; }
.card-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.card-n { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-faint); }
.card b { font-size: 16.5px; color: var(--ink); margin-top: 6px; }
.card span.d { font-size: 14px; color: var(--ink-soft); line-height: 1.45; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 10px 0 30px; }
.who { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.who b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.who p { font-size: 14px; margin: 0 0 8px; color: var(--ink-soft); }
.who a { font-size: 14px; display: block; }
.downloads { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.dl { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.dl:hover { border-color: var(--teal); }
.dl .ic { color: var(--mark); flex: none; }
.dl small { display: block; color: var(--ink-faint); font-size: 12.5px; }

/* Search */
.search-panel { position: fixed; inset: var(--top) 0 auto 0; z-index: 40; display: none; justify-content: center; padding: 10px 16px; }
.search-panel.is-open { display: flex; }
.search-box { width: min(720px, 100%); max-height: min(70vh, 640px); overflow-y: auto; background: #fff; border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 30px 60px -20px rgba(15, 23, 32, 0.35); padding: 8px; }
.sr { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink-2); }
.sr:hover, .sr.is-on { background: var(--accent-soft); }
.sr b { color: var(--ink); display: block; font-size: 15px; }
.sr small { color: var(--accent-text); font-weight: 600; font-size: 12px; }
.sr span { display: block; color: var(--ink-soft); font-size: 13.5px; line-height: 1.4; margin-top: 2px; }
.sr mark { background: #fef3c7; color: inherit; border-radius: 3px; }
.sr-empty { padding: 18px; color: var(--ink-faint); font-size: 14px; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 32, 0.86); display: none; align-items: center; justify-content: center; padding: 3vw; cursor: zoom-out; }
.lightbox.is-open { display: flex; }
.lightbox svg { width: auto; max-width: 96vw; max-height: 92vh; background: #fff; border-radius: 10px; }

.site-foot { max-width: var(--col); margin: 60px auto 0; font-size: 13px; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1240px) {
  .layout { grid-template-columns: var(--side) minmax(0, 1fr); }
  .onpage { display: none; }
}
@media (max-width: 960px) {
  :root { --side: 300px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-flex; }
  .sidebar { position: fixed; z-index: 35; top: var(--top); left: 0; width: min(var(--side), 86vw); background: var(--paper); transform: translateX(-102%); transition: transform 0.2s; box-shadow: 20px 0 40px -20px rgba(15, 23, 32, 0.3); }
  body.nav-open .sidebar { transform: none; }
  .content { padding: 26px 22px 70px; }
  .brand-t { display: none; }
  .top-pdf span { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-sep, .edition { display: none; }
  .top-search { width: auto; flex: 1; }
  .top-search kbd { display: none; }
  .content { padding: 18px 16px 60px; }
  .ch-hero { padding: 24px 20px; border-radius: 18px; }
  .ch-hero h1 { font-size: 31px; }
  .ch-sum { font-size: 16.5px; }
  article h2 { font-size: 24px; margin-top: 48px; }
  .h-ic { width: 34px; height: 34px; }
  .glance { grid-template-columns: 1fr; }
  .steps > li { padding-left: 44px; }
  .steps > li::before { width: 30px; height: 30px; font-size: 14px; }
  .steps > li::after { left: 14px; top: 34px; }
  .dg-wide { display: none; }
  .dg-tall { display: block; }
  .diagram { padding: 14px; }
  .pair, .cols { grid-template-columns: 1fr; }
  .home-hero { padding: 32px 22px; border-radius: 20px; }
  .home-hero h1 { font-size: 32px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .legend { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* The chapter's own contents list is for print and small screens; on a wide
   screen the rail beside the page already shows it. */
@media (min-width: 961px) { body.site .ch-inthis { display: none; } }
@media (min-width: 1241px) { .side-sub { display: none; } }
.ch-dl { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent-text); text-decoration: none; }
.ch-dl:hover { text-decoration: underline; }
.ch-dls { margin-top: 16px; }
.ch-dls summary { cursor: pointer; font-weight: 650; color: var(--ink); margin-bottom: 10px; }

/* Diagram as a list, for phones. */
.dg-list { display: none; font-size: 15px; }
.dg-list ul, .dg-list ol { list-style: none; margin: 0; padding: 0; counter-reset: dgl; }
.dg-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--line); margin: 0; line-height: 1.4; }
.dg-list ol li::before { counter-increment: dgl; content: counter(dgl); font-weight: 800; font-size: 13px; color: var(--ink-faint); width: 16px; flex: none; }
.dg-list em { color: var(--ink-faint); font-style: normal; font-size: 13px; }
.dgl-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 6px; }
.dgl-center { display: flex; gap: 10px; align-items: center; font-size: 16px; padding-bottom: 8px; }
@media (max-width: 720px) {
  .dg-one { display: none; }
  .dg-list { display: block; }
}
.diagram { cursor: zoom-in; }

.lightbox .zoom-out { display: none !important; }
