/* GENERATED FILE — DO NOT EDIT.
   Source: styles/acts/act-library.css.tmpl
   Regenerate: npm run build:act-styles
   Both act stylesheets come from one template; editing this copy would
   silently re-fork them and be reverted by the next build. */
/* ───────────────────────────────────────────────────────────────────────────
 * NRMA — Library reader styles
 *
 * Three-column reader (sticky TOC | prose ~720px | tools/refs rail) plus
 * the Act/Read tab strip used by chapter-shell.js. Lives inside #nrma-hero,
 * the cream page in light theme and navy in dark. Every panel is the flat
 * raised sheet the rest of the site uses (raised + 1px line + 12px radius +
 * --guide-shadow-rest); lake is every link, button, tab and focus ring; moss /
 * ochre / brick appear only where a rule encodes a graded status.
 *
 * Print rules emit a clean PDF-ready document (tabs/rails hidden, full-width
 * prose, page-break safety on headings, citations rendered as footnote-style).
 *
 * COLOUR, AND THE TWO PLACES A LITERAL IS STILL CORRECT HERE
 *   Everything that means something — an interaction, a status, a source kind,
 *   a section kind — resolves through the role layer in theme-tokens.css.
 *   Two families deliberately do not:
 *
 *   1. @media print. Print has no theme, so a role token there resolves to
 *      whatever the SCREEN theme happens to be — which is how you ship navy
 *      ink, or near-white ink, onto paper. The print block keeps #000.
 *
 *   2. The document facsimiles. The bill and ARM sections, and the standalone
 *      bill/ARM views, imitate printed Montana legislative paper: ~30 cream,
 *      parchment and brown-ink values that carry no role and are not meant to
 *      flip, because the container above them is what flips. Collapsing them
 *      onto --paper / --raised would make the bill, the rule notice and the
 *      prose card the same surface, which is the one thing they must not be.
 *      If you are sweeping literals, these are not the ones.
 *
 *   Uppercase is likewise kept only inside those facsimiles (a bill title is
 *   set in capitals on paper) and on short eyebrows: an id chip or an 11px
 *   kicker. Headings, tabs, buttons, pills and running labels are sentence
 *   case, and headings take --guide-font-display.
 * ──────────────────────────────────────────────────────────────────────── */

/* ─── Act / Read tab strip (used by chapter-shell.js + library-view.js) ─── */
/* A tab is navigation, so every tab is the ACTION role: active = solid lake +
   on-action text; inactive = a raised surface with a lake border and lake
   text; the focus ring is lake too, offset so it clears the lake fill.
   Phase D a11y (2026-05-21): min-height 44px to meet WCAG 2.5.5 touch-target
   guidance. */
.nrma-lib-tabs {
  display: flex;
  align-items: center;
  gap: var(--guide-sp-1);
  width: 100%;
  max-width: 1180px;
  margin: 0 auto var(--guide-sp-4);
  padding: 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--guide-color-line);
  border-radius: 0;
  box-shadow: none;
}
.nrma-lib-tabs-spacer { flex: 1 1 auto; }
/* The same tab the hubs use: text, and one underline for "you are here". These
   were pill buttons in a shadowed bar, a filled blue pill for the current one and
   an outlined pill for each other, which read as a row of calls to action rather
   than as the three ways to see one chapter (Act, Read, Library). Phase D a11y
   (2026-05-21): min-height 44px for WCAG 2.5.5 touch targets. */
.nrma-lib-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  min-height: 44px;
  min-width: 44px;
  padding: var(--guide-sp-3);
  font-size: var(--guide-fs-sm);
  font-weight: 600;
  color: var(--guide-color-ink-soft);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  text-decoration: none;
}
.nrma-lib-tab:hover { color: var(--guide-color-ink); }
.nrma-lib-tab:focus-visible {
  outline: 2px solid var(--guide-color-action);
  outline-offset: -2px;
}
.nrma-lib-tab.is-active {
  color: var(--guide-color-action);
  border-bottom-color: var(--guide-color-action);
}
.nrma-lib-tab--minor { font-weight: 500; align-items: center; }
/* Each view says what it is for. The view you are not on reads as the way over: its name in the
   action colour, so "Read" is visibly where the framework's own text is. */
.nrma-lib-tab-main { font-size: var(--guide-fs-md, 15px); line-height: 1.2; }
.nrma-lib-tab-sub { font-size: var(--guide-fs-xs); font-weight: 400; line-height: 1.3; color: var(--guide-color-ink-muted); }
.nrma-lib-tab:not(.is-active):not(.nrma-lib-tab--minor) .nrma-lib-tab-main { color: var(--guide-color-action); text-decoration: underline; text-underline-offset: 3px; }
.nrma-lib-tab.is-active .nrma-lib-tab-sub { color: var(--guide-color-ink-soft); }

/* ─── Library root container ─── */
.nrma-lib-root {
  width: 100%;
  /* On wide laptops/desktops we want to use the room — but cap at 1720px so
     line length in the prose card never becomes uncomfortable to read. */
  max-width: min(96vw, 1720px);
  margin: 0 auto;
  padding: 0 20px 60px;
  color: var(--guide-color-ink);
  /* Override .nrma-hero-inner's text-align: center inheritance — prose
     should read left-to-right, never centered. */
  text-align: left;
  /* Override flexbox align-items: center on .nrma-hero-inner — we want
     the reader chrome to fill the available width, not shrink to content. */
  align-self: stretch;
}
.nrma-lib-loading,
.nrma-lib-error {
  padding: 40px 20px;
  text-align: center;
  color: var(--guide-color-ink-soft);
  font-size: var(--guide-fs-base);
}
.nrma-lib-error {
  color: var(--guide-color-status-crit);
}

/* ─── 3-column grid ─── */
.nrma-lib-grid {
  display: grid;
  /* Wider TOC + meaningfully wider right rail so citation excerpts, tool
     chips and "Further reading" entries get real estate on laptop+ screens.
     Prose column gets minmax(0, 1fr) so it flexes to fill remaining space. */
  /* The rails were 280 + 360 with a 40px gap, which left the prose ~58ch at
     1440px. Narrower rails and a 32px gap give it ~68ch there. */
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr) minmax(260px, 300px);
  gap: 32px;
  align-items: start;
}

/* ─── Theme-adaptive side-panel tokens (TOC + rail) ─────────────────────────
 * Both flanking panels were built as hardcoded dark glass (white text, pastel
 * chips) to sit on the dark hero backdrop. In the reading view they actually
 * sit against the cream prose surface, so they clashed in light theme and
 * never adapted.
 *
 * WUA Remix was given a --wlp-* layer for this as a light/dark pair; NRMA was
 * left on the hardcoded glass. That single omission is why thirty-two rules in
 * this file were forked per act — the same declaration, once as a token and
 * once as a literal. The layer is now shared and act-neutral.
 *
 * It needs NO [data-theme="dark"] half, and that is the point: every value
 * below resolves through a role token that already carries a measured dark
 * value, or through --guide-wash-rgb, which flips ink-on-light to
 * white-on-dark. A second copy of the layer would be a second place for the
 * palette to drift.
 * ─────────────────────────────────────────────────────────────────────────── */
.nrma-lib-toc,
.nrma-lib-rail {
  /* The flat raised sheet. It was a frosted card held off opaque so the page
     read through frosted glass; content panels are solid. */
  --alp-bg: var(--guide-color-raised);
  --alp-shadow: var(--guide-shadow-rest);
  --alp-border: var(--guide-color-line);
  --alp-divider: var(--guide-color-line);
  --alp-text: var(--guide-color-text-secondary);
  --alp-text-strong: var(--guide-color-text-primary);
  --alp-text-muted: var(--guide-color-text-muted);
  --alp-hover-bg: rgba(var(--guide-wash-rgb), 0.06);
  /* A current TOC entry is a SELECTED STATE, so it is the action colour. It
     was the brand red, which is what made the wordmark's hue mean "you are
     here" as well. */
  --alp-active-bg: color-mix(in srgb, var(--guide-color-action) 14%, transparent);
  --alp-active-text: var(--guide-color-action);
  --alp-input-bg: rgba(var(--guide-wash-rgb), 0.05);
  --alp-input-text: var(--guide-color-text-primary);
  --alp-input-ph: var(--guide-color-text-muted);
  /* A field or button outline is a UI boundary and owes WCAG 1.4.11 its 3:1,
     which is exactly the split --guide-color-line-strong exists for; the old
     rgba(0,0,0,0.14) hairline did not clear it on either ground. */
  --alp-btn-border: var(--guide-color-line-strong);
  --alp-btn-bg: rgba(var(--guide-wash-rgb), 0.05);
  --alp-btn-text: var(--guide-color-text-primary);
  --alp-btn-hover-bg: rgba(var(--guide-wash-rgb), 0.10);
  --alp-result-bg: rgba(var(--guide-wash-rgb), 0.04);
  --alp-result-border: var(--guide-color-border-subtle);
  --alp-result-text: var(--guide-color-text-secondary);
  /* Source-kind chips (statute, case, peer-reviewed…) are a TAXONOMY, not a
     status ladder, so they carry no status hue: the chip says its kind in
     words. They were ochre / lake / moss, which read as watch / link / ok. */
  --alp-chip-mute-bg: rgba(var(--guide-wash-rgb), 0.05);
  --alp-chip-mute-border: rgba(var(--guide-wash-rgb), 0.12);
  --alp-chip-mute-text: var(--guide-color-text-muted);
}
/* ─── Left: Sticky TOC ─── */
.nrma-lib-toc {
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  /* Inner padding matches the rail card so TOC + rail read as a matched
     pair flanking the prose. */
  padding: 18px 16px;
  /* Solid-feeling card so the TOC reads as its own panel against the
     reading surface (matches the rail card). Theme-adaptive via --alp-* tokens. */
  background: var(--alp-bg);
  border: 1px solid var(--alp-border);
  border-radius: 12px;
  font-size: var(--guide-fs-sm);
  /* Same shadow as the rail card so both side panels match visually. */
  box-shadow: var(--alp-shadow);
}
.nrma-lib-toc-list,
.nrma-lib-toc-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nrma-lib-toc-sublist {
  margin: 4px 0 8px 8px;
  border-left: 1px solid var(--alp-divider);
  padding-left: 10px;
}
.nrma-lib-toc-item { margin-bottom: 4px; }
.nrma-lib-toc-link {
  display: block;
  padding: 5px 8px;
  color: var(--alp-text);
  text-decoration: none;
  border-radius: 6px;
  line-height: 1.35;
  transition: background 120ms ease, color 120ms ease;
}
.nrma-lib-toc-link:hover {
  background: var(--alp-hover-bg);
  color: var(--alp-text-strong);
}
.nrma-lib-toc-link--h1 {
  font-weight: 600;
  font-size: 13px;
  color: var(--alp-text-strong);
}
.nrma-lib-toc-link--h2 { font-size: 12.5px; }
.nrma-lib-toc-link--h3 { font-size: 12px; opacity: 0.78; }
.nrma-lib-toc-link.is-current {
  background: var(--alp-active-bg);
  color: var(--alp-active-text);
  font-weight: 700;
}

/* ─── Center: Prose surface ─── */
.nrma-lib-prose {
  background: var(--guide-color-raised);
  color: var(--guide-color-ink);
  border: 1px solid var(--guide-color-line);
  border-radius: 12px;
  /* Balanced top/bottom padding so the prose card feels evenly weighted
     between the metadata header and the closing whitespace. */
  padding: 56px 48px 64px;
  box-shadow: var(--guide-shadow-rest);
  /* Reading measure: ~68ch of body text plus the 2 × 48px padding. It was a
     920px card, which the three-column grid squeezed to ~58ch at 1440px and
     which ran past 90ch once the grid collapsed. */
  max-width: calc(68ch + 96px);
  margin: 0 auto;
  /* CRITICAL: grid items default to min-width: auto which means they can
     overflow their column to fit min-content. This caused the prose card
     to extend ~250px under the right rail at 1440px viewports. Force
     min-width: 0 so the card honors its grid cell width. */
  min-width: 0;
  /* Serif for long reading; system fallback */
  font-family: "Source Serif Pro", "Charter", "Iowan Old Style", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.68;
  letter-spacing: 0;
  /* Tabular numerals + ligatures for editorial polish */
  font-variant-numeric: oldstyle-nums proportional-nums;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  /* Hard reset of ancestor centering — prose ALWAYS reads left. */
  text-align: left;
  hyphens: auto;
  -webkit-hyphens: auto;
}
/* Belt-and-suspenders: every block-level prose child stays left-aligned
   unless a section template (Bill: justify; etc.) explicitly overrides. */
.nrma-lib-prose p,
.nrma-lib-prose h1,
.nrma-lib-prose h2,
.nrma-lib-prose h3,
.nrma-lib-prose h4,
.nrma-lib-prose ul,
.nrma-lib-prose ol,
.nrma-lib-prose li,
.nrma-lib-prose blockquote,
.nrma-lib-prose .nrma-lib-section,
.nrma-lib-prose .nrma-lib-section-body {
  text-align: left;
}
.nrma-lib-prose-header {
  border-bottom: 1px solid rgba(var(--guide-wash-rgb, 0, 0, 0), 0.08);
  padding-bottom: 20px;
  margin-bottom: 32px;
}
.nrma-lib-prose-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: var(--guide-fs-xs);
  color: var(--guide-color-ink-soft);
  margin-bottom: 14px;
  font-family: var(--guide-font-sans);
}
/* The chapter id chip ("FW-05") — an eyebrow, so it alone stays uppercase. */
.nrma-lib-prose-chip {
  display: inline-block;
  padding: 2px 8px;
  background: transparent;
  color: var(--guide-color-ink);
  border: 1px solid var(--guide-color-line-strong);
  border-radius: 4px;
  font-family: var(--guide-font-mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: var(--guide-label-case, uppercase);
  font-size: var(--guide-fs-2xs);
}
.nrma-lib-prose-date,
.nrma-lib-prose-author {
  font-weight: 500;
  font-size: var(--guide-fs-xs);
}
.nrma-lib-prose-author::before { content: "·"; margin-right: 8px; color: var(--guide-color-line-strong); }
.nrma-lib-prose-title {
  font-family: var(--guide-font-display);
  font-size: 38px;
  line-height: 1.10;
  margin: 6px 0 8px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--guide-color-ink);
  font-feature-settings: "kern" 1, "liga" 1;
}
.nrma-lib-prose-subtitle {
  font-size: 19px;
  line-height: 1.42;
  color: var(--guide-color-ink-soft);
  font-style: italic;
  margin: 0;
  font-weight: 400;
  max-width: 65ch;
}

/* ─── Sections + headings inside prose ─── */
.nrma-lib-section { margin-top: 56px; }
.nrma-lib-section + .nrma-lib-section { margin-top: 64px; }

/* All headings: block layout, anchor link positioned in the left margin so
   the heading TEXT aligns flush-left with body paragraphs. The ask button
   floats right outside the text flow. */
.nrma-lib-section-title {
  font-family: var(--guide-font-display);
  font-size: 30px;
  line-height: 1.20;
  margin: 0 0 24px;
  padding-top: 0;
  border-top: none;
  color: var(--guide-color-ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  position: relative;
}
.nrma-lib-section-titletext { display: inline; }

.nrma-lib-section-body h3,
.nrma-lib-section-body .nrma-heading--2 {
  font-family: var(--guide-font-display);
  font-size: var(--guide-fs-xl);
  margin: 36px 0 12px;
  font-weight: 600;
  color: var(--guide-color-ink);
  line-height: 1.30;
  letter-spacing: -0.005em;
  position: relative;
}
.nrma-lib-section-body .nrma-heading--3 {
  font-family: var(--guide-font-display);
  font-size: var(--guide-fs-lg);
  margin: 26px 0 8px;
  font-weight: 600;
  color: var(--guide-color-ink-soft);
  letter-spacing: 0;
  position: relative;
}
.nrma-lib-section-body .nrma-heading--4 {
  font-size: var(--guide-fs-md);
  margin: 18px 0 6px;
  font-weight: 700;
  color: var(--guide-color-ink-soft);
  font-family: var(--guide-font-sans);
  position: relative;
}
/* Heading-text wrapper inside H2/H3/H4 — stay inline so anchor + text + ask
   button line up on the same baseline without flex gaps. */
.nrma-lib-section-body .nrma-heading-text {
  display: inline;
}

/* Paragraphs */
.nrma-lib-section-body p {
  margin: 0 0 16px;
  /* Slightly tighter rag for editorial feel */
}
/* First paragraph after a heading gets no extra top margin */
.nrma-lib-section-body h3 + p,
.nrma-lib-section-body .nrma-heading--2 + p,
.nrma-lib-section-body .nrma-heading--3 + p,
.nrma-lib-section-body .nrma-heading--4 + p { margin-top: 0; }

/* Strong text — sturdy without being overpowering */
.nrma-lib-prose strong {
  font-weight: 700;
  color: var(--guide-color-ink);
}

/* Refined list styling — custom marker color, hanging indent, generous leading */
.nrma-lib-section-body ul.nrma-list {
  margin: 10px 0 22px;
  padding-left: 0;
  list-style: none;
}
.nrma-lib-section-body ul.nrma-list li {
  margin-bottom: 10px;
  line-height: 1.62;
  padding-left: 22px;
  position: relative;
}
.nrma-lib-section-body ul.nrma-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.74em;
  width: 6px;
  height: 6px;
  background: var(--guide-color-ink-soft);
  border-radius: 50%;
  transform: translateY(-50%);
}
/* Nested list — open-ring marker */
.nrma-lib-section-body ul.nrma-list ul.nrma-list { margin: 8px 0 0; }
.nrma-lib-section-body ul.nrma-list ul.nrma-list li::before {
  background: transparent;
  border: 1.5px solid var(--guide-color-ink-soft);
}
/* Auto-bolded "Lead-in label:" at the start of bullet items — applied by
   _boldLeadIn() in scripts/wuar-build-content.js, which builds the content for
   both acts; there has never been an nrma-build-content.js. Renders as semibold
   ink-black so the label reads as a definition entry, with the rest of
   the sentence in regular weight. */
.nrma-lib-section-body .nrma-li-lead {
  font-weight: 700;
  color: var(--guide-color-ink);
}

/* Blockquote — subtle pull-quote feel */
.nrma-lib-section-body blockquote.nrma-quote {
  background: transparent;
  padding: 4px 0 4px 22px;
  margin: 22px 0;
  font-size: 19px;
  line-height: 1.55;
  font-style: italic;
  color: var(--guide-color-text-secondary);
  font-weight: 400;
}

/* ─── Modern table styling — clean, minimal, financial-grade ─── */
.nrma-lib-section-body .nrma-table-wrap {
  overflow-x: auto;
  margin: 24px 0;
  border: 1px solid var(--guide-color-line);
  border-radius: 8px;
  background: var(--guide-color-raised);
  /* Belt-and-suspenders so wide tables scroll inside the wrap instead of
     pushing the prose card past its grid cell. */
  max-width: 100%;
  min-width: 0;
}
/* Same protection for the section body — without min-width: 0, an inner
   wide element (table, pre, image) inherits min-content from its child and
   forces the prose grid item to overflow its column. */
.nrma-lib-section,
.nrma-lib-section-body { min-width: 0; }
.nrma-lib-section-body .nrma-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--guide-fs-sm);
  font-family: var(--guide-font-sans);
  line-height: 1.50;
  font-feature-settings: "tnum" 1;
}
.nrma-lib-section-body .nrma-table thead th {
  background: var(--guide-color-paper-2);
  color: var(--guide-color-ink-soft);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: var(--guide-fs-xs);
  border-bottom: 1px solid var(--guide-color-line-strong);
  /* Let multi-word headers wrap so they don't force the parent column to
     expand to fit the longest header — was 'nowrap', which caused the
     prose card to overflow its grid cell on narrower viewports. */
  white-space: normal;
  overflow-wrap: anywhere;
}
/* Inline <strong> inside a header cell should inherit the th color rather
   than fall through to `.nrma-lib-prose strong` (var(--guide-color-ink)). Without this,
   variants that paint the header dark (academic-data navy, bill near-black)
   render <strong>Agency</strong> as black-on-navy. */
.nrma-lib-section-body .nrma-table thead th strong,
.nrma-lib-section-body .nrma-table thead th b {
  color: inherit;
}
.nrma-lib-section-body .nrma-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--guide-color-line);
  vertical-align: top;
  color: var(--guide-color-ink-soft);
}
.nrma-lib-section-body .nrma-table tbody tr:hover td {
  background: var(--guide-color-paper-2);
}
/* Drop the zebra — clean lined rows read more modern */
.nrma-lib-section-body .nrma-table tbody tr:nth-child(even) td { background: transparent; }
/* First column tends to be the row label — make it slightly heavier */
.nrma-lib-section-body .nrma-table tbody tr td:first-child {
  font-weight: 600;
  color: var(--guide-color-ink);
}

/* Anchor links (#) next to headings — positioned in the left margin so
   they DON'T push heading text right of the body-paragraph left edge.
   Visible only on heading hover. */
.nrma-lib-section-body .nrma-anchor,
.nrma-lib-section-title .nrma-anchor {
  position: absolute;
  left: -1.4em;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  font-weight: 400;
  font-size: 0.55em;
  color: var(--guide-color-action);
  text-decoration: none;
  transition: opacity var(--guide-dur-fast) ease;
  font-family: var(--guide-font-mono);
  letter-spacing: 0;
  user-select: none;
}
.nrma-lib-section-body .nrma-heading:hover .nrma-anchor,
.nrma-lib-section-title:hover .nrma-anchor,
.nrma-lib-section-body h3:hover .nrma-anchor { opacity: 0.5; }
.nrma-lib-section-body .nrma-anchor:hover,
.nrma-lib-section-title .nrma-anchor:hover { opacity: 1; }

/* Glossary term (existing primitive — restyle for prose context) */
.nrma-lib-prose .nrma-term {
  border-bottom: 1px dotted var(--guide-color-action);
  cursor: help;
  background: transparent;
  padding: 0;
  border-radius: 0;
  transition: background 120ms ease;
}
.nrma-lib-prose .nrma-term:hover {
  background: color-mix(in srgb, var(--guide-color-action) 8%, transparent);
}

/* MCA + ARM citation chips — small monospace, subtle pill */
.nrma-lib-prose .nrma-mca,
.nrma-lib-prose .nrma-arm-ref {
  display: inline;
  font-family: var(--guide-font-mono);
  font-size: 0.85em;
  font-weight: 600;
  background: var(--guide-color-paper-2);
  border: 1px solid var(--guide-color-line);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--guide-color-ink);
  white-space: nowrap;
}
.nrma-lib-prose .nrma-arm-ref { border-color: var(--guide-color-line-strong); }

/* Cross-framework + tool inline links */
.nrma-lib-prose .nrma-fw-link {
  color: var(--guide-color-action);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--guide-color-action) 35%, transparent);
  font-weight: 600;
}
.nrma-lib-prose .nrma-fw-link:hover {
  border-bottom-color: var(--guide-color-action);
  background: color-mix(in srgb, var(--guide-color-action) 6%, transparent);
}
/* A tool link opens a tool: it is a link, so lake, told apart from a chapter
   link by its dashed rule. It was moss, the "ok" status hue, behind an emoji. */
.nrma-lib-prose .nrma-tool-link {
  color: var(--guide-color-action);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--guide-color-action) 50%, transparent);
  font-weight: 600;
  cursor: pointer;
}
.nrma-lib-prose .nrma-tool-link:hover {
  background: color-mix(in srgb, var(--guide-color-action) 6%, transparent);
  border-bottom-color: var(--guide-color-action);
}

/* Citation superscripts */
.nrma-lib-prose .nrma-cite {
  color: var(--guide-color-action);
  font-weight: 700;
  cursor: pointer;
  margin: 0 1px;
}
.nrma-lib-prose .nrma-cite:hover {
  text-decoration: underline;
}

/* "Ask the AI Coach" — the quiet secondary button: outlined lake, always
   visible. Both acts render the same ${k}-ask-btn class from
   src/acts/library-view.js, so this one rule styles WUA Remix and NRMA alike.
   It was invisible until hovered (opacity 0) and turned pink on hover. It
   floats right inside the heading without moving the heading text. */
.nrma-ask-btn {
  float: right;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 32px;
  min-height: 32px;
  padding: 4px 8px;
  font-family: var(--guide-font-sans);
  font-size: var(--guide-fs-sm);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  color: var(--guide-color-action);
  background: transparent;
  border: 1px solid var(--guide-color-action);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--guide-dur-fast) ease, color var(--guide-dur-fast) ease;
}
.nrma-ask-btn:hover {
  background: color-mix(in srgb, var(--guide-color-action) 8%, transparent);
  color: var(--guide-color-action-hover);
}
.nrma-ask-btn:focus-visible {
  outline: 2px solid var(--guide-color-action);
  outline-offset: 2px;
}
.nrma-ask-btn i,
.nrma-ask-btn svg { width: 16px; height: 16px; }

/* Flash highlight when arriving via deep link */
.nrma-lib-flash {
  animation: nrma-lib-flash 1800ms ease-out;
}

/* sr-only helper */
/* .sr-only is NOT redefined here. It lives in styles/utilities.css, which is a
   blocking sheet, so it is available on every route; this file is deferred, so a
   local copy was only ever a redundant second definition that happened to win.
   Removed 2026-07-27. */

/* ─── Right: Rail ─── */
.nrma-lib-rail {
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 18px 16px;
  /* Solid-feeling card so the rail reads as a distinct panel, not as
     floating chips/citations layered over the prose. Theme-adaptive. */
  background: var(--alp-bg);
  border: 1px solid var(--alp-border);
  border-radius: 12px;
  font-size: var(--guide-fs-sm);
  box-shadow: var(--alp-shadow);
}
.nrma-lib-rail-title {
  font-size: var(--guide-fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: var(--guide-label-case, uppercase);
  color: var(--alp-text-muted);
  margin: 0 0 10px;
}
.nrma-lib-rail-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nrma-lib-tool-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--guide-color-action) 45%, transparent);
  border-radius: var(--guide-radius-pill);
  color: var(--guide-color-action);
  font-size: var(--guide-fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--guide-dur-fast) ease;
}
.nrma-lib-tool-chip:hover { background: color-mix(in srgb, var(--guide-color-action) 8%, transparent); }
.nrma-lib-tool-chip:focus-visible { outline: 2px solid var(--guide-color-action); outline-offset: 2px; }

.nrma-lib-rail-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 18px;
}
.nrma-lib-rail-btn {
  display: block;
  text-align: center;
  padding: 8px 12px;
  font-size: var(--guide-fs-sm);
  font-weight: 600;
  text-decoration: none;
  color: var(--guide-color-action);
  background: transparent;
  border: 1px solid var(--guide-color-action);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--guide-dur-fast) ease;
}
.nrma-lib-rail-btn:hover { background: color-mix(in srgb, var(--guide-color-action) 8%, transparent); }
.nrma-lib-rail-btn:focus-visible { outline: 2px solid var(--guide-color-action); outline-offset: 2px; }
/* The primary was lake at 85% with text-primary on it (dark ink on lake). */
.nrma-lib-rail-btn--primary {
  background: var(--guide-color-action);
  color: var(--guide-color-on-action);
}
.nrma-lib-rail-btn--primary:hover { background: var(--guide-color-action-hover); border-color: var(--guide-color-action-hover); }
/* Bill and rule buttons were dark glass and brown fills left from the dark
   backdrop. They are ordinary secondary buttons that keep their document's
   typeface as the only hint of where they go. */
.nrma-lib-rail-btn--bill { font-family: "Times New Roman", serif; }
.nrma-lib-rail-btn--arm { font-family: "Georgia", serif; }

.nrma-lib-rail-search-label {
  display: block;
  font-size: var(--guide-fs-xs);
  color: var(--alp-text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.nrma-lib-rail-search-input {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  background: var(--alp-input-bg);
  border: 1px solid var(--alp-btn-border);
  border-radius: 6px;
  color: var(--alp-input-text);
}
.nrma-lib-rail-search-input::placeholder {
  color: var(--alp-input-ph);
}
.nrma-lib-rail-search-results {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}
.nrma-lib-rail-search-result {
  display: block;
  padding: 8px 10px;
  background: var(--alp-result-bg);
  border: 1px solid var(--alp-result-border);
  border-radius: 6px;
  color: var(--alp-result-text);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.4;
  transition: background 120ms ease;
}
.nrma-lib-rail-search-result:hover { background: var(--alp-btn-hover-bg); }
.nrma-lib-rail-search-result mark {
  background: var(--guide-color-ochre-fill);
  color: var(--guide-color-ink);
  border-radius: 2px;
  padding: 0 2px;
}
.nrma-lib-rail-search-result .nrma-lib-rail-search-fw {
  display: inline-block;
  background: transparent;
  color: var(--guide-color-ink);
  border: 1px solid var(--guide-color-line-strong);
  font-weight: 700;
  padding: 0 5px;
  border-radius: 3px;
  font-size: var(--guide-fs-2xs);
  letter-spacing: 0.04em;
  margin-right: 6px;
}

.nrma-lib-rail-stats {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--alp-divider);
}
.nrma-lib-rail-stat {
  flex: 1 1 0;
  text-align: center;
}
.nrma-lib-rail-stat-num {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--alp-text-strong);
}
.nrma-lib-rail-stat-label {
  display: block;
  font-size: var(--guide-fs-2xs);
  color: var(--alp-text-muted);
  margin-top: 2px;
}

/* ─── Library CTA banner on the launchpad page (above tile grid) ───
 * The same flat raised sheet as the chapter cards above it; hover and focus
 * are a lake edge, never a lift. */
.nrma-libindex-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1180px;
  width: 100%;
  margin: 0 auto 22px;
  padding: 16px 22px;
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line);
  border-radius: 12px;
  color: var(--guide-color-ink);
  text-decoration: none;
  box-shadow: var(--guide-shadow-rest);
  transition: border-color var(--guide-dur-fast) ease;
}
.nrma-libindex-cta:hover { border-color: var(--guide-color-action); }
.nrma-libindex-cta:focus-visible { outline: 2px solid var(--guide-color-action); outline-offset: 2px; }
.nrma-libindex-cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--guide-color-ink);
  flex-shrink: 0;
}
.nrma-libindex-cta-icon i,
.nrma-libindex-cta-icon svg {
  width: 24px;
  height: 24px;
  color: var(--guide-color-ink);
  stroke: currentColor;
  stroke-width: 1.75;
}
.nrma-libindex-cta-body { flex: 1 1 auto; min-width: 0; }
.nrma-libindex-cta-title {
  display: block;
  font-family: var(--guide-font-display);
  font-size: var(--guide-fs-lg);
  font-weight: 600;
  color: var(--guide-color-ink);
  line-height: 1.25;
}
.nrma-libindex-cta-sub {
  display: block;
  font-size: var(--guide-fs-xs);
  color: var(--guide-color-ink-soft);
  margin-top: 4px;
  line-height: 1.4;
}

/* Hero variant — the headline CTA at the top of the Remix overview
   (added 2026-05-20). Larger type and padding make it the page's primary
   call to action; the sheet itself is the same flat one. */
.nrma-libindex-cta--hero {
  padding: 28px 32px;
  margin-top: 8px;
  margin-bottom: 28px;
  gap: 24px;
  align-items: stretch;
}
.nrma-libindex-cta--hero .nrma-libindex-cta-icon {
  width: 56px;
  height: 56px;
  color: var(--guide-color-action);
  align-self: center;
}
.nrma-libindex-cta--hero .nrma-libindex-cta-icon i,
.nrma-libindex-cta--hero .nrma-libindex-cta-icon svg {
  width: 32px;
  height: 32px;
  color: var(--guide-color-action);
  stroke-width: 1.75;
}
/* An 11px kicker — uppercase may stay here. */
.nrma-libindex-cta-eyebrow {
  display: inline-block;
  font-size: var(--guide-fs-2xs);
  letter-spacing: var(--guide-letter-eyebrow);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  color: var(--guide-color-ink-soft);
  margin-bottom: 6px;
}
.nrma-libindex-cta--hero .nrma-libindex-cta-title {
  font-size: var(--guide-fs-2xl);
  font-weight: 600;
  color: var(--guide-color-ink);
  line-height: 1.25;
}
.nrma-libindex-cta--hero .nrma-libindex-cta-sub {
  font-size: var(--guide-fs-md);
  color: var(--guide-color-ink-soft);
  margin-top: 8px;
  line-height: 1.5;
  max-width: 65ch;
}
.nrma-libindex-cta--hero .nrma-libindex-cta-arrow {
  align-self: center;
  width: 44px;
  height: 44px;
  background: var(--guide-color-action);
  color: var(--guide-color-on-action);
  border-radius: 50%;
  transition: transform var(--guide-dur-fast) ease, background var(--guide-dur-fast) ease;
}
.nrma-libindex-cta--hero:hover .nrma-libindex-cta-arrow {
  background: var(--guide-color-action-hover);
  transform: translateX(4px);
}
.nrma-libindex-cta--hero .nrma-libindex-cta-arrow i,
.nrma-libindex-cta--hero .nrma-libindex-cta-arrow svg {
  width: 20px;
  height: 20px;
  color: var(--guide-color-on-action);
}
@media (max-width: 720px) {
  .nrma-libindex-cta--hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 14px;
  }
  .nrma-libindex-cta--hero .nrma-libindex-cta-arrow {
    align-self: flex-end;
  }
  .nrma-libindex-cta--hero .nrma-libindex-cta-title { font-size: var(--guide-fs-xl); }
  .nrma-libindex-cta--hero .nrma-libindex-cta-sub { font-size: var(--guide-fs-sm); }
}
.nrma-libindex-cta-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--guide-color-ink);
  flex-shrink: 0;
  transition: transform 160ms ease;
}
.nrma-libindex-cta-arrow i,
.nrma-libindex-cta-arrow svg {
  width: 20px;
  height: 20px;
  color: var(--guide-color-ink);
  stroke: currentColor;
  stroke-width: 1.75;
}
.nrma-libindex-cta:hover .nrma-libindex-cta-arrow { transform: translateX(3px); }

/* ─── Library index page (21-card grid) ─── */
.nrma-libindex-root {
  width: 100%;
  align-self: stretch;
  text-align: left;
}
.nrma-libindex {
  width: 100%;
  /* Match the reader: use the room on laptop+ screens, capped at 1720px. */
  max-width: min(96vw, 1720px);
  margin: 0 auto;
  padding: 0 20px 60px;
  /* The nrma-hero backdrop is cream (--bg-1 → --bg-0), so
     use dark text + cream surfaces here, matching the reader (nrma-lib-*). */
  color: var(--guide-color-ink);
  /* Don't shrink-to-content inside flexbox parent. */
  align-self: stretch;
}
/* Reset card text alignment so card content (FW chip + title + subtitle) is
   left-aligned, but the hero block stays center via its own rule. */
.nrma-libindex-card { text-align: left; }
.nrma-libindex-card-title,
.nrma-libindex-card-subtitle,
.nrma-libindex-card-stats { text-align: left; }
.nrma-libindex-hero {
  text-align: center;
  margin-bottom: 24px;
}
.nrma-libindex-hero h1 {
  font-family: var(--guide-font-display);
  font-size: var(--guide-fs-3xl);
  margin: 6px 0 4px;
  font-weight: 600;
}
.nrma-libindex-hero p {
  color: var(--guide-color-ink-soft);
  font-size: var(--guide-fs-base);
  margin: 0 auto 14px;
  max-width: 70ch;
}
.nrma-libindex-totals {
  display: inline-flex;
  gap: 24px;
  padding: 8px 18px;
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line);
  border-radius: var(--guide-radius-pill);
  font-size: var(--guide-fs-sm);
  color: var(--guide-color-ink-soft);
}
.nrma-libindex-totals strong { color: var(--guide-color-ink); font-size: var(--guide-fs-base); }

.nrma-libindex-search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 18px 0 22px;
  padding: 10px 14px;
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line);
  border-radius: 12px;
  box-shadow: var(--guide-shadow-rest);
}
.nrma-libindex-search-bar input[type="search"] {
  flex: 1 1 auto;
  padding: 10px 12px;
  font-size: var(--guide-fs-base);
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line-strong);
  border-radius: 8px;
  color: var(--guide-color-ink);
}
.nrma-libindex-search-bar input[type="search"]::placeholder { color: var(--guide-color-ink-soft); }
.nrma-libindex-search-bar input[type="search"]:focus-visible { outline: 2px solid var(--guide-color-action); outline-offset: 1px; }
.nrma-libindex-resume {
  background: var(--guide-color-action);
  border: 1px solid var(--guide-color-action);
  color: var(--guide-color-on-action);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: var(--guide-fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.nrma-libindex-resume:hover { background: var(--guide-color-action-hover); }
.nrma-libindex-resume--ghost {
  background: transparent;
  border-color: var(--guide-color-action);
  color: var(--guide-color-action);
}

.nrma-libindex-results {
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Citation-integrity dashboard */
.nrma-libindex-integrity {
  margin: 0 0 24px;
  padding: 18px 22px 20px;
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line);
  border-radius: 12px;
  color: var(--guide-color-ink);
  box-shadow: var(--guide-shadow-rest);
}
.nrma-libindex-integrity-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.nrma-libindex-integrity-icon { font-size: 18px; }
.nrma-libindex-integrity-title {
  font-family: var(--guide-font-display);
  font-size: var(--guide-fs-lg);
  font-weight: 600;
  margin: 0;
  color: var(--guide-color-ink);
}
.nrma-libindex-integrity-sub {
  font-size: var(--guide-fs-xs);
  color: var(--guide-color-ink-soft);
}

/* Progress bar — stacked segments showing verified / incorrect / remove */
.nrma-libindex-integrity-bar {
  display: flex;
  width: 100%;
  height: 8px;
  background: var(--guide-color-paper-2);
  border-radius: var(--guide-radius-pill);
  overflow: hidden;
  margin-bottom: 18px;
}
.nrma-libindex-integrity-bar-fill {
  height: 100%;
  transition: width 280ms ease;
}
/* Verified / incorrect / remove is a graded citation state: moss / brick / ochre. */
.nrma-libindex-integrity-bar-fill--verified { background: var(--guide-color-status-ok); }
.nrma-libindex-integrity-bar-fill--incorrect { background: var(--guide-color-status-crit); }
.nrma-libindex-integrity-bar-fill--remove { background: var(--guide-color-status-watch); }

/* Per-status stat cells */
.nrma-libindex-integrity-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.nrma-libindex-integrity-stat {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  background: var(--guide-color-paper-2);
  /* The cell's citation state is its figure's colour and its caption ("verified",
     "need review", "flagged incorrect") — never a coloured edge. The two cells
     that are not a state (remove, grounding) keep the neutral ink. */
  border: 1px solid var(--guide-color-line);
  border-radius: 4px;
}
.nrma-libindex-integrity-stat strong {
  font-size: var(--guide-fs-2xl);
  font-weight: 700;
  color: var(--guide-color-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 3px;
}
.nrma-libindex-integrity-stat span {
  font-size: var(--guide-fs-2xs);
  color: var(--guide-color-ink-soft);
}
.nrma-libindex-integrity-stat--verified strong { color: var(--guide-color-status-ok); }
.nrma-libindex-integrity-stat--unverified strong { color: var(--guide-color-status-watch); }
.nrma-libindex-integrity-stat--incorrect strong { color: var(--guide-color-status-crit); }

.nrma-libindex-integrity-help {
  margin: 12px 0 0;
  font-size: var(--guide-fs-xs);
  line-height: 1.55;
  color: var(--guide-color-ink-soft);
  max-width: 75ch;
}
.nrma-libindex-integrity-help code {
  font-family: var(--guide-font-mono);
  background: var(--guide-color-paper-2);
  border: 1px solid var(--guide-color-line);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: var(--guide-fs-2xs);
  color: var(--guide-color-ink);
}

/* Per-card integrity badge */
.nrma-libindex-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.nrma-libindex-card-integrity {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  border-radius: var(--guide-radius-pill);
  border: 1px solid;
  background: transparent;
}
/* Draft → partially verified → verified is a graded ladder. Partial was
   lake, the interaction colour; it is the neutral rung between the two
   states that carry a hue. */
.nrma-libindex-card-integrity--draft {
  border-color: var(--guide-color-status-watch);
  color: var(--guide-color-status-watch);
}
.nrma-libindex-card-integrity--partial {
  border-color: var(--guide-color-line-strong);
  color: var(--guide-color-ink-soft);
}
.nrma-libindex-card-integrity--verified {
  border-color: var(--guide-color-status-ok);
  color: var(--guide-color-status-ok);
}
.nrma-libindex-card-grounding {
  display: inline-flex;
  align-items: center;
  font-size: var(--guide-fs-2xs);
  font-weight: 600;
  color: var(--guide-color-ink-soft);
}

.nrma-libindex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.nrma-libindex-card {
  display: flex;
  flex-direction: column;
  padding: 16px 16px 14px;
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--guide-dur-fast) ease;
  cursor: pointer;
  box-shadow: var(--guide-shadow-rest);
}
.nrma-libindex-card:hover { border-color: var(--guide-color-action); }
.nrma-libindex-card:focus-visible { outline: 2px solid var(--guide-color-action); outline-offset: 2px; }
/* The chapter id chip ("FW-05"). */
.nrma-libindex-card-fw {
  display: inline-block;
  font-family: var(--guide-font-mono);
  font-weight: 700;
  background: transparent;
  color: var(--guide-color-ink);
  border: 1px solid var(--guide-color-line-strong);
  font-size: var(--guide-fs-2xs);
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 4px;
  margin-bottom: 8px;
  align-self: flex-start;
}
.nrma-libindex-card-title {
  font-family: var(--guide-font-display);
  font-size: var(--guide-fs-lg);
  font-weight: 600;
  line-height: 1.30;
  margin: 0 0 4px;
  color: var(--guide-color-ink);
}
.nrma-libindex-card-subtitle {
  font-size: var(--guide-fs-sm);
  color: var(--guide-color-ink-soft);
  font-style: italic;
  margin: 0 0 10px;
  line-height: 1.4;
}
.nrma-libindex-card-stats {
  margin-top: auto;
  font-size: var(--guide-fs-2xs);
  color: var(--guide-color-ink-soft);
  display: flex;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * PER-SECTION TEMPLATES
 * Every H1 section is classified by `sectionType` in the JSON bundle and
 * tagged with `nrma-lib-section--<type>` by the reader. Each block below
 * shapes that section's visual identity. Bill sections look like bills,
 * ARM sections look like proposed rules, References look bibliographic, etc.
 * ─────────────────────────────────────────────────────────────────────── */

/* All section types: subtle uniform "What you're reading" badge above title */
.nrma-lib-section::before {
  content: attr(data-nrma-section-type);
  display: inline-block;
  padding: 3px 10px;
  margin: 0 0 14px;
  font-family: var(--guide-font-sans);
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  letter-spacing: var(--guide-letter-eyebrow);
  text-transform: var(--guide-label-case, uppercase);
  color: var(--guide-color-ink-soft);
  background: transparent;
  border: 1px solid var(--guide-color-line-strong);
  border-radius: var(--guide-radius-pill);
}
.nrma-lib-section--editorial::before          { content: "Editorial"; }
.nrma-lib-section--academic-data::before      { content: "Analysis"; }
/* A section kind is a TAXONOMY, not a status, so every badge is the same
   neutral kicker and says its kind in words. They were lake, moss, ochre and
   brick — "Inter-Framework Relationships" in the critical hue. */
.nrma-lib-section--bill::before               { content: "Proposed bill — draft for legislative review"; }
.nrma-lib-section--arm::before                { content: "Administrative Rules of Montana — proposed rule"; }
.nrma-lib-section--tech-spec::before          { content: "Technology & AI specification"; }
.nrma-lib-section--academic-citations::before { content: "Scientific foundation"; }
.nrma-lib-section--magazine::before           { content: "Stakeholder engagement"; }
.nrma-lib-section--relational::before         { content: "Inter-framework relationships"; }
.nrma-lib-section--bibliography::before       { content: "References"; }

/* ─── BILL template — looks like a Montana legislative bill draft ─── */
.nrma-lib-section--bill {
  font-family: "Times New Roman", "Times", "Liberation Serif", serif;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--guide-color-ink);
  /* Soft cream paper with subtle vertical rule on the left for the line-
     number gutter feel. */
  background: #fdfaf0;
  border: 1px solid #e2d9c0;
  border-radius: 4px;
  padding: 28px 30px 32px 36px;
  margin: 40px -6px;
}
.nrma-lib-section--bill .nrma-lib-section-title {
  font-family: "Times New Roman", "Times", serif;
  font-size: 22px;
  text-align: center;
  letter-spacing: 0.04em;
  text-transform: var(--guide-label-case, uppercase);
  border-top: 3px double var(--guide-color-text-primary, #1a1a1f);
  border-bottom: 1px solid var(--guide-color-text-primary, #1a1a1f);
  padding: 12px 0 8px;
  margin: 0 0 18px;
  font-weight: 700;
}
.nrma-lib-section--bill .nrma-lib-section-title .nrma-lib-section-titletext {
  text-align: center;
}
.nrma-lib-section--bill .nrma-heading--2 {
  font-family: "Times New Roman", serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.05em;
  text-align: center;
  margin: 28px 0 12px;
  border-top: 1px solid #c5bda2;
  padding-top: 12px;
}
.nrma-lib-section--bill .nrma-heading--3 {
  font-family: "Times New Roman", serif;
  font-size: 14.5px;
  font-weight: 700;
  margin: 20px 0 8px;
  font-variant: small-caps;
  letter-spacing: 0.03em;
}
.nrma-lib-section--bill p {
  text-align: justify;
  text-indent: 0;
  margin: 0 0 12px;
  /* Hanging-indent feel: section numbers/citations get their own visual line */
}
/* "Sec. N." numbering — make any paragraph starting with "Section N." or
   "Sec. N." stand out. */
.nrma-lib-section--bill p strong:first-child {
  display: inline-block;
  min-width: 5em;
}
.nrma-lib-section--bill ul.nrma-list {
  padding-left: 36px;
  margin: 8px 0 14px;
}
.nrma-lib-section--bill ul.nrma-list li {
  margin-bottom: 6px;
  text-align: justify;
}
.nrma-lib-section--bill .nrma-table {
  font-family: "Times New Roman", serif;
  font-size: 13.5px;
}
/* A ruled header, as printed bills set it. It was an ink fill with white
   text, which inverted to white on near-white in dark theme. */
.nrma-lib-section--bill .nrma-table thead th {
  background: transparent;
  color: inherit;
  border-bottom: 2px solid currentColor;
  font-family: "Times New Roman", serif;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  font-size: 12px;
}

/* ─── ARM template — looks like a Montana proposed rule notice ─── */
.nrma-lib-section--arm {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--guide-color-ink);
  background: #f9f5ea;
  border: 1px solid #d2c69b;
  border-radius: 4px;
  padding: 26px 30px 28px;
  margin: 40px -6px;
}
.nrma-lib-section--arm .nrma-lib-section-title {
  font-family: "Georgia", serif;
  font-size: 21px;
  font-weight: 700;
  text-align: left;
  border-bottom: 2px solid #5d4e2f;
  padding: 0 0 10px;
  margin: 0 0 18px;
}
.nrma-lib-section--arm .nrma-heading--2 {
  font-family: "Georgia", serif;
  font-size: 15.5px;
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.04em;
  margin: 22px 0 10px;
  color: #3a2f1a;
}
.nrma-lib-section--arm .nrma-heading--3 {
  font-family: "Georgia", serif;
  font-size: 14.5px;
  font-weight: 700;
  font-style: italic;
  color: #3a2f1a;
  margin: 16px 0 8px;
}
/* Rule numbers like "ARM 36.12.301" get a soft pill */
.nrma-lib-section--arm p strong:first-child,
.nrma-lib-section--arm .nrma-heading--2 strong:first-child,
.nrma-lib-section--arm .nrma-heading--3 strong:first-child {
  font-family: var(--guide-font-mono);
  background: #ede5cc;
  border: 1px solid #d2c69b;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.92em;
  font-weight: 700;
}
.nrma-lib-section--arm p { margin: 0 0 12px; }
.nrma-lib-section--arm em { color: #5b4a1f; }
.nrma-lib-section--arm ul.nrma-list { padding-left: 28px; }
.nrma-lib-section--arm ul.nrma-list li { margin-bottom: 6px; }

/* ─── EDITORIAL template — Executive Summary etc. ─── */
.nrma-lib-section--editorial .nrma-lib-section-title {
  font-size: 34px;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--guide-color-ink);
  border-top: none;
  padding-top: 0;
  margin-bottom: 32px;
}
/* Drop cap — targets the first <p> in the section body, which may follow
   an H2 like "The Records Crisis". Refined sizing so the cap aligns to
   the body baseline cleanly (3 lines tall, top-aligned to cap height). */
.nrma-lib-section--editorial .nrma-lib-section-body > p:first-of-type::first-letter,
.nrma-lib-section--editorial .nrma-heading--2 + p::first-letter,
.nrma-lib-section--editorial .nrma-heading--2:first-of-type ~ p:first-of-type::first-letter {
  font-family: "Source Serif Pro", "Charter", "Iowan Old Style", Georgia, serif;
  font-size: 56px;
  font-weight: 800;
  float: left;
  line-height: 0.86;
  /* Pull the cap up so its cap-height aligns with the first body line's
     x-height baseline. Right margin gives the first lines breathing room. */
  margin: 0.08em 0.10em 0 0;
  padding: 0 4px 0 0;
  color: var(--guide-color-ink);
  /* Slightly tighter letter — Source Serif's cap is wide */
  letter-spacing: -0.02em;
}
/* Lead paragraph subtle treatment — first paragraph after a heading inside
   the editorial section reads a touch larger with cleaner leading. */
.nrma-lib-section--editorial .nrma-lib-section-body > p:first-of-type,
.nrma-lib-section--editorial .nrma-heading--2:first-of-type + p {
  font-size: 18px;
  line-height: 1.62;
  color: var(--guide-color-ink);
  letter-spacing: 0;
}
/* H2 subheads inside editorial — slightly more breathing room above */
.nrma-lib-section--editorial .nrma-lib-section-body .nrma-heading--2 {
  font-size: 22px;
  margin: 40px 0 14px;
  font-weight: 600;
  color: var(--guide-color-ink);
}
/* First H2 in editorial sits right under the section title — kill the
   top margin so "The Records Crisis" sits at the right rhythm. */
.nrma-lib-section--editorial .nrma-lib-section-body > .nrma-heading--2:first-child {
  margin-top: 0;
}

/* ─── ACADEMIC-DATA template — comprehensive analysis ─── */
.nrma-lib-section--academic-data {
  font-size: 16px;
  line-height: 1.68;
}
.nrma-lib-section--academic-data .nrma-heading--2 {
  color: var(--guide-color-ink);
  font-weight: 600;
  font-size: 22px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--guide-color-line);
}
/* Analysis tables use the shared header. They had a lake-filled header with
   lake zebra rows: the interaction colour painted over data. */

/* ─── TECH-SPEC template ─── */
.nrma-lib-section--tech-spec {
  font-family: "Source Serif Pro", "Charter", "Iowan Old Style", Georgia, serif;
  font-size: 16px;
  line-height: 1.65;
}
/* Headings in every kind of section are ink: a heading is not a link, and the
   kind is named by the badge above it. */
.nrma-lib-section--tech-spec .nrma-heading--3 {
  font-family: var(--guide-font-mono);
  font-size: var(--guide-fs-base);
  font-weight: 700;
}
/* Inline code-like tokens (file paths, identifiers) — wrap any **bold** that
   contains a `.js`, `.py`, or path segment in a code feel. We approximate
   via small-caps + tighter letter-spacing since the converter doesn't tag
   identifiers specifically. */
.nrma-lib-section--tech-spec strong {
  font-family: var(--guide-font-mono);
  font-size: 0.92em;
  background: var(--guide-color-paper-2);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--guide-color-ink);
}

/* ─── ACADEMIC-CITATIONS template (Scientific Foundation) ─── */
.nrma-lib-section--academic-citations {
  font-family: "Source Serif Pro", "Charter", Georgia, serif;
  font-size: 16px;
  line-height: 1.70;
}
/* Italic in this section is usually a journal title — soften it. */
.nrma-lib-section--academic-citations em {
  color: var(--guide-color-ink-soft);
  font-style: italic;
}

/* ─── MAGAZINE template (Stakeholder Engagement) ─── */
.nrma-lib-section--magazine {
  font-family: "Source Serif Pro", "Charter", Georgia, serif;
  font-size: 17.5px;
  line-height: 1.75;
  letter-spacing: 0.003em;
}
.nrma-lib-section--magazine .nrma-heading--2 {
  font-size: var(--guide-fs-2xl);
  font-weight: 600;
}

/* ─── RELATIONAL template (Inter-Framework Relationships) ─── */
/* Chapter links here read as a row of pills — still links, so lake. They were
   brick, the critical hue, on every link to a related chapter. */
.nrma-lib-section--relational .nrma-fw-link {
  display: inline-block;
  padding: 2px 8px;
  margin: 0 2px;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--guide-color-action) 40%, transparent);
  border-radius: var(--guide-radius-pill);
  color: var(--guide-color-action);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92em;
}
.nrma-lib-section--relational .nrma-fw-link:hover {
  background: color-mix(in srgb, var(--guide-color-action) 8%, transparent);
  border-color: var(--guide-color-action);
}

/* ─── BIBLIOGRAPHY template (References) ─── */
.nrma-lib-section--bibliography {
  font-family: "Source Serif Pro", "Charter", Georgia, serif;
  font-size: 14px;
  line-height: 1.50;
  color: var(--guide-color-text-secondary);
}
.nrma-lib-section--bibliography .nrma-lib-section-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--guide-color-ink);
  border-bottom: 1px solid var(--guide-color-line-strong);
  padding-bottom: 8px;
  margin-bottom: 18px;
}
.nrma-lib-section--bibliography .nrma-heading--2 {
  font-size: var(--guide-fs-base);
  font-weight: 600;
  color: var(--guide-color-ink-soft);
  margin: 18px 0 8px;
}
/* References: hanging indent + tight leading */
.nrma-lib-section--bibliography p {
  padding-left: 2em;
  text-indent: -2em;
  margin: 0 0 8px;
}
.nrma-lib-section--bibliography em {
  color: var(--guide-color-text-secondary);
  font-style: italic;
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * CITATION-INTEGRITY CLAIM STATES
 * Every detected factual claim (statistic, year-study, named cite, etc.)
 * is wrapped in <mark class="nrma-claim nrma-claim--<status>"> by the
 * build pipeline. Four statuses surface visually:
 *
 *   unverified  — ochre underline + ⚠ marker. The default.
 *   verified    — clean text + small ✓ + hover tooltip with the citation.
 *   incorrect   — red strikethrough + replacement-pending icon.
 *   remove      — replaced inline with "[claim removed pending source]".
 * ─────────────────────────────────────────────────────────────────────── */
.nrma-lib-prose .nrma-claim {
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  border-radius: 2px;
  transition: background var(--guide-dur-fast) ease;
  position: relative;
}

/* UNVERIFIED — a flat ochre underline + ⚠ marker before the sentence. It was
   a two-stop "highlighter" stripe. */
.nrma-lib-prose .nrma-claim--unverified {
  text-decoration: underline;
  text-decoration-color: var(--guide-color-ochre-fill);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.nrma-lib-prose .nrma-claim--unverified::before {
  content: "⚠";
  display: inline-block;
  margin-right: 4px;
  font-size: 0.78em;
  color: var(--guide-color-ochre);
  background: color-mix(in srgb, var(--guide-color-ochre-fill) 30%, transparent);
  border: 1px solid color-mix(in srgb, var(--guide-color-ochre-fill) 70%, transparent);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 1.4;
  vertical-align: 0.08em;
  font-family: var(--guide-font-sans);
  font-weight: 700;
  cursor: help;
}
.nrma-lib-prose .nrma-claim--unverified:hover {
  background: color-mix(in srgb, var(--guide-color-ochre-fill) 18%, transparent);
}

/* VERIFIED — clean reading state + small ✓ + hover tooltip */
.nrma-lib-prose .nrma-claim--verified {
  background: transparent;
}
.nrma-lib-prose .nrma-claim--verified::after {
  content: "✓";
  display: inline-block;
  margin-left: 3px;
  font-size: 0.72em;
  color: var(--guide-color-moss);
  background: color-mix(in srgb, var(--guide-color-moss) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--guide-color-moss) 45%, transparent);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 1.4;
  vertical-align: 0.08em;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-weight: 700;
}
.nrma-lib-prose .nrma-claim--verified:hover {
  background: color-mix(in srgb, var(--guide-color-moss) 8%, transparent);
}

/* INCORRECT — red strikethrough + flag marker */
.nrma-lib-prose .nrma-claim--incorrect {
  background: transparent;
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--guide-color-brick) 55%, transparent);
  text-decoration-thickness: 1.5px;
  color: var(--guide-color-brick);
}
.nrma-lib-prose .nrma-claim--incorrect::before {
  content: "⚑";
  display: inline-block;
  margin-right: 4px;
  font-size: 0.85em;
  color: var(--guide-color-text-on-accent, #fff);
  background: var(--guide-color-brick);
  border-radius: 3px;
  padding: 0 5px;
  line-height: 1.3;
  font-family: ui-sans-serif, system-ui, sans-serif;
  text-decoration: none;
}

/* REMOVE — hide the inline text and replace with a placeholder */
.nrma-lib-prose .nrma-claim--remove {
  display: inline-block;
  position: relative;
  color: transparent;
  background: var(--guide-color-paper-2);
  border: 1px dashed var(--guide-color-line-strong);
  border-radius: 4px;
  padding: 1px 8px;
  font-style: italic;
  text-decoration: none;
  user-select: none;
  cursor: help;
}
.nrma-lib-prose .nrma-claim--remove::before {
  content: "[claim removed pending source]";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--guide-color-ink-soft);
  font-size: 0.92em;
  font-style: italic;
  background: var(--guide-color-paper-2);
  padding: 1px 8px;
  white-space: nowrap;
  pointer-events: none;
}

/* Selection styling — claims selected for "more info" panel */
.nrma-lib-prose .nrma-claim.is-selected {
  outline: 2px solid var(--guide-color-action);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Print rules — hide markers in PDF output */
@media print {
  .nrma-lib-prose .nrma-claim--unverified::before,
  .nrma-lib-prose .nrma-claim--verified::after,
  .nrma-lib-prose .nrma-claim--incorrect::before { display: none !important; }
  .nrma-lib-prose .nrma-claim--unverified { background: transparent !important; }
  .nrma-lib-prose .nrma-claim--incorrect { text-decoration: none !important; color: inherit !important; }
  .nrma-lib-prose .nrma-claim--remove { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
 * FURTHER READING (right rail) — authoritative grounding sources per chapter
 * Pulled from /data/nrma/grounding-sources.json (built by the research agent).
 * ─────────────────────────────────────────────────────────────────────── */
.nrma-lib-rail-further-reading {
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--alp-divider);
}
.nrma-lib-rail-readlist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nrma-lib-rail-readlist-item {
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.45;
}
.nrma-lib-rail-readlist-kind {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 6px;
  background: var(--alp-chip-mute-bg);
  border: 1px solid var(--alp-chip-mute-border);
  border-radius: 3px;
  font-size: var(--guide-fs-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: var(--guide-label-case, uppercase);
  color: var(--alp-chip-mute-text);
  vertical-align: 1px;
}
.nrma-lib-rail-readlist-kind--statute,
.nrma-lib-rail-readlist-kind--case {
  background: color-mix(in srgb, var(--alp-kind-law) 14%, transparent);
  border-color: color-mix(in srgb, var(--alp-kind-law) 36%, transparent);
  color: var(--alp-kind-law);
}
.nrma-lib-rail-readlist-kind--peer-reviewed,
.nrma-lib-rail-readlist-kind--report {
  background: color-mix(in srgb, var(--alp-kind-research) 14%, transparent);
  border-color: color-mix(in srgb, var(--alp-kind-research) 36%, transparent);
  color: var(--alp-kind-research);
}
.nrma-lib-rail-readlist-kind--textbook,
.nrma-lib-rail-readlist-kind--agency-policy {
  background: color-mix(in srgb, var(--alp-kind-practice) 14%, transparent);
  border-color: color-mix(in srgb, var(--alp-kind-practice) 36%, transparent);
  color: var(--alp-kind-practice);
}
.nrma-lib-rail-readlist-link {
  display: block;
  color: var(--alp-text-strong);
  text-decoration: none;
  margin-top: 2px;
  font-weight: 500;
}
.nrma-lib-rail-readlist-link:hover { text-decoration: underline; color: var(--alp-active-text); }
.nrma-lib-rail-readlist-why {
  display: block;
  margin-top: 3px;
  font-size: var(--guide-fs-xs);
  color: var(--alp-text-muted);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * CITATION-INTEGRITY BANNER (Phase N4)
 * Chapter-level disclosure: DRAFT / PARTIALLY VERIFIED / VERIFIED.
 * Rendered by library-view.js based on chapter JSON's `claims` summary.
 * ─────────────────────────────────────────────────────────────────────── */
.nrma-claim-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 24px;
  padding: 12px 18px;
  border-radius: 8px;
  font-family: var(--guide-font-sans);
  font-size: var(--guide-fs-sm);
  line-height: 1.45;
  border: 1px solid transparent;
}
.nrma-claim-banner-icon { font-size: 18px; flex: 0 0 auto; }
.nrma-claim-banner-text { flex: 1 1 auto; }
.nrma-claim-banner-title {
  font-weight: 700;
  font-size: var(--guide-fs-sm);
  display: block;
  margin-bottom: 2px;
}
.nrma-claim-banner-detail { font-weight: 400; }
/* Draft / partially verified / verified is a graded state. The body text is
   ink so the detail stays readable; the title and edge carry the hue. Partial
   was lake, the interaction colour; it is the neutral rung. */
.nrma-claim-banner--draft {
  background: color-mix(in srgb, var(--guide-color-status-watch) 6%, var(--guide-color-raised));
  border-color: var(--guide-color-status-watch);
  color: var(--guide-color-ink);
}
.nrma-claim-banner--draft .nrma-claim-banner-title { color: var(--guide-color-status-watch); }
.nrma-claim-banner--partial {
  background: var(--guide-color-raised);
  border-color: var(--guide-color-line-strong);
  color: var(--guide-color-ink);
}
.nrma-claim-banner--partial .nrma-claim-banner-title { color: var(--guide-color-ink-soft); }
.nrma-claim-banner--verified {
  background: color-mix(in srgb, var(--guide-color-status-ok) 6%, var(--guide-color-raised));
  border-color: var(--guide-color-status-ok);
  color: var(--guide-color-ink);
}
.nrma-claim-banner--verified .nrma-claim-banner-title { color: var(--guide-color-status-ok); }
.nrma-claim-banner--zero {
  background: var(--guide-color-paper-2);
  border-color: var(--guide-color-line);
  color: var(--guide-color-ink-soft);
}

@media print {
  .nrma-claim-banner { display: none !important; }
}

/* ─── Linear ("Read in order") nav bar — top + bottom of prose ─── */
.nrma-lib-linear-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  margin: 0 0 22px;
  background: var(--guide-color-paper-2);
  border: 1px solid var(--guide-color-line);
  border-radius: 8px;
  font-family: var(--guide-font-sans);
  font-size: var(--guide-fs-sm);
}
.nrma-lib-linear-nav--bottom { margin: 36px 0 0; }
.nrma-lib-linear-btn {
  flex: 0 0 auto;
  padding: 6px 14px;
  background: var(--guide-color-action);
  color: var(--guide-color-on-action);
  border: 1px solid var(--guide-color-action);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background var(--guide-dur-fast) ease;
}
.nrma-lib-linear-btn:hover { background: var(--guide-color-action-hover); border-color: var(--guide-color-action-hover); }
.nrma-lib-linear-btn:focus-visible { outline: 2px solid var(--guide-color-action); outline-offset: 2px; }
.nrma-lib-linear-btn.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}
/* Export PDF button — distinct accent so it reads as the primary action
   for getting the chapter out of the app. */
.nrma-lib-linear-btn--export {
  border: 1px solid var(--guide-color-action);
  background: var(--guide-color-raised);
  color: var(--guide-color-action);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}
.nrma-lib-linear-btn--export:hover { background: color-mix(in srgb, var(--guide-color-action) 8%, var(--guide-color-raised)); color: var(--guide-color-action); }
.nrma-lib-linear-progress {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nrma-lib-linear-progress-track {
  height: 6px;
  background: var(--guide-color-line);
  border-radius: var(--guide-radius-pill);
  overflow: hidden;
}
.nrma-lib-linear-progress-bar {
  height: 100%;
  background: var(--guide-color-action);
  border-radius: var(--guide-radius-pill);
  transition: width 280ms ease;
}
.nrma-lib-linear-progress-label {
  text-align: center;
  font-size: var(--guide-fs-2xs);
  color: var(--guide-color-ink-soft);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * STANDALONE BILL VIEW (#/nrma/NR-NN/bill)
 * Dedicated chrome that makes a bill draft look like a print-ready document.
 * ─────────────────────────────────────────────────────────────────────── */
.nrma-billview-root {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px 60px;
  align-self: stretch;
  text-align: left;
  color: var(--guide-color-ink);
}
.nrma-billview-loading,
.nrma-billview-error {
  padding: 40px 20px;
  color: var(--guide-color-ink-soft);
  font-size: var(--guide-fs-base);
}
.nrma-billview-error a { color: var(--guide-color-action); }
.nrma-billview-chrome {
  margin: 0 0 16px;
}
.nrma-billview-chrome-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line);
  border-radius: 12px;
}
/* White on white glass, written for the dark backdrop. A secondary button. */
.nrma-billview-back {
  color: var(--guide-color-action);
  text-decoration: none;
  font-size: var(--guide-fs-sm);
  font-weight: 600;
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--guide-color-action);
  border-radius: 6px;
}
.nrma-billview-back:hover { background: color-mix(in srgb, var(--guide-color-action) 8%, transparent); }
.nrma-billview-spacer { flex: 1 1 auto; }
.nrma-billview-print {
  padding: 6px 14px;
  font-weight: 600;
  font-size: var(--guide-fs-sm);
  color: var(--guide-color-on-action);
  background: var(--guide-color-action);
  border: 1px solid var(--guide-color-action);
  border-radius: 6px;
  cursor: pointer;
}
.nrma-billview-print:hover { background: var(--guide-color-action-hover); }

/* The "paper" — wider than the reader prose, formal bill layout */
.nrma-billview-page {
  background: #fffefa;
  color: var(--guide-color-ink);
  border: 1px solid #c5bda2;
  border-radius: 4px;
  padding: 48px 56px 60px;
  box-shadow: var(--guide-shadow-rest);
  font-family: "Times New Roman", "Times", serif;
}
.nrma-billview-cover {
  text-align: center;
  border-bottom: 3px double var(--guide-color-text-primary, #1a1a1f);
  padding-bottom: 24px;
  margin-bottom: 28px;
}
.nrma-billview-stateline {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: var(--guide-label-case, uppercase);
  color: var(--guide-color-ink);
}
.nrma-billview-session {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: var(--guide-label-case, uppercase);
  color: #5d4e2f;
  margin: 4px 0 16px;
}
.nrma-billview-fwid {
  font-size: 13px;
  letter-spacing: 0.05em;
  color: #5d4e2f;
  margin-bottom: 14px;
  font-style: italic;
}
.nrma-billview-title {
  font-size: var(--guide-fs-2xl);
  font-weight: 700;
  text-transform: var(--guide-label-case, uppercase);
  letter-spacing: 0.05em;
  margin: 0 0 12px;
  line-height: 1.25;
  color: var(--guide-color-ink);
  /* A bill title is one or two long uppercase words per line; on a phone
     "RESILIENCE" ran 89 px out of its box. */
  overflow-wrap: anywhere;
}
.nrma-billview-byline {
  font-size: 12.5px;
  color: #5d4e2f;
  margin-bottom: 14px;
  font-style: italic;
}
.nrma-billview-stamp {
  display: inline-block;
  padding: 3px 14px;
  /* The rubber stamp is part of the paper facsimile, so it takes the bill's
     own brown ink like the ARM stamp below. It was the wordmark red. */
  background: #5d4e2f;
  color: var(--guide-color-text-on-accent, #fff);
  font-weight: 700;
  font-size: var(--guide-fs-xs);
  letter-spacing: 0.10em;
  text-transform: var(--guide-label-case, uppercase);
  border-radius: 3px;
}

/* Body — re-use the .nrma-lib-section--bill template but without its outer
   margin (the bill page wraps it). Reset some inherited margins. */
.nrma-billview-body.nrma-lib-section--bill {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}
.nrma-billview-body.nrma-lib-section--bill::before {
  display: none; /* hide the section-type badge — covered by cover plate */
}
.nrma-billview-body.nrma-lib-section--bill .nrma-lib-section-title {
  display: none; /* already in the cover plate */
}
.nrma-billview-body p { text-align: justify; }
.nrma-billview-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid #d4d2c8;
  font-size: var(--guide-fs-xs);
  color: #5d4e2f;
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * STANDALONE ARM VIEW (#/nrma/NR-NN/arm)
 * ─────────────────────────────────────────────────────────────────────── */
.nrma-armview-root {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px 60px;
  align-self: stretch;
  text-align: left;
  color: var(--guide-color-ink);
}
.nrma-armview-loading,
.nrma-armview-error { padding: 40px 20px; color: var(--guide-color-ink-soft); font-size: var(--guide-fs-base); }
.nrma-armview-error a { color: var(--guide-color-action); }
.nrma-armview-chrome { margin: 0 0 16px; }
.nrma-armview-chrome-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--guide-color-raised);
  border: 1px solid var(--guide-color-line);
  border-radius: 12px;
}
/* White on white glass, written for the dark backdrop. A secondary button. */
.nrma-armview-back {
  color: var(--guide-color-action);
  text-decoration: none;
  font-size: var(--guide-fs-sm);
  font-weight: 600;
  padding: 4px 12px;
  background: transparent;
  border: 1px solid var(--guide-color-action);
  border-radius: 6px;
}
.nrma-armview-back:hover { background: color-mix(in srgb, var(--guide-color-action) 8%, transparent); }
.nrma-armview-spacer { flex: 1 1 auto; }
/* A button, so lake like the bill view's. It was the facsimile's brown. */
.nrma-armview-print {
  padding: 6px 14px;
  font-weight: 600;
  font-size: var(--guide-fs-sm);
  color: var(--guide-color-on-action);
  background: var(--guide-color-action);
  border: 1px solid var(--guide-color-action);
  border-radius: 6px;
  cursor: pointer;
}
.nrma-armview-print:hover { background: var(--guide-color-action-hover); }

.nrma-armview-page {
  background: #faf6ea;
  color: var(--guide-color-ink);
  border: 1px solid #d2c69b;
  border-radius: 4px;
  padding: 44px 56px 56px;
  box-shadow: var(--guide-shadow-rest);
  font-family: "Georgia", "Times New Roman", serif;
}
.nrma-armview-cover {
  border-bottom: 2px solid #5d4e2f;
  padding-bottom: 22px;
  margin-bottom: 26px;
}
.nrma-armview-register {
  font-family: "Georgia", serif;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.30em;
  text-transform: var(--guide-label-case, uppercase);
  color: #3a2f1a;
}
.nrma-armview-notice-type {
  font-size: var(--guide-fs-xs);
  letter-spacing: 0.16em;
  text-transform: var(--guide-label-case, uppercase);
  color: #5d4e2f;
  margin: 3px 0 14px;
}
.nrma-armview-fwid {
  font-size: 12px;
  font-style: italic;
  color: #5d4e2f;
  margin-bottom: 12px;
}
.nrma-armview-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.25;
  color: var(--guide-color-ink);
}
.nrma-armview-byline {
  font-size: 12px;
  color: #5d4e2f;
  font-style: italic;
  margin-bottom: 12px;
}
.nrma-armview-stamp {
  display: inline-block;
  padding: 3px 14px;
  background: #5d4e2f;
  color: var(--guide-color-text-on-accent, #fff);
  font-weight: 700;
  font-size: var(--guide-fs-xs);
  letter-spacing: 0.10em;
  text-transform: var(--guide-label-case, uppercase);
  border-radius: 3px;
}
.nrma-armview-body.nrma-lib-section--arm {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}
.nrma-armview-body.nrma-lib-section--arm::before { display: none; }
.nrma-armview-body.nrma-lib-section--arm .nrma-lib-section-title { display: none; }
.nrma-armview-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid #d2c69b;
  font-size: var(--guide-fs-xs);
  color: #5d4e2f;
  font-style: italic;
}

/* ─── Print rules — clean PDF output ─── */
@media print {
  /* ─── Reset the SPA fixed-positioned overlay so the entire chapter
     flows into the printable document. Without this the browser only
     prints the visible 900px viewport of #nrma-hero. ─── */
  html, body {
    background: #fff !important;
    color: #000 !important;
    height: auto !important;
    overflow: visible !important;
  }
  #app-shell, #main-content {
    height: auto !important;
    overflow: visible !important;
    display: block !important;
  }
  #nrma-hero {
    position: static !important;
    overflow: visible !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: block !important;
    top: auto !important; left: auto !important; right: auto !important; bottom: auto !important;
    z-index: auto !important;
    background: #fff !important;
  }
  #nrma-hero::before,
  #nrma-hero::after {
    /* Kill the hero's decorative overlay layers so they don't ink the
       printout. */
    display: none !important;
  }
  #nrma-hero .nrma-hero-inner {
    background: #fff !important;
    padding: 0 !important;
    align-items: stretch !important;
    text-align: left !important;
    animation: none !important;
  }
  /* Hide every piece of app chrome */
  #top-bar,
  #nav-row,
  #icon-rail,
  #agency-rail,
  #nrma-rail,
  #layer-column,
  #nrma-chapter-rail,
  /* Both acts render their launchpad and home title into these same ids,
     so the list is shared rather than forked per act. */
  #remix-launchpad,
  .remix-home-title,
  .remix-title-row,
  .remix-home-subtitle,
  .nrma-hero-bg,
  .nrma-lib-tabs,
  .nrma-lib-toc,
  .nrma-lib-rail,
  .nrma-ask-btn,
  .nrma-anchor,
  .nrma-lib-linear-nav,
  .nrma-lib-export-bar {
    display: none !important;
  }
  /* Prose: full-width, ink-black serif body, generous reading size */
  #nrma-chapter-view,
  #nrma-chapter-view.nrma-lib-root,
  .nrma-lib-root { max-width: none !important; padding: 0 !important; }
  .nrma-lib-grid {
    display: block !important;
    grid-template-columns: none !important;
    gap: 0 !important;
  }
  .nrma-lib-prose {
    background: #fff !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    color: #000 !important;
    font-size: 11.5pt !important;
    line-height: 1.55 !important;
  }
  .nrma-lib-prose-title { font-size: 22pt; color: #000 !important; }
  .nrma-lib-prose-subtitle { font-size: 13pt; }
  .nrma-lib-prose-meta { color: #444 !important; }
  .nrma-lib-prose-chip {
    background: #000 !important;
    color: var(--guide-color-text-on-accent, #fff) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .nrma-lib-section-title,
  .nrma-lib-section-body .nrma-heading--2,
  .nrma-lib-section-body .nrma-heading--3,
  .nrma-lib-section-body .nrma-heading--4 {
    break-after: avoid;
    color: #000 !important;
  }
  .nrma-lib-section { break-inside: auto; }
  .nrma-lib-section-body .nrma-table { font-size: 9.5pt; }
  .nrma-lib-prose .nrma-term { border-bottom: none; background: none; }
  .nrma-lib-prose .nrma-fw-link,
  .nrma-lib-prose .nrma-tool-link {
    color: #000; border-bottom: none;
  }
  .nrma-lib-prose .nrma-tool-link::before { content: ""; }
  /* Render citations as footnote markers */
  .nrma-lib-prose .nrma-cite { color: #000; font-size: 7pt; vertical-align: super; }
  /* Claim chips: show a subtle status mark next to verified text */
  .nrma-lib-prose .nrma-claim {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-decoration: none !important;
  }
  .nrma-lib-prose .nrma-claim::before,
  .nrma-lib-prose .nrma-claim::after { display: none !important; }
  /* Lead-in labels stay bold in print */
  .nrma-li-lead { font-weight: 700 !important; color: #000 !important; }
  /* @page margins for a clean letter-sized PDF */
  @page { margin: 0.75in 0.75in 0.75in 0.75in; }

  /* ─── Bill standalone view print ─── */
  .nrma-billview-chrome { display: none !important; }
  .nrma-billview-root { max-width: none !important; padding: 0 !important; }
  .nrma-billview-page {
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    font-size: 11pt !important;
  }
  .nrma-billview-title { font-size: 18pt !important; color: #000 !important; }
  .nrma-billview-stateline,
  .nrma-billview-fwid,
  .nrma-billview-byline,
  .nrma-billview-stamp { color: #000 !important; background: transparent !important; }
  .nrma-billview-stamp { border: 1px solid #000 !important; }
  .nrma-billview-foot { color: #000 !important; }
  .nrma-billview-body p { text-align: justify; }

  /* ─── ARM standalone view print ─── */
  .nrma-armview-chrome { display: none !important; }
  .nrma-armview-root { max-width: none !important; padding: 0 !important; }
  .nrma-armview-page {
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    font-size: 11pt !important;
  }
  .nrma-armview-title { font-size: 18pt !important; color: #000 !important; }
  .nrma-armview-register,
  .nrma-armview-notice-type,
  .nrma-armview-fwid,
  .nrma-armview-byline,
  .nrma-armview-stamp { color: #000 !important; background: transparent !important; }
  .nrma-armview-stamp { border: 1px solid #000 !important; }
  .nrma-armview-foot { color: #000 !important; }
  @page { margin: 0.75in; }
}

/* ─── Responsive ─── */
/* Medium-laptop tier (1100-1400px): keep 3-col but narrow the side
   panels so the prose still gets a usable column. The min-width: 0 +
   table/header wrap fixes from earlier PRs keep prose from overflowing
   into the rail at these widths. */
@media (max-width: 1400px) and (min-width: 1101px) {
  .nrma-lib-grid {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) minmax(220px, 280px);
    gap: 24px;
  }
}
/* Small-laptop / tablet tier (≤1100px): collapse to single column. */
@media (max-width: 1100px) {
  .nrma-lib-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  .nrma-lib-toc, .nrma-lib-rail {
    position: relative;
    top: auto;
    max-height: none;
  }
  /* The prose card keeps its own reading-measure cap when the grid collapses;
     it used to stretch to 100% here, which ran body text past 90ch. */
}
@media (max-width: 760px) {
  .nrma-lib-prose {
    padding: 28px 22px 40px;
    font-size: 16.5px;
    line-height: 1.65;
    border-radius: 8px;
  }
  .nrma-lib-prose-title { font-size: 28px; letter-spacing: -0.018em; }
  .nrma-lib-prose-subtitle { font-size: 16.5px; }
  .nrma-lib-section { margin-top: 42px; }
  .nrma-lib-section-title,
  .nrma-lib-section--editorial .nrma-lib-section-title { font-size: 24px; margin-bottom: 18px; }
  .nrma-lib-section-body h3,
  .nrma-lib-section-body .nrma-heading--2,
  .nrma-lib-section--editorial .nrma-lib-section-body .nrma-heading--2 {
    font-size: 18px;
    margin: 28px 0 10px;
  }
  /* Smaller drop cap on narrow viewports — and tighter integration. */
  .nrma-lib-section--editorial .nrma-lib-section-body > p:first-of-type::first-letter,
  .nrma-lib-section--editorial .nrma-heading--2 + p::first-letter {
    font-size: 44px;
    line-height: 0.84;
    margin: 0.08em 0.10em 0 0;
  }
}

/* ─── Dark theme overrides ─────────────────────────────────────────── */
/* Every colour in this block resolves through a role token, so the dark values
   are the ones theme-tokens.css measured rather than a second palette invented
   here. rgba(var(--guide-wash-rgb), …) is white-on-dark under this selector by
   definition, which is why the hairlines no longer carry a literal. */
/* The tabs, the prose card, the tables, the citation chips, the links and the
   ask button need no dark copy any more: their light rules are role tokens
   (raised, line, paper-2, ink, action) that already carry a dark value. */

/* Comprehensive body-text legibility in dark theme.
   The prose template hardcodes near-black ink on body copy, the subtitle,
   section titles, leads, strong text and quotes. These were never flipped, so
   they read dark-on-navy.

   WUA Remix carried this whole block and NRMA carried only the title rule —
   so the NRMA reader has been showing near-black body copy on navy ever since.
   The prose markup is generated by one shared template, so the fix is shared
   too: that divergence was the bug, not a per-act decision. */
[data-theme="dark"] .nrma-lib-prose .nrma-heading--1,
[data-theme="dark"] .nrma-lib-prose .nrma-heading--2,
[data-theme="dark"] .nrma-lib-prose .nrma-heading--3,
[data-theme="dark"] .nrma-lib-prose-title,
[data-theme="dark"] .nrma-lib-section-title,
[data-theme="dark"] .nrma-lib-section-title .nrma-lib-section-titletext,
[data-theme="dark"] .nrma-lib-section-body .nrma-heading--2,
[data-theme="dark"] .nrma-lib-section-body .nrma-heading--3,
[data-theme="dark"] .nrma-lib-section-body .nrma-heading--4,
[data-theme="dark"] .nrma-lib-prose strong,
[data-theme="dark"] .nrma-lib-section-body .nrma-li-lead {
  color: var(--guide-color-ink);
}
[data-theme="dark"] .nrma-lib-prose p,
[data-theme="dark"] .nrma-lib-section-body p,
[data-theme="dark"] .nrma-lib-prose li,
[data-theme="dark"] .nrma-lib-section-body li,
/* Editorial lead paragraph hardcodes its ink at (0,3,1) — beat it. */
[data-theme="dark"] .nrma-lib-section--editorial .nrma-lib-section-body > p:first-of-type,
[data-theme="dark"] .nrma-lib-section--editorial .nrma-heading--2:first-of-type + p {
  color: var(--guide-color-text-primary);
}
[data-theme="dark"] .nrma-lib-prose-subtitle,
[data-theme="dark"] .nrma-lib-prose-author,
[data-theme="dark"] .nrma-lib-section-body blockquote.nrma-quote { color: var(--guide-color-text-secondary); }
[data-theme="dark"] .nrma-lib-prose-meta { color: var(--guide-color-text-muted); }

/* The bill facsimile's paper is a literal, so it alone needs a dark copy. */
[data-theme="dark"] .nrma-lib-section--bill { background: var(--guide-color-paper-2); color: var(--guide-color-text-primary); border-color: var(--guide-color-line); }

/* ── NRMA multi-state comparison view (src/nrma/multi-state-view.js) ────────
   406 researched cells across 12 states had no view at all before this — the
   data was reachable only through AI tools. Solid content surfaces per
   CONVENTIONS: the dialog chrome is glass, the cards inside are not. */
.nms-body { max-width: 100%; }
.nms-intro,
.nms-loading,
.nms-error { font-size: 13px; line-height: 1.55; color: var(--guide-color-text-secondary, #4A4A52); margin: 0 0 12px; }
.nms-error { color: var(--guide-color-status-crit, #B22234); }

.nms-picker { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; font-weight: 600; }
.nms-picker select {
  flex: 1 1 auto; max-width: 460px; padding: 7px 9px; font-size: 13px;
  border-radius: 6px; border: 1px solid var(--guide-color-border-default, rgba(0, 0, 0, 0.18));
  background: var(--guide-color-surface, #FFFFFF); color: inherit;
}

.nms-coverage { font-size: 12px; color: var(--guide-color-text-secondary, #4A4A52); margin: 0 0 10px; }

.nms-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.nms-cell {
  padding: 12px 14px; border-radius: 8px;
  background: var(--guide-color-surface, #FFFFFF);
  border: 1px solid var(--guide-color-border-default, rgba(0, 0, 0, 0.12));
}
.nms-cell--empty { background: transparent; border-style: dashed; }
.nms-cell-head { font-size: 13px; margin-bottom: 5px; }
.nms-prog { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.nms-cite { font-size: var(--guide-fs-xs); color: var(--guide-color-text-secondary); margin-bottom: 7px; }
.nms-empty { font-size: 12px; color: var(--guide-color-text-secondary); font-style: italic; }

.nms-list { margin: 0 0 7px; padding-left: 17px; font-size: 12px; line-height: 1.5; }
.nms-list li { margin-bottom: 3px; }

.nms-lessons { margin-bottom: 7px; }
.nms-lessons-label {
  display: inline-block; font-size: var(--guide-fs-2xs); text-transform: var(--guide-label-case, uppercase); letter-spacing: 0.04em;
  font-weight: 700; color: var(--guide-color-text-secondary); margin-bottom: 3px;
}
.nms-appl { font-size: 12px; line-height: 1.5; margin-bottom: 7px; }
.nms-src { font-size: 12px; font-weight: 600; }

.nms-supp { margin-top: 16px; }
.nms-supp > summary { cursor: pointer; font-size: 13px; font-weight: 600; padding: 6px 0; }
.nms-supp > div { margin-top: 10px; }

@media (max-width: 640px) {
  .nms-grid { grid-template-columns: 1fr; }
  .nms-picker { flex-direction: column; align-items: stretch; }
  .nms-picker select { max-width: none; }
}
