/* ============================================================
   FOOTING — Operational infrastructure handbook
   IBM Plex Sans + IBM Plex Mono · cool paper · muted slate
   ============================================================ */

:root {
  --paper:        oklch(0.975 0.003 250);
  --paper-2:      oklch(0.965 0.004 250);
  --paper-3:      oklch(0.95 0.005 250);
  --ink:          oklch(0.18 0.012 250);
  --ink-2:        oklch(0.32 0.010 250);
  --ink-3:        oklch(0.48 0.008 250);
  --ink-4:        oklch(0.66 0.006 250);
  --ink-faint:    oklch(0.82 0.005 250);
  --rule:         oklch(0.88 0.006 250);
  --rule-soft:    oklch(0.93 0.005 250);

  --slate:        oklch(0.42 0.05 220);
  --slate-soft:   oklch(0.92 0.025 220);
  --slate-2:      oklch(0.55 0.06 220);

  --amber:        oklch(0.62 0.10 60);
  --amber-soft:   oklch(0.93 0.04 75);
  --amber-bg:     oklch(0.96 0.02 80);

  --red:          oklch(0.50 0.13 25);
  --green:        oklch(0.50 0.10 150);

  --selection:    oklch(0.87 0.05 220);

  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --measure: 68ch;
  --measure-wide: 88ch;
  --gutter: clamp(18px, 3.5vw, 48px);
  --nav-w: 280px;

  --radius: 3px;
}

[data-theme="dark"] {
  --paper:        oklch(0.16 0.008 250);
  --paper-2:      oklch(0.19 0.009 250);
  --paper-3:      oklch(0.13 0.007 250);
  --ink:          oklch(0.92 0.005 250);
  --ink-2:        oklch(0.78 0.008 250);
  --ink-3:        oklch(0.62 0.010 250);
  --ink-4:        oklch(0.45 0.010 250);
  --ink-faint:    oklch(0.32 0.010 250);
  --rule:         oklch(0.30 0.010 250);
  --rule-soft:    oklch(0.24 0.010 250);

  --slate:        oklch(0.78 0.06 220);
  --slate-soft:   oklch(0.28 0.05 220);
  --slate-2:      oklch(0.68 0.06 220);

  --amber:        oklch(0.80 0.10 70);
  --amber-soft:   oklch(0.32 0.06 75);
  --amber-bg:     oklch(0.24 0.04 80);

  --red:          oklch(0.72 0.13 25);
  --green:        oklch(0.72 0.10 150);

  --selection:    oklch(0.36 0.07 220);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: pretty;
  transition: background 0.18s, color 0.18s;
}
::selection { background: var(--selection); }

a { color: var(--slate); text-decoration: underline; text-decoration-color: var(--ink-faint); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--slate); }

strong, b { font-weight: 600; color: var(--ink); }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--paper-3);
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  padding: 0.05em 0.4em;
  color: var(--ink-2);
}

pre {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  background: var(--paper-3);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  overflow-x: auto;
  color: var(--ink-2);
  margin: 20px 0;
}
pre code { background: transparent; border: 0; padding: 0; color: inherit; font-size: inherit; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 48px 0; }

/* ============================================================
   Disclaimer banner (carried from the landing page)
============================================================ */
.disclaimer-banner {
  background: var(--amber-bg);
  border-bottom: 1px solid var(--amber-soft);
  font-size: 12.5px;
  color: var(--ink-2);
}
.disclaimer-banner .inner {
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--gutter);
  max-width: 1480px; margin: 0 auto;
}
.disclaimer-banner .dot {
  width: 7px; height: 7px; background: var(--amber); border-radius: 50%; flex-shrink: 0;
}
.disclaimer-banner strong { color: var(--ink); }

/* ============================================================
   Top bar
============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--paper) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.topbar-inner {
  max-width: 1480px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 12px var(--gutter);
}
.brand {
  display: flex; align-items: baseline; gap: 12px;
  text-decoration: none; color: var(--ink);
  flex-shrink: 0;
}
.brand-mark {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand-mark::before {
  content: "";
  width: 16px; height: 16px;
  background:
    linear-gradient(135deg, var(--slate) 50%, transparent 50%),
    var(--ink);
  border-radius: 1px;
}
.brand-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.topbar-spacer { flex: 1; }

.search {
  position: relative;
  width: min(360px, 36vw);
}
.search input {
  width: 100%;
  background: var(--paper-3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 7px 12px 7px 32px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.search input:focus { border-color: var(--slate-2); }
.search input::placeholder { color: var(--ink-3); }
.search .icon-search {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px; color: var(--ink-3); pointer-events: none;
}
.search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--paper);
  color: var(--ink-3);
  border: 1px solid var(--rule-soft);
  padding: 1px 5px;
  border-radius: 2px;
  pointer-events: none;
}

.btn-text, .btn-icon {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 12.5px;
  cursor: pointer;
  padding: 6px 10px;
  text-decoration: none;
  transition: all 0.12s;
}
.btn-icon { padding: 0; width: 32px; height: 32px; justify-content: center; }
.btn-text:hover, .btn-icon:hover {
  color: var(--ink); border-color: var(--ink-faint); background: var(--paper-3);
}
.btn-icon svg { width: 14px; height: 14px; }
.btn-text .icon { width: 12px; height: 12px; }
.btn-primary {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--ink-2); color: var(--paper); border-color: var(--ink-2);
}

/* ============================================================
   Layout
============================================================ */
.layout {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  gap: 56px;
  align-items: start;
}

/* ─── Sidebar nav ─── */
aside.nav {
  position: sticky; top: 96px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 36px 0 80px;
  font-size: 13px;
  color: var(--ink-2);
}
.nav-section {
  margin-bottom: 22px;
}
.nav-section-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.nav-section-title::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--rule-soft);
}
.nav ol, .nav ul { list-style: none; padding: 0; margin: 0; }
.nav a {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 4px;
  align-items: baseline;
  padding: 4px 10px 4px 12px;
  margin-left: -12px;
  text-decoration: none;
  color: var(--ink-2);
  border-left: 1px solid transparent;
  line-height: 1.35;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  border-radius: 0 2px 2px 0;
}
.nav a .n {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-left-color: var(--slate); background: var(--paper-2); }
.nav a.active .n { color: var(--slate); }

.nav-cta {
  margin-top: 8px;
  padding: 12px 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.45;
}
.nav-cta .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.nav-cta a {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
}
.nav-cta a:hover { border-bottom-color: var(--slate); color: var(--slate); }

/* ─── Main ─── */
main {
  padding: 36px 0 120px;
  min-width: 0;
}

/* ============================================================
   Hero
============================================================ */
.hero {
  max-width: var(--measure-wide);
  padding: 40px 0 64px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 64px;
}
.eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 26px;
}
.eyebrow .dot {
  width: 7px; height: 7px; background: var(--slate); border-radius: 50%; flex-shrink: 0;
}
.eyebrow .sep { flex: 1; border-top: 1px solid var(--rule); }
.hero h1 {
  font-weight: 500;
  font-size: clamp(32px, 4.8vw, 52px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
  color: var(--ink);
  max-width: 22ch;
}
.hero h1 .alt {
  color: var(--slate);
  font-style: normal;
  font-weight: 400;
}
.hero .lede {
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 28px;
  max-width: 58ch;
}
.hero .meta {
  display: flex; flex-wrap: wrap; gap: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
  margin-top: 28px;
}
.hero .meta > div {
  flex: 1 1 150px;
  padding: 2px 18px 2px 0;
  border-right: 1px solid var(--rule-soft);
}
.hero .meta > div:last-child { border-right: 0; }
.hero .meta dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.hero .meta dd { margin: 0; font-size: 13.5px; color: var(--ink); }

.hero-actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 20px;
}

/* ============================================================
   Chapter / part chrome
============================================================ */
section.chapter {
  max-width: var(--measure-wide);
  margin: 0 0 96px;
  scroll-margin-top: 80px;
}
section.chapter.narrow { max-width: var(--measure); }

.chapter-head {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  padding-bottom: 24px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.chapter-roman {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: var(--slate);
  letter-spacing: 0.04em;
  line-height: 1;
}
.chapter-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.chapter-head h2 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.12;
  letter-spacing: -0.022em;
  color: var(--ink);
}
.chapter-head p.intro {
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 15.5px;
  max-width: 60ch;
}

.part-head {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 20px;
  align-items: baseline;
  margin: 56px 0 24px;
  padding-top: 24px;
  border-top: 1px solid var(--rule-soft);
}
.part-head:first-of-type { padding-top: 0; border-top: 0; margin-top: 0; }
.part-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.part-head h3 {
  margin: 0;
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h4 {
  font-weight: 600;
  font-size: 15px;
  margin: 32px 0 10px;
  color: var(--ink);
  letter-spacing: -0.005em;
  display: flex; align-items: baseline; gap: 10px;
}
h4 .h4-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  font-weight: 500;
}

h5 {
  font-weight: 600;
  font-size: 12.5px;
  margin: 24px 0 8px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

p { margin: 0 0 12px; color: var(--ink-2); }
p strong { color: var(--ink); }
p em { color: var(--ink); }

ul, ol { color: var(--ink-2); padding-left: 22px; margin: 0 0 16px; }
li { margin: 3px 0; }
li::marker { color: var(--ink-4); }
ul li::marker { font-size: 0.9em; }

blockquote {
  margin: 22px 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--slate);
  color: var(--ink-2);
  font-size: 15px;
}
blockquote strong { color: var(--ink); }

/* Notice / callout */
.callout {
  margin: 22px 0;
  padding: 14px 16px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-soft);
  border-left: 2px solid var(--amber);
  border-radius: 2px;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.callout strong { color: var(--ink); }
.callout.info {
  background: var(--paper-3);
  border-color: var(--rule-soft);
  border-left-color: var(--slate);
}

/* ============================================================
   Tables
============================================================ */
.table-wrap {
  margin: 20px 0;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
th, td {
  padding: 9px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-2);
}
tr:last-child td { border-bottom: 0; }
th {
  background: var(--paper-3);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
td strong { color: var(--ink); }
table.compact td, table.compact th { padding: 7px 12px; font-size: 13px; }
table .mono { font-family: var(--font-mono); font-size: 12.5px; }

/* ============================================================
   Folder tree
============================================================ */
.tree-card {
  margin: 24px 0;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  background: var(--paper-2);
  overflow: hidden;
}
.tree-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--paper-3);
}
.tree-card-head .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tree-card-head .actions { display: flex; gap: 6px; }
.tree-card-head button {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-3);
  padding: 3px 8px;
  border-radius: 2px;
  cursor: pointer;
}
.tree-card-head button:hover { color: var(--ink); border-color: var(--ink-faint); }

.tree {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  padding: 12px 16px;
  margin: 0;
  list-style: none;
}
.tree ul {
  list-style: none;
  padding-left: 18px;
  margin: 0;
  border-left: 1px dashed var(--rule);
  margin-left: 6px;
}
.tree li { margin: 0; }
.tree .node {
  display: flex; align-items: baseline; gap: 8px;
  cursor: default; user-select: none;
  padding: 1px 4px;
  border-radius: 2px;
}
.tree .node.dir { cursor: pointer; color: var(--ink); }
.tree .node.dir:hover { background: var(--paper); }
.tree .node.has-readme { cursor: pointer; }
.tree .node.has-readme:hover { background: var(--paper); color: var(--ink); }
.tree .twist {
  display: inline-block; width: 12px;
  font-size: 9.5px;
  color: var(--ink-3);
  transition: transform 0.15s;
  flex-shrink: 0; text-align: center;
}
.tree .node.dir.open > .twist { transform: rotate(90deg); }
.tree .name { color: inherit; }
.tree .file .name { color: var(--ink-2); }
.tree .comment {
  color: var(--ink-3); margin-left: 12px; font-style: italic;
}
.tree .badge {
  display: inline-block;
  margin-left: 8px;
  padding: 0 5px;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--slate-soft);
  color: var(--slate);
  border-radius: 2px;
  font-family: var(--font-mono);
}
.tree li.collapsed > ul { display: none; }

/* ============================================================
   Modal (folder README popups)
============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: color-mix(in oklch, var(--ink) 30%, transparent);
  z-index: 100;
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 80px 20px 40px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  max-width: 720px; width: 100%;
  box-shadow: 0 20px 50px -20px color-mix(in oklch, var(--ink) 40%, transparent);
  font-size: 14px;
  color: var(--ink-2);
  max-height: calc(100vh - 120px);
  display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--rule-soft);
}
.modal-head .title {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
}
.modal-head button {
  background: transparent; border: 0;
  color: var(--ink-3); cursor: pointer;
  font-size: 18px; line-height: 1;
  padding: 0 4px;
}
.modal-head button:hover { color: var(--ink); }
.modal-body {
  padding: 22px 26px;
  overflow-y: auto;
  line-height: 1.6;
}
.modal-body h1, .modal-body h2, .modal-body h3 { color: var(--ink); }
.modal-body h1 { font-size: 20px; margin: 0 0 12px; font-weight: 500; }
.modal-body h2 { font-size: 14px; margin: 18px 0 8px; font-weight: 600; }
.modal-body p { font-size: 14px; }
.modal-body ul { font-size: 14px; }
.modal-body pre { font-size: 12px; }

/* ============================================================
   Mistakes (Affidavit chapter)
============================================================ */
.mistakes { margin: 24px 0; counter-reset: mistake; }
.mistake {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  background: var(--paper-2);
}
.mistake h5 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-transform: none;
  margin: 0 0 10px;
  color: var(--ink);
  display: flex; align-items: baseline; gap: 10px;
}
.mistake h5::before {
  counter-increment: mistake;
  content: "Mistake " counter(mistake);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 500;
}
.mistake-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}
.mistake-grid > div {
  padding: 12px 14px;
  border-radius: 2px;
  font-size: 13.5px;
  line-height: 1.5;
}
.mistake-grid .bad {
  background: color-mix(in oklch, var(--red) 8%, var(--paper));
  border: 1px solid color-mix(in oklch, var(--red) 25%, transparent);
}
.mistake-grid .good {
  background: color-mix(in oklch, var(--green) 6%, var(--paper));
  border: 1px solid color-mix(in oklch, var(--green) 20%, transparent);
}
.mistake-grid .tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 600;
}
.mistake-grid .bad .tag { color: var(--red); }
.mistake-grid .good .tag { color: var(--green); }
@media (max-width: 700px) { .mistake-grid { grid-template-columns: 1fr; } }

/* Hearsay yes/no columns */
.hearsay-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin: 22px 0;
}
.hearsay-cols .col {
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--rule-soft);
}
.hearsay-cols .yes { background: color-mix(in oklch, var(--green) 5%, var(--paper)); border-color: color-mix(in oklch, var(--green) 18%, transparent); }
.hearsay-cols .no { background: color-mix(in oklch, var(--red) 5%, var(--paper)); border-color: color-mix(in oklch, var(--red) 18%, transparent); }
.hearsay-cols h6 {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 8px;
  font-weight: 600;
}
.hearsay-cols .yes h6 { color: var(--green); }
.hearsay-cols .no h6 { color: var(--red); }
.hearsay-cols ul { font-size: 13.5px; padding-left: 18px; margin: 0; }
.hearsay-cols li { margin: 5px 0; color: var(--ink-2); }
@media (max-width: 700px) { .hearsay-cols { grid-template-columns: 1fr; } }

/* ============================================================
   Annexure sample
============================================================ */
.annexure-sample {
  margin: 24px 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 60px 40px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.8;
  text-align: center;
  position: relative;
}
.annexure-sample::before {
  content: "ANNEXURE COVER PAGE";
  position: absolute;
  top: 10px; left: 14px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--ink-4);
}
.annexure-sample .anx-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--ink);
  margin-bottom: 36px;
}
.annexure-sample .sigline {
  display: inline-block;
  border-bottom: 1px solid var(--ink-2);
  width: 240px;
  margin: 18px auto 6px;
  height: 12px;
}
.annexure-sample .witness {
  font-size: 11px;
  color: var(--ink-3);
}

/* ============================================================
   MWD render
============================================================ */
.mwd-section {
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  margin-bottom: 14px;
  background: var(--paper-2);
  overflow: hidden;
}
.mwd-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14.5px;
  color: var(--ink);
  font-weight: 500;
  user-select: none;
}
.mwd-section > summary::-webkit-details-marker { display: none; }
.mwd-section > summary::before {
  content: "+";
  font-family: var(--font-mono);
  color: var(--ink-3);
  font-size: 16px;
  line-height: 1;
  font-weight: 400;
  width: 12px;
  transition: transform 0.15s;
}
.mwd-section[open] > summary::before { content: "−"; }
.mwd-section .mwd-num {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  width: 28px;
}
.mwd-section .mwd-body {
  padding: 6px 22px 20px 60px;
  font-size: 13.5px;
  color: var(--ink-2);
  border-top: 1px solid var(--rule-soft);
}
.mwd-section .mwd-body p:first-child { margin-top: 14px; }

/* ============================================================
   Cadence timeline
============================================================ */
.cadence-track {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  background: var(--paper-2);
  overflow: hidden;
  margin: 24px 0 14px;
}
.cadence-cell {
  position: relative;
  padding: 16px 14px 80px;
  border-right: 1px solid var(--rule-soft);
  cursor: pointer;
  transition: background 0.12s;
  min-height: 170px;
}
.cadence-cell:last-child { border-right: 0; }
.cadence-cell:hover { background: var(--paper); }
.cadence-cell.active { background: var(--paper); }
.cadence-cell .when {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.cadence-cell .focus {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.35;
}
.cadence-cell .marker {
  position: absolute;
  left: 14px; right: 14px; bottom: 16px;
  height: 2px;
  background: var(--rule);
}
.cadence-cell .marker::before {
  content: "";
  position: absolute;
  left: 0; top: -3px;
  width: 8px; height: 8px;
  background: var(--slate);
  border-radius: 50%;
}
.cadence-cell.active .marker { background: var(--slate); }
.cadence-detail {
  padding: 16px 18px;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  background: var(--paper-2);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.55;
  min-height: 70px;
}
.cadence-detail .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 4px;
}
.cadence-detail .heading {
  font-size: 15px; color: var(--ink); font-weight: 500; margin-bottom: 8px;
}
@media (max-width: 900px) {
  .cadence-track { grid-template-columns: 1fr 1fr; }
  .cadence-cell { border-right: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft); }
}

/* ============================================================
   Checklist
============================================================ */
.checklist {
  margin: 24px 0;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
}
.checklist-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 10px 14px;
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule-soft);
}
.checklist-head .label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 6px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  padding: 4px 9px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.12s;
}
.chip:hover { color: var(--ink); border-color: var(--ink-faint); }
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .count { margin-left: 5px; opacity: 0.6; }
.checklist-group { padding: 12px 16px; border-top: 1px solid var(--rule-soft); }
.checklist-group:first-child { border-top: 0; }
.checklist-group h4 {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.check-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 5px 0;
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.4;
  cursor: pointer;
}
.check-item input { display: none; }
.check-item .box {
  width: 13px; height: 13px;
  border: 1.5px solid var(--rule);
  border-radius: 2px;
  flex-shrink: 0; margin-top: 3px;
  position: relative;
  transition: all 0.12s;
}
.check-item:hover .box { border-color: var(--ink-faint); }
.check-item input:checked + .box {
  background: var(--ink); border-color: var(--ink);
}
.check-item input:checked + .box::after {
  content: "";
  position: absolute;
  left: 2.5px; top: -0.5px;
  width: 4px; height: 8px;
  border: solid var(--paper);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.check-item input:checked ~ .text {
  color: var(--ink-4);
  text-decoration: line-through;
  text-decoration-color: var(--ink-faint);
}
.checklist-group.hidden { display: none; }

/* ============================================================
   Hard rules list (AI chapter)
============================================================ */
.hard-rules { margin: 24px 0; counter-reset: rule; }
.hard-rule {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-top: 1px solid var(--rule-soft);
  align-items: baseline;
}
.hard-rule:last-child { border-bottom: 1px solid var(--rule-soft); }
.hard-rule .rn {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
}
.hard-rule h5 {
  margin: 0 0 6px;
  font-size: 14.5px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.005em;
  text-transform: none;
}
.hard-rule p { font-size: 13.5px; margin-bottom: 0; }

/* Copy block */
.copy-block {
  margin: 24px 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  overflow: hidden;
}
.copy-block-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  background: var(--paper-3);
  border-bottom: 1px solid var(--rule-soft);
}
.copy-block-head .label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.copy-block-head button {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  padding: 4px 9px;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.copy-block-head button:hover { color: var(--ink); border-color: var(--ink-faint); }
.copy-block-head button.copied {
  color: var(--green); border-color: var(--green);
}
.copy-block pre {
  border: 0; margin: 0; border-radius: 0;
  max-height: 480px;
  background: var(--paper-2);
}

/* Workflow patterns (AI chapter) */
.pattern { margin-bottom: 20px; }
.pattern h5 {
  margin-bottom: 8px;
  text-transform: none;
  font-size: 13.5px;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--ink);
}
.pattern h5 .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
  margin-right: 8px;
}

/* ============================================================
   Risk list
============================================================ */
.risk-list { list-style: none; padding: 0; margin: 24px 0; }
.risk-list li {
  display: grid; grid-template-columns: 24px 1fr; gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--rule-soft);
  align-items: baseline;
}
.risk-list li:last-child { border-bottom: 1px solid var(--rule-soft); }
.risk-list .glyph {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  font-weight: 600;
}
.risk-list .title {
  font-weight: 600; color: var(--ink); margin-right: 4px;
}

/* "Will / Will not" compare */
.compare {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  margin: 24px 0;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.compare > div { padding: 20px 22px; }
.compare > div:first-child { border-right: 1px solid var(--rule-soft); }
.compare h4 {
  margin: 0 0 12px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.compare .wont h4 { color: var(--red); }
.compare .will h4 { color: var(--green); }
.compare ul { margin: 0; padding-left: 18px; }
.compare li { margin: 7px 0; font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 700px) {
  .compare { grid-template-columns: 1fr; }
  .compare > div:first-child { border-right: 0; border-bottom: 1px solid var(--rule-soft); }
}

/* ============================================================
   Footer
============================================================ */
footer.colophon {
  max-width: var(--measure-wide);
  margin: 60px 0 0;
  padding: 24px 0 0;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  display: flex; flex-wrap: wrap; gap: 12px 32px;
}
footer.colophon strong { color: var(--ink-2); font-weight: 500; }

/* ============================================================
   Search highlight + filter
============================================================ */
mark.search-hit {
  background: var(--selection);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}
.dim-no-match { opacity: 0.22; pointer-events: none; }
.search-empty {
  padding: 40px var(--gutter);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}

/* ============================================================
   Mobile
============================================================ */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  aside.nav {
    position: static;
    max-height: none;
    padding: 20px 0;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 28px;
  }
  .nav-section { margin-bottom: 16px; }
  .topbar-inner { gap: 8px; }
  .brand-meta { display: none; }
  .search { width: auto; flex: 1; min-width: 0; }
  .search kbd { display: none; }
  .hero h1 { font-size: 34px; }
  .chapter-head { grid-template-columns: 60px 1fr; gap: 14px; }
  .chapter-roman { font-size: 20px; }
  .part-head { grid-template-columns: 50px 1fr; gap: 12px; }
  .hero .meta { flex-direction: column; gap: 10px; }
  .hero .meta > div { border-right: 0; }
}

/* ============================================================
   Print
============================================================ */
@media print {
  :root {
    --paper: #fff; --paper-2: #fff; --paper-3: #f7f6f3;
    --ink: #111; --ink-2: #333; --ink-3: #666; --ink-4: #888;
    --rule: #ccc; --rule-soft: #e2e2e2;
    --slate: #2d3f5e;
  }
  body { font-size: 11pt; line-height: 1.45; }
  .topbar, aside.nav, .checklist-head, .tree-card-head .actions, .cadence-detail, .disclaimer-banner { display: none !important; }
  .layout { grid-template-columns: 1fr; padding: 0; gap: 0; max-width: none; }
  main { padding: 0; }
  section.chapter { max-width: none; page-break-inside: auto; margin-bottom: 32px; }
  .chapter-head, .part-head { page-break-after: avoid; }
  h4, h5 { page-break-after: avoid; }
  .tree-card, .checklist, .cadence-track, .table-wrap, pre, .mistake { page-break-inside: avoid; }
  .cadence-cell { padding-bottom: 24px; min-height: auto; }
  .cadence-cell .marker { display: none; }
  .checklist-group { display: block !important; }
  .mwd-section { display: block; }
  .mwd-section > summary::before { display: none; }
  .mwd-section .mwd-body { display: block !important; padding-top: 12px; }
  a { color: inherit; text-decoration: none; }
}
