/* ============================================================
   pdverse — Detailed Design Analysis / Mentor Guide
   Screen stylesheet. No external fonts, no scripts, no network.
   ============================================================ */

:root {
  /* Colour system */
  --navy: #121f2b;
  --body-ink: #2c3e50;
  --teal: #007a78;
  --orange: #c85a17;
  --panel: #f7f9fa;
  --panel-strong: #e8eef2;
  --border: #c5d0d6;
  --white: #ffffff;
  --grey-ref: #8a97a0;

  /* Type */
  --font-ui: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* Screen scale (readable browser sizes; hierarchy preserved from print system) */
  --step-eyebrow: 0.875rem;
  --step-body: 1.05rem;
  --step-lead: 1.2rem;
  --step-h2: 1.5rem;
  --step-h1: 2.15rem;
  --step-cover-title: 2.6rem;
  --step-small: 0.875rem;
  --step-code: 0.92rem;

  --content-max: 46rem;
  --wide-max: 64rem;
  --radius: 6px;
}

* { box-sizing: border-box; }





a { color: var(--teal); text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: var(--white);
  padding: 0.6em 1em;
  z-index: 100;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- Masthead / running header on screen ---------- */
.masthead {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: var(--step-small);
  color: var(--navy);
  font-weight: 700;
}
.masthead .book-title { color: var(--teal); font-weight: 700; }

/* ---------- Cover ---------- */
.cover {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}
.cover .eyebrow {
  color: var(--teal);
  font-size: var(--step-eyebrow);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 1.5rem;
}
.cover h1 {
  font-size: var(--step-cover-title);
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 1rem;
  max-width: 26ch;
}
.cover .cover-sub {
  color: var(--body-ink);
  font-size: var(--step-lead);
  max-width: 46ch;
  margin: 0 0 2rem;
}
.cover .cover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: var(--step-small);
  color: var(--grey-ref);
}
.cover .cover-meta span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25em 0.9em;
}
.cover-grid {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.cover-text { flex: 1 1 260px; min-width: 200px; }
.cover-art { flex: 0 1 220px; max-width: 220px; margin: 0 auto; }
.cover-art img { width: 100%; height: auto; display: block; }
@media screen and (min-width: 560px) {
  .cover-grid { gap: 2.5rem; }
  .cover-text { flex-basis: 320px; min-width: 280px; }
  .cover-art { flex-basis: 300px; max-width: 300px; }
}

/* ---------- Layout shell ---------- */
main { display: block; }
article.chapter { padding-bottom: 4rem; }

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}
.wrap-wide {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 2.25rem 0;
  border-top: 1px solid var(--border);
}
section:first-of-type { border-top: none; }
section > .wrap, section > .wrap-wide { }

/* ---------- Headings ---------- */
h1, h2, h3, h4 { color: var(--navy); font-weight: 700; line-height: 1.25; }
h1 { font-size: var(--step-h1); margin: 0 0 0.75rem; }
h2 {
  font-size: var(--step-h2);
  margin: 0 0 1.1rem;
  padding: 0.55rem 0.9rem;
  background: linear-gradient(90deg, var(--panel-strong) 0%, rgba(232, 238, 242, 0) 100%);
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
}
h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.6rem;
  padding: 0.3rem 0 0.3rem 0.7rem;
  background: linear-gradient(90deg, rgba(18, 31, 43, 0.05) 0%, rgba(18, 31, 43, 0) 85%);
  border-left: 3px solid var(--navy);
}
h4 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }

.kicker {
  display: block;
  color: var(--teal);
  font-size: var(--step-eyebrow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.lead { font-size: var(--step-lead); color: var(--navy); }

p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.4rem; }
li { margin-bottom: 0.4rem; }

/* ---------- Contents / nav ---------- */
nav.contents {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
nav.contents ol {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 1;
  gap: 0.5rem 2rem;
}
@media (min-width: 640px) {
  nav.contents ol { columns: 2; }
}
nav.contents li { break-inside: avoid; margin-bottom: 0.5rem; }
nav.contents a {
  display: flex;
  gap: 0.6em;
  text-decoration: none;
  color: var(--body-ink);
}
nav.contents .num { color: var(--teal); font-weight: 700; font-variant-numeric: tabular-nums; }
nav.contents a:hover .title { text-decoration: underline; }

/* ---------- Sidebars ---------- */
.sidebar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  background: var(--white);
}
.sidebar .sidebar-label {
  display: inline-block;
  font-size: var(--step-eyebrow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.sidebar > :last-child { margin-bottom: 0; }

.sidebar-why { border-left: 4px solid var(--teal); }
.sidebar-why .sidebar-label { color: var(--teal); }

.sidebar-whatif { border-left: 4px solid var(--grey-ref); background: var(--panel); }
.sidebar-whatif .sidebar-label { color: var(--teal); }

.sidebar-practice { border-left: 4px solid var(--navy); }
.sidebar-practice .sidebar-label { color: var(--navy); }

.sidebar-trap { border-left: 4px solid var(--orange); background: #fdf4ee; }
.sidebar-trap .sidebar-label { color: var(--orange); }

.sidebar-takeaway { border-left: 4px solid var(--teal); background: #eef8f7; }
.sidebar-takeaway .sidebar-label { color: var(--teal); }

.sidebar-aside { border-left: 4px solid var(--navy); background: var(--panel); }
.sidebar-aside .sidebar-label { color: var(--navy); }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; margin: 1.25rem 0; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
caption {
  text-align: left;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
thead th {
  background: var(--navy);
  color: var(--white);
  text-align: left;
  padding: 0.55em 0.8em;
  font-weight: 700;
  position: sticky;
  top: 0;
}
tbody th { text-align: left; background: var(--panel-strong); }
td, tbody th { padding: 0.55em 0.8em; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:nth-child(even) { background: var(--panel); }

/* ---------- Code ---------- */
code {
  font-family: var(--font-mono);
  /* 0.875em scales with the surrounding text, but inside a small-text
     context (e.g. 0.875rem labels/captions at 14px) that multiplies down
     to 12.25px, under the 14px screen floor. max() keeps inline code at
     0.875rem (14px at the default root size) as a hard floor, while still
     growing past it in a larger-than-root context. Screen CSS only --
     print.css sets its own code sizing and is not touched by this rule. */
  font-size: max(0.875em, 0.875rem);
  background: var(--panel-strong);
  border-radius: 3px;
  padding: 0.1em 0.4em;
  overflow-wrap: break-word;
  word-break: break-word;
}
pre {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
  font-size: var(--step-code);
  line-height: 1.55;
  margin: 1.1rem 0;
}
pre code { background: none; padding: 0; font-size: 1em; }

/* Mobile-readability pass: a <pre> command block defaults to the browser's
   native `white-space: pre` behaviour (no wrapping at all), so every
   multi-word Tcl command required horizontal scrolling on a narrow
   viewport even when it would have fit comfortably wrapped onto two
   lines. Below 700px, let a command line wrap at its normal space
   boundaries (between the command name and a flag, or between two
   flags) while keeping every individual token -- a command name or a
   "-flag" -- intact: word-break: keep-all blocks a mid-token break, so a
   line that still cannot fit (a single long unbroken token) falls back to
   the pre's own horizontal scrollbar instead of being torn apart --
   scrolling only for the commands that genuinely cannot wrap safely. */
@media (max-width: 780px) {
  pre {
    white-space: pre-wrap;
    overflow-wrap: normal;
    word-break: keep-all;
  }
}
/* Wraps a single "-flag" token inside an inline <code> element (see
   build_cts_html.py's post-processing step). On screen there is normally
   room enough that this never visibly changes anything; it exists so the
   same markup behaves correctly in print, where table columns are
   narrower. */
.notok { white-space: nowrap; }
.prompt { color: var(--teal); font-weight: 700; }
.tcl-comment { color: var(--teal); font-style: italic; }
.report-label {
  display: inline-block;
  font-size: var(--step-eyebrow);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-ref);
  margin-bottom: 0.4rem;
  font-weight: 700;
}

/* ---------- Figures ---------- */
figure {
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--white);
}
figure.wide { max-width: var(--wide-max); }
.fig-kicker {
  display: block;
  color: var(--teal);
  font-size: var(--step-eyebrow);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
figure svg, figure img { display: block; width: 100%; height: auto; }
figcaption { margin-top: 0.75rem; font-size: 0.92rem; }
figcaption .read-it { color: var(--navy); font-weight: 700; }
.fig-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.6rem;
  font-size: 0.875rem;
  color: var(--body-ink);
}
.fig-legend span { display: inline-flex; align-items: center; gap: 0.4em; }

/* Cross-reference callout that replaces a duplicated figure: two lines
   pointing back at the figure already shown, instead of redrawing it. */
.fig-recall {
  margin: 1.25rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  background: var(--panel, #f6f8fa);
  font-size: 0.95rem;
  color: var(--body-ink);
}
.fig-recall .read-it { color: var(--navy); font-weight: 700; }
.swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

/* ---------- Command cards ---------- */
.card-group-label {
  display: block;
  color: var(--teal);
  font-size: var(--step-eyebrow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 2rem 0 1rem;
}
.command-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem 1rem;
  margin: 0.85rem 0;
  break-inside: avoid;
}
.command-card h3 {
  margin: 0 0 0.15rem;
  padding: 0;
  background: none;
  border-left: none;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--navy);
}
.command-card .command-tagline { color: var(--grey-ref); font-size: 0.875rem; margin-bottom: 0.6rem; }
.command-card ol.scaffold {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem 1.1rem;
  min-width: 0;
}
.command-card ol.scaffold > li { padding-left: 0; min-width: 0; font-size: 0.92rem; }
.command-card ol.scaffold > li:nth-child(4) { grid-column: 1 / -1; }
.command-card ol.scaffold > li:nth-child(4) pre { margin: 0.2rem 0 0; }

/* Mobile-readability pass: below this width, the two-column scaffold grid
   above gives each field roughly a quarter of the viewport once the .wrap
   side padding and command-card padding are subtracted (measured ~135px
   of usable width at 390px). A <pre> command block in that column has no
   room to lay out even a short command, so it fell back to full-width
   horizontal scrolling for every card, not just the genuinely long
   commands. Collapsing to one column below 700px gives every field the
   full card width; the field that was already full-width (nth-child(4),
   the "Exact action" command block) is unaffected since grid-column: 1/-1
   already spans the only column. */
@media (max-width: 780px) {
  .command-card ol.scaffold {
    grid-template-columns: minmax(0, 1fr);
  }
}
.command-card .scaffold-label {
  display: block;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.1rem;
}
.command-card .scaffold-trap .scaffold-label { color: var(--orange); }

/* Conceptual-workflow prose: replaces an icc2_shell> code block for any
   command this chapter cannot independently verify against a public
   source (see qa/command-verification.csv). Deliberately NOT styled like
   <pre>/<code> -- no monospace block, no terminal border, no prompt --
   so it reads as descriptive teaching prose, not a literal, copyable,
   runnable transcript. Command names inside still use a plain inline
   <code> (ordinary technical-writing convention for naming a command),
   distinguished from a truly verified command only by the surrounding
   "conceptual workflow example" label and cw-tag chip. */
.conceptual-workflow {
  display: block;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--body-ink);
}
.conceptual-workflow .cw-tag {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 3px;
  padding: 0.05em 0.45em;
  margin: 0.15rem 0.5em 0.3rem 0;
}
.conceptual-workflow code.illustrative {
  background: var(--panel-strong);
  border-radius: 3px;
  padding: 0.05em 0.35em;
  font-size: 0.95em;
}
.conceptual-workflow .cw-env-note {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--grey-ref);
}
/* Section-level disclosure banner: placed once at the top of any Part
   that continues to name commands inline (tables, checklist "Evidence"
   cells, report references) rather than in an icc2_shell> block. Those
   inline mentions were judged not to need individual prose rewrites --
   naming a report by its command name in a table cell is ordinary
   reference-table style, not a claim that the syntax is verified or a
   literal runnable transcript -- but every such Part still gets this
   explicit, visible disclosure up front rather than leaving the
   verification status unstated. */
.cw-disclosure {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--grey-ref);
  border-left: 3px solid var(--teal);
  padding: 0.4rem 0.8rem;
  margin: 0.6rem 0 1rem;
  background: var(--panel-strong);
}

/* ---------- Readiness / advanced-control cards (Part 3, Part 6) ---------- */
.advctrl-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem 1.05rem;
  margin: 1rem 0;
  break-inside: avoid;
}
.advctrl-kicker {
  display: inline-block;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 0.2rem;
}
.advctrl-card h3 { margin: 0 0 0.5rem; font-size: 1.05rem; color: var(--navy); }
.advctrl-fields { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; margin: 0; }
.advctrl-fields dt {
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  margin-top: 0.75rem;
}
.advctrl-fields dt:first-child { margin-top: 0; }
.advctrl-fields dd { margin: 0.2rem 0 0; font-size: 1rem; }
.advctrl-fields dd ul, .advctrl-fields dd ol { margin: 0.2rem 0 0; padding-left: 1.3rem; }
.advctrl-fields dd li { margin: 0.2rem 0; }
.advctrl-fields .table-scroll { margin-top: 0.3rem; }
.advctrl-fields .table-scroll table { font-size: 0.9rem; }

/* .technique-card: same visual scaffold as .advctrl-card, used for the
   Part A/B/C subcards that split a Part 6 technique into three shorter
   cards instead of one oversized one. No layout changes needed beyond
   inheriting .advctrl-card's border/padding/spacing -- this class exists
   so the subcards can be styled independently later without touching the
   original advanced-control cards. */
.technique-card { margin-top: 0.6rem; }
.technique-card:first-of-type { margin-top: 1rem; }
.technique-part-label {
  /* Layout-fix (PDF composition pass): was `display: inline-block`. Six of
     the Part A technique cards place an `.advctrl-kicker` span (the
     Timing / Congestion & Routability / Area & Power / Legality /
     High-fanout / Physical constraints group name) immediately after this
     <p> in the markup. Two adjacent inline-block elements flow onto the
     same line whenever there is room, which merged the two into one
     visual line -- "PART A -- PROBLEM AND SYMPTOMS LEGALITY" -- reading as
     a duplicated or run-on label. This element is always meant to occupy
     its own line whether or not something follows it, so it is block-level
     unconditionally rather than relying on width to force the wrap. */
  display: block;
  font-size: max(0.875em, 0.875rem);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--orange);
  margin: 0 0 0.35rem;
}

/* .trouble-cards: a five-field symptom/cause/checks/evidence/action card
   layout, used in place of a five-column table. A five-column table with
   prose and code in every cell does not have room for its content at
   either A4-print or narrow-mobile widths -- columns end up too narrow to
   hold an unbreakable command token, so it overflows into the next
   column instead of wrapping. One card per symptom avoids that by
   construction: every field gets the full content width. */
/* Two-up-per-page attempt (density pass) tried and rejected: pairing two
   trouble-cards per table row, the same technique that works for Part 3's
   shorter advctrl-cards, was verified by rebuild to fail here. Each
   trouble-card's seven dt/dd fields carry noticeably longer prose than an
   advctrl-card's; at half the page width the fields wrap to enough extra
   lines that a single card grows taller than one page even with tightened
   (not shrunk-font) spacing, so `tr { break-inside: avoid }` could not
   place the row without splitting a card's own fields across the page
   boundary -- and a code token in a narrowed CHECKS field also clipped
   past its card's border. Both are worse defects than the one-card-per-
   page layout this pass tried to improve, so it was reverted rather than
   shipped; see qa/layout-audit.md for the documented, content-driven
   density this section keeps instead. */
.trouble-cards { margin: 1rem 0; }
/* Routing chapter fix: .trouble-card previously had no box styling and no
   break-inside protection of its own (only .trouble-cards' container margin
   and .trouble-card h3's type style existed). Without break-inside: avoid,
   Chromium's print engine happily split a card's dl fields across a page
   boundary, leaving a bare dt label ("EVIDENCE", "CHECKS") opening the next
   page with no visible symptom name above it -- the same defect class the
   Clock Tree Synthesis chapter's card-fragmentation pass fixed for
   .command-card and .technique-card. Every trouble-card's dl is short
   enough (seven brief dt/dd pairs) that moving the whole card to a fresh
   page costs at most one mostly-full page, never a multi-page regression. */
.trouble-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.1rem 0.85rem;
  margin: 0.85rem 0;
  break-inside: avoid;
}
.trouble-card h3 { margin: 0.1rem 0 0.4rem; font-size: 1.05rem; color: var(--navy); }
/* Page-balance pass: a trouble-card's seven dt/dd fields, at .advctrl-fields'
   general spacing (0.75rem margin-top per dt, meant for the shorter 2-4 field
   advctrl-card), made every trouble-card tall enough that two of them could
   not both fit under one page's break-inside: avoid even though each is well
   under half a page. That forced one short card per page with roughly half
   the page left blank, and the next card pushed whole to a fresh page --
   exactly the "one page nearly empty, composition looks accidental" defect.
   Tightening spacing specifically inside .trouble-card (not the general
   .advctrl-fields rule other cards still use) brings two cards comfortably
   under one page's height in the common case, without shrinking any font
   size or removing any field. */
/* The first tightening pass (smaller dt/dd margins alone) was not enough --
   each field still cost a full dt line plus a full dd line, and a seven-
   field card was still tall enough that two of them would not both fit
   under one page even with the smaller margins. A second attempt floated
   dt into a fixed-width label column, but .advctrl-fields is a CSS Grid
   container (see its base rule above) and float has no effect on a grid
   item by specification -- the float was silently ignored, so dt and dd
   kept stacking as two full lines per field exactly as before. The actual
   fix overrides display to a two-column grid scoped to .trouble-card only,
   with dt and dd auto-placed side by side as label and value -- one grid
   row per field instead of two stacked block lines, which is what removes
   the extra line per field this pass is after. */
.trouble-card .advctrl-fields {
  display: grid;
  grid-template-columns: 10.5rem minmax(0, 1fr);
  column-gap: 0.7em;
  row-gap: 0.32rem;
}
.trouble-card .advctrl-fields dt {
  margin: 0;
  font-size: 0.8125rem;
  align-self: start;
}
.trouble-card .advctrl-fields dd {
  margin: 0;
}
.advctrl-cite { font-style: italic; color: var(--grey-ref); }
/* Website mobile-width check (verify-by-rebuild pass): at 390px, the fixed
   10.5rem dt label column above left too little room for dd's value text
   and code tokens, pushing the whole card past the viewport edge -- a
   real horizontal-overflow defect on the website build (the print build
   never sees this, since print.css does not load on screen). Below
   780px, the same breakpoint already used to collapse .command-card
   ol.scaffold to one column, drop .trouble-card's dt/dd grid to one
   column too: label above value, same as .advctrl-fields' own default. */
@media (max-width: 780px) {
  .trouble-card .advctrl-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* .exit-checklist-table: Part 12's 26 stage-exit cards reuse .trouble-card
   for its box/heading/field styling, but -- unlike Part 9's cards, whose
   longer prose made a two-up table overflow when tried (see the comment
   on .trouble-cards above) -- every field here is a short one-liner
   (a report name, "100% routed", "PASS"). Density pass: one card per page
   left roughly three-quarters of every page blank (each card is ~20-25%
   of a page tall at full width), the same "accidental-looking" sparse
   page defect fixed elsewhere with a two-up table. Verified by rebuild
   this time to fit comfortably, two cards per row, without the overflow
   .trouble-table hit. */
.exit-checklist-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.exit-checklist-table .trouble-card { margin: 0.5rem 0; }
.exit-checklist-table .trouble-card .advctrl-fields {
  grid-template-columns: 8.5rem minmax(0, 1fr);
}
/* Website mobile-width check: a two-up table row (50/50 <td>s, same
   technique as .advctrl-table) is too narrow a column for a card at
   390px regardless of the dt/dd fix above. Below 780px every <td>
   becomes a full-width block, so cards stack one per row instead of two
   side by side -- the same collapse .advctrl-table's own two-up layout
   needs at this width (scoped here to both, since .advctrl-table had no
   mobile rule at all before this pass). */
@media (max-width: 780px) {
  .exit-checklist-table td, .advctrl-table td, .trouble-table td {
    display: block;
    width: 100%;
    padding: 0;
  }
}

/* ---------- Checklists ---------- */
.checklist { list-style: none; margin: 0 0 1rem; padding: 0; }
.checklist li {
  padding: 0.5em 0 0.5em 1.9em;
  position: relative;
  border-bottom: 1px dashed var(--border);
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: "\2610";
  position: absolute;
  left: 0;
  color: var(--teal);
  font-size: 1.05em;
}
.checklist .evidence { display: block; color: var(--grey-ref); font-size: 0.875rem; margin-top: 0.2em; }

/* ---------- Q&A ---------- */
.qa {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 1.1rem 0;
  break-inside: avoid;
}
.qa-lead {
  color: var(--navy);
  font-weight: 600;
  margin: 0.3rem 0 0.8rem;
  padding-left: 0.7rem;
  border-left: 3px solid var(--teal);
}
.chip {
  display: inline-block;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.15em 0.6em;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.chip-beginner { background: #eef8f7; color: var(--teal); }
.chip-intermediate { background: var(--panel-strong); color: var(--navy); }
.chip-scenario { background: #fdf4ee; color: var(--orange); }
.chip-expert { background: var(--navy); color: var(--white); }
.qa h3 { font-size: 1rem; margin: 0.2rem 0 0.6rem; }
.qa dl { margin: 0; }
.qa dt { font-weight: 700; color: var(--navy); margin-top: 0.6rem; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.04em; }
.qa dd { margin: 0.2rem 0 0; }

/* ---------- Flashcards ---------- */
.flashcards { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .flashcards { grid-template-columns: 1fr 1fr; } }
.flashcard { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.flashcard .front { background: var(--navy); color: var(--white); padding: 0.9rem 1.1rem; font-weight: 700; }
.flashcard .back { padding: 0.9rem 1.1rem; }

/* ---------- Glossary ---------- */
.glossary dt { font-weight: 700; color: var(--navy); font-family: var(--font-mono); font-size: 0.95rem; margin-top: 0.9rem; }
.glossary dd { margin: 0.2rem 0 0; }

/* ---------- Sidebar legend table already covered by table styles ---------- */

/* ---------- Sign-off / summary ---------- */
.summary-table td:first-child { font-weight: 700; color: var(--navy); white-space: nowrap; }

/* ---------- Footer ---------- */
.page-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem 3rem;
  display: flex;
  align-items: center;
  font-size: var(--step-small);
  color: var(--grey-ref);
}
.page-footer svg { width: 34px; height: 34px; flex-shrink: 0; }
.page-footer a { color: var(--teal); font-weight: 700; }
.page-footer .footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--grey-ref);
  text-decoration: none;
}
.page-footer .footer-link span { color: var(--teal); font-weight: 700; }
.page-footer .footer-link:hover span { text-decoration: underline; }
.page-footer .footer-link img { border-radius: 3px; }

/* ---------- Bridge / nav buttons ---------- */
.bridge {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}
.bridge .kicker { margin-bottom: 0.4rem; }

/* Utility */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0;
}

/* Website-package-only additions: chapter cross-navigation, not present in the
   shared book stylesheet this file was forked from. */
.chapter-nav {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; justify-content: space-between;
  max-width: 60rem; margin: 0 auto; padding: 0.6rem 1.25rem;
  font-size: 0.875rem; border-bottom: 1px solid var(--border, #c5d0d6);
}
.chapter-nav a { color: var(--teal, #007a78); text-decoration: none; }
.chapter-nav a:hover, .chapter-nav a:focus { text-decoration: underline; }
.chapter-nav em { color: var(--grey-ref, #8a97a0); font-style: italic; }
.chapter-nav-disabled {
  color: var(--grey-ref, #8a97a0);
  cursor: default;
  user-select: none;
}
.chapter-nav-disabled em { color: var(--grey-ref, #8a97a0); }
.back-to-contents { display: block; margin: 0.75rem 0 0; font-size: 0.875rem; }
.back-to-contents a { color: var(--teal, #007a78); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--orange, #c85a17); outline-offset: 2px; }

/* ============================================================
   Correction pass — verification-disclosure banner label
   Every disclosure banner now opens with an explicit kicker in the
   same visual register as the neighbouring cards, instead of a bare
   run of command names with no context (layout audit, page 17).
   ============================================================ */
.cw-disclosure .cw-disclosure-label {
  display: block;
  font-family: var(--font-ui);
  font-style: normal;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.25rem;
}

/* ============================================================
   Correction pass — evidence dashboards (Part 3, 5, 6, 7, 12)
   Built as real HTML tables, never CSS Grid: an auto-placed grid
   does not reliably honour break-inside: avoid across a Chromium
   print page boundary, which has been confirmed twice on this
   chapter. A <table> with per-row break-inside: avoid does.
   ============================================================ */
.dashboard { margin: 1.5rem 0 1.8rem; }
.dashboard > .dash-kicker {
  display: block;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--navy);
  border-bottom: 2px solid var(--teal);
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
}
.dashboard > .dash-lead {
  font-size: 0.92rem;
  margin: 0 0 0.7rem;
}
table.dash {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 0.87rem;
}
table.dash caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
  padding-bottom: 0.35rem;
}
table.dash th, table.dash td {
  border: 1px solid var(--border);
  padding: 0.3rem 0.45rem;
  vertical-align: top;
  text-align: left;
}
table.dash thead th {
  background: var(--panel-strong);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
}
table.dash tbody th[scope="row"] { background: var(--panel); font-weight: 700; }
table.dash tbody tr.dash-group th {
  background: var(--navy);
  color: var(--white);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
table.dash code { font-size: 0.93em; word-break: keep-all; overflow-wrap: normal; }

/* Status vocabulary: colour AND text AND a distinct shape, so the
   status survives both grayscale printing and colour-blind reading. */
.st { font-weight: 700; white-space: nowrap; }
.st .st-glyph {
  display: inline-block;
  width: 0.72em;
  height: 0.72em;
  margin-right: 0.3em;
  border: 1.5px solid currentColor;
  vertical-align: baseline;
}
.st-pass { color: #1d7a4c; }
.st-pass .st-glyph { border-radius: 50%; background: currentColor; }
.st-review { color: #b8730f; }
.st-review .st-glyph { border-radius: 0; background: none; transform: rotate(45deg); }
.st-blocker { color: #b02318; }
.st-blocker .st-glyph { border-radius: 1px; background: currentColor; }

.dash-verdict {
  margin-top: 0.7rem;
  border: 2px solid var(--navy);
  padding: 0.55rem 0.8rem;
  font-weight: 700;
  font-size: 0.95rem;
}
.dash-note { font-size: 0.82rem; color: var(--grey-ref); margin-top: 0.45rem; }

/* ---------------------------------------------------------------------
   Shared dashboard component (pd_dash.py) -- Chapter 6 onward.
   Section header rows and continuation titling. Both of these fix defects
   that were still open against Chapter 5 v3.
   --------------------------------------------------------------------- */
table.dash tbody tr.dash-section th {
  background: var(--navy, #16304f);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.80rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  text-align: left;
}
table.dash caption .dash-cont {
  font-weight: 600;
  font-style: italic;
  color: var(--grey-ref, #5b6a76);
  white-space: nowrap;
}
