* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(980px 420px at 0% 0%, hsl(var(--foreground) / 0.022), transparent 56%),
    linear-gradient(180deg, hsl(var(--background)) 0%, hsl(var(--surface-inset)) 100%);
  color: hsl(var(--foreground));
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-open {
  overflow: hidden;
}

::selection {
  background: hsl(var(--foreground) / 0.12);
}

img {
  display: block;
  max-width: 100%;
}

code,
pre {
  font-family: var(--font-mono);
}

code {
  display: inline-block;
  padding: 0.08rem 0.35rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  font-size: 0.92em;
}

pre {
  overflow: auto;
  margin: 1.4rem 0 1.6rem;
  padding: 1rem 1.1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  background: hsl(var(--card));
  box-shadow: var(--shadow-soft);
}

hr {
  border: 0;
  border-top: 1px solid hsl(var(--border));
  margin: 2rem 0;
}

.language-math {
  overflow-x: auto;
}

:focus-visible {
  outline: 3px solid hsl(var(--foreground) / 0.2);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--layout-page-gutter);
  top: var(--space-4);
  z-index: 100;
  transform: translateY(-140%);
  padding: 0.7rem 0.95rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--ref-control-radius);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-overlay);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(140%) blur(10px);
  background: hsl(var(--background) / 0.94);
  border-bottom: 0;
}

.site-header-inner,
.page-shell,
.site-footer {
  width: min(calc(100% - (2 * var(--layout-page-gutter))), var(--layout-page-max));
  margin-inline: auto;
}

.site-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
}

.brand {
  min-width: 0;
}

.brand a {
  color: hsl(var(--foreground));
  text-decoration: none;
}

.brand-title {
  display: inline-block;
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.nav-toggle:hover {
  opacity: 0.7;
}

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.24rem;
  width: 1.25rem;
  pointer-events: none;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  transition:
    transform var(--duration-fast) var(--ease-standard),
    opacity var(--duration-fast) var(--ease-standard);
}

.site-header.open .nav-toggle-bar:nth-child(1) {
  transform: translateY(0.35rem) rotate(45deg);
}

.site-header.open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.site-header.open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-0.35rem) rotate(-45deg);
}

.site-nav {
  position: absolute;
  right: 0;
  top: calc(100% + 0.55rem);
  display: none;
  width: min(var(--layout-menu-measure), calc(100vw - (2 * var(--layout-page-gutter))));
  padding: 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-xl);
  background: hsl(var(--card));
  box-shadow: var(--shadow-overlay);
}

.site-header.open .site-nav {
  display: block;
}

.menu-section + .menu-section {
  margin-top: 0.95rem;
  padding-top: 0.95rem;
  border-top: 1px solid hsl(var(--border));
}

.menu-heading {
  margin: 0 0 0.55rem;
  color: hsl(var(--foreground) / 0.46);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.menu-links,
.toc {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.menu-links a,
.toc a,
.site-nav a {
  display: block;
  padding: 0.5rem 0.65rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: hsl(var(--foreground) / 0.78);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.35;
  text-decoration: none;
}

.menu-links a:hover,
.menu-links a.active,
.menu-links a[aria-current="page"],
.toc a:hover,
.toc a.active {
  background: hsl(var(--muted));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.toc-menu {
  max-height: min(50vh, 19rem);
  overflow: auto;
  padding-right: 0.15rem;
}

.toc .level-3 {
  padding-left: 1rem;
}

.toc .level-4 {
  padding-left: 1.55rem;
}

.page-shell {
  margin: 1.9rem auto 4rem;
}

.page-grid,
.page-grid.no-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.main-column {
  min-width: 0;
}

.card,
.content-card,
.page-header,
.hero,
.footer-card {
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.page-header,
.hero {
  margin-bottom: 1.2rem;
  padding: 0 0 1.3rem;
  border-bottom: 1px solid hsl(var(--border));
}

.page-header--longform {
  display: grid;
  gap: 0.9rem;
}

.page-header h1,
.hero h1 {
  margin: 0.35rem 0 0.85rem;
  color: hsl(var(--foreground));
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  line-height: 1.02;
  text-wrap: balance;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: hsl(var(--foreground) / 0.44);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.page-header--longform .eyebrow,
.page-header--longform h1 {
  margin-bottom: 0;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin: 0;
  padding: 0;
}

.page-meta > div {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.page-meta dt {
  color: hsl(var(--foreground) / 0.46);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.page-meta dd {
  margin: 0;
  color: hsl(var(--foreground) / 0.76);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.4;
}

.page-meta code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-size: 0.92em;
}

.lead,
.directory-note {
  max-width: var(--layout-lead-measure);
  color: hsl(var(--foreground) / 0.78);
  font-size: var(--text-lead);
  line-height: var(--leading-lead);
}

.lead-block {
  max-width: var(--layout-lead-measure);
}

.lead-block > :last-child {
  margin-bottom: 0;
}

.lead-block .lead,
.lead-block .document-intro {
  margin: 0;
}

.document-masthead {
  margin: 0 0 1.9rem;
}

.document-date,
.version-stamp,
.entry-id {
  color: hsl(var(--foreground) / 0.58);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.document-masthead .document-title {
  margin: 0;
  max-width: 13.5ch;
  color: hsl(var(--foreground));
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-wrap: pretty;
}

.document-date {
  display: block;
  margin-top: 1.15rem;
  margin-bottom: 0;
  color: hsl(var(--foreground) / 0.58);
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.document-intro {
  max-width: 33rem;
  color: hsl(var(--foreground) / 0.82);
  font-size: var(--text-lead);
  line-height: var(--leading-lead);
  margin-bottom: 2rem;
  text-wrap: pretty;
}

.callout,
.document-overview {
  margin: 0 0 2.4rem;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  background: hsl(var(--muted) / 0.68);
}

.callout > :first-child,
.document-overview > :first-child {
  margin-top: 0;
}

.callout > :last-child,
.document-overview > :last-child {
  margin-bottom: 0;
}

.callout--note {
  background: hsl(var(--surface-inset));
}

.callout--summary {
  background: hsl(var(--muted) / 0.68);
}

.callout--protocol {
  border-color: hsl(var(--foreground) / 0.12);
  background: hsl(var(--surface-inset));
}

.document-overview-label {
  margin: 0 0 0.45rem;
  color: hsl(var(--foreground) / 0.56);
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.document-overview p:last-child {
  margin: 0;
  color: hsl(var(--foreground) / 0.78);
  font-size: 0.95rem;
  line-height: 1.58;
}

.citation-block {
  margin: 1.5rem 0;
  padding: 0.95rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  background: hsl(var(--surface-inset));
  box-shadow: var(--shadow-soft);
}

.citation-block > :first-child {
  margin-top: 0;
}

.citation-block > :last-child {
  margin-bottom: 0;
}

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

/* Top-of-article metadata card */

.article-meta-card {
  max-width: min(100%, 52rem);
  margin: 0 0 1.65rem;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid hsl(var(--foreground) / 0.08);
  border-radius: var(--radius-lg);
  background: hsl(var(--surface-inset));
  box-shadow: var(--shadow-soft);
}

.article-meta-card > :first-child {
  margin-top: 0;
}

.article-meta-card > :last-child {
  margin-bottom: 0;
}

.article-meta-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: 0.9rem 1rem;
  margin-bottom: 0.85rem;
}

.article-authors {
  margin: 0;
  color: hsl(var(--foreground));
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.article-authors a {
  color: inherit;
  text-decoration-color: hsl(var(--foreground) / 0.22);
}

.article-authors a:hover {
  text-decoration-color: hsl(var(--foreground) / 0.5);
}

.meta-inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.meta-divider {
  color: hsl(var(--foreground) / 0.26);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.15rem 0.55rem;
  border: 1px solid hsl(var(--foreground) / 0.08);
  border-radius: var(--ref-control-radius);
  background: hsl(var(--card));
  color: hsl(var(--foreground) / 0.82);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.meta-chip:hover {
  background: hsl(var(--muted));
  text-decoration: none;
}

.meta-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
}

.meta-chip-icon {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
}

.article-meta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.meta-action {
  min-height: 2.35rem;
  padding: 0.45rem 0.8rem;
  font-size: 0.88rem;
}

.copy-status {
  margin: 0.75rem 0 0;
  color: hsl(var(--foreground) / 0.6);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  line-height: 1.4;
}

.button-row,
.tools-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.button,
.button-like,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 0.95rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--ref-control-radius);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
}

.button:hover,
.button-like:hover,
.tag:hover {
  background: hsl(var(--muted));
  text-decoration: none;
}

.button.primary {
  background: hsl(var(--foreground));
  border-color: hsl(var(--foreground));
  color: hsl(var(--background));
}

.button.primary:hover {
  background: hsl(var(--foreground) / 0.92);
  border-color: hsl(var(--foreground) / 0.92);
}

.content-card {
  padding: 0;
}

.content-body {
  max-width: var(--layout-body-measure);
  padding: 0;
  color: hsl(var(--foreground) / 0.8);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

.content-body > *:first-child {
  margin-top: 0;
}

.content-body > :where(p, ul, ol, blockquote, pre, hr, .table-scroll, .callout, .citation-block) {
  margin-top: 0;
  margin-bottom: 1rem;
}

.content-body > :where(h1, h2, h3, h4, h5, h6) {
  margin-top: 0;
  max-width: var(--layout-body-measure);
}

.content-body > :where(pre, .table-scroll, .callout, .citation-block) {
  max-width: min(100%, 52rem);
}

.content-body :where(p, li, td, th) {
  color: inherit;
}

.content-body ul,
.content-body ol {
  padding-left: 1.25rem;
}

.content-body li {
  margin: 0.35rem 0;
}

.content-body strong {
  color: hsl(var(--foreground));
}

.content-body a,
.entry-links a,
.entry-id a,
.incident-ref {
  color: hsl(var(--foreground));
  text-decoration-color: hsl(var(--foreground) / 0.26);
  text-underline-offset: 0.18em;
}

.content-body a:hover,
.entry-links a:hover,
.entry-id a:hover,
.incident-ref:hover {
  text-decoration-color: hsl(var(--foreground) / 0.52);
}

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4,
.content-body h5,
.content-body h6,
.incident-year-heading,
.incident-entry h3 {
  scroll-margin-top: var(--layout-anchor-offset);
  color: hsl(var(--foreground));
  text-wrap: balance;
}

.content-body h1:not(.document-title),
.content-body h2,
.content-body h3,
.content-body h4 {
  font-family: var(--font-serif);
  font-weight: 700;
}

.content-body h1:not(.document-title) {
  font-size: 2rem;
  margin: 2.75rem 0 0.9rem;
}

.content-body h2,
.incident-year-heading {
  font-size: 2rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 3rem 0 0.7rem;
}

.content-body h3,
.incident-entry h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 1.75rem 0 0.45rem;
}

.content-body h4,
.content-body h5,
.content-body h6 {
  margin: 1.4rem 0 0.4rem;
  color: hsl(var(--foreground) / 0.58);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.content-body p,
.content-body li {
  max-width: var(--layout-body-measure);
}

.incident-year-heading {
  scroll-margin-top: var(--layout-anchor-offset);
  color: hsl(var(--foreground) / 0.52);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
  margin: 2rem 0 0.65rem;
}

.incident-entry h3 {
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.content-body blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 2px solid hsl(var(--foreground) / 0.16);
  color: hsl(var(--foreground) / 0.72);
}

.table-scroll {
  position: relative;
  overflow: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable both-edges;
  margin: 1.6rem 0 1.9rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  background: hsl(var(--card));
  box-shadow: var(--shadow-soft);
}

.table-scroll::before,
.table-scroll::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: var(--table-overflow-fade-width);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.table-scroll::before {
  left: 0;
  background: linear-gradient(90deg, var(--table-overflow-fade-color), transparent);
  box-shadow: inset 0.75rem 0 0.75rem -0.75rem var(--table-overflow-shadow-color);
}

.table-scroll::after {
  right: 0;
  background: linear-gradient(270deg, var(--table-overflow-fade-color), transparent);
  box-shadow: inset -0.75rem 0 0.75rem -0.75rem var(--table-overflow-shadow-color);
}

.table-scroll.is-overflowing:not(.is-at-start)::before {
  opacity: 1;
}

.table-scroll.is-overflowing:not(.is-at-end)::after {
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  .table-scroll {
    scrollbar-gutter: auto;
  }

  .table-scroll::before,
  .table-scroll::after {
    display: none;
  }
}

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: var(--text-body-tight);
  line-height: 1.4;
}

.table-scroll th,
.table-scroll td {
  padding: var(--table-cell-padding-block-default) var(--table-cell-padding-inline-default);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid hsl(var(--border));
  overflow-wrap: anywhere;
}

.table-scroll th {
  background: hsl(var(--surface-inset));
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-scroll tr:last-child td {
  border-bottom: 0;
}

.table-scroll :is(th, td).col-id,
.table-scroll :is(th, td).col-file,
.table-scroll :is(th, td).col-date,
.table-scroll :is(th, td).col-outcome,
.table-scroll :is(th, td).col-status,
.table-scroll :is(th, td).col-label {
  white-space: nowrap;
}

.table-scroll :is(th, td).col-grade {
  white-space: nowrap;
  text-align: center;
}

.table-scroll :is(th, td).col-count {
  white-space: nowrap;
  text-align: right;
}

.table-scroll :is(th, td).col-description,
.table-scroll :is(th, td).col-tags {
  min-width: 14rem;
}

.table-scroll .table-data {
  min-width: var(--table-min-inline-data);
}

.table-scroll .table-matrix {
  min-width: var(--table-min-inline-matrix);
}

.table-scroll .table-codebook {
  min-width: var(--table-min-inline-codebook);
}

.table-scroll .table-registry {
  min-width: var(--table-min-inline-registry);
}

.table-scroll .table-governance {
  min-width: var(--table-min-inline-governance);
}

.table-scroll :is(.table-matrix, .table-codebook, .table-registry, .table-governance) :is(th, td) {
  padding: var(--table-cell-padding-block-compact) var(--table-cell-padding-inline-compact);
}

.table-data[data-col-map="file,description"] :is(th, td):first-child,
.table-data[data-col-map="metric,value"] :is(th, td):first-child {
  width: 14rem;
}

.table-codebook[data-col-map="category,subcodes,locus"] :is(th, td):first-child {
  width: 7rem;
  white-space: nowrap;
}

.table-codebook[data-col-map="category,subcodes,locus"] :is(th, td):nth-child(2) {
  width: 15rem;
}

.table-codebook[data-col-map="code,name,rule"] :is(th, td):first-child {
  width: 8rem;
  white-space: nowrap;
}

.table-codebook[data-col-map="code,name,rule"] :is(th, td):nth-child(2),
.table-codebook[data-col-map="grade,evidence,guidance"] :is(th, td):first-child,
.table-codebook[data-col-map="change,action,rationale"] :is(th, td):nth-child(2) {
  width: 11rem;
}

.table-codebook[data-col-map="grade,evidence,guidance"] :is(th, td):first-child {
  white-space: nowrap;
}

.table-codebook[data-col-map="pattern,rule,example"] :is(th, td):first-child {
  width: 17rem;
}

.table-codebook[data-col-map="pattern,rule,example"] :is(th, td):nth-child(2) {
  width: 12rem;
}

.table-codebook[data-col-map="archetype,evidence-center,established"] :is(th, td):first-child {
  width: 14rem;
}

.table-codebook[data-col-map="archetype,evidence-center,established"] :is(th, td):nth-child(2) {
  width: 11rem;
}

.table-codebook[data-col-map="feature,support,anchors,framing"] :is(th, td):first-child {
  width: 14rem;
}

.table-codebook[data-col-map="feature,support,anchors,framing"] :is(th, td):nth-child(2) {
  width: 12rem;
}

.table-codebook[data-col-map="feature,support,anchors,framing"] :is(th, td):nth-child(3) {
  width: 15rem;
}

.table-registry[data-col-map="id,description,grade,citation,jurisdiction,outcome"] :is(th, td):first-child,
.table-registry[data-col-map="id,platform,date,user,outcome,grade,subcodes"] :is(th, td):first-child {
  width: 8.5rem;
  white-space: nowrap;
}

.table-registry[data-col-map="id,description,grade,citation,jurisdiction,outcome"] :is(th, td):nth-child(3),
.table-registry[data-col-map="id,platform,date,user,outcome,grade,subcodes"] :is(th, td):nth-child(6) {
  width: 4.75rem;
  white-space: nowrap;
  text-align: center;
}

.table-registry[data-col-map="id,description,grade,citation,jurisdiction,outcome"] :is(th, td):last-child,
.table-registry[data-col-map="id,platform,date,user,outcome,grade,subcodes"] :is(th, td):nth-child(5) {
  width: 8rem;
  white-space: nowrap;
}

.table-registry[data-col-map="id,platform,date,user,outcome,grade,subcodes"] :is(th, td):nth-child(3) {
  width: 7rem;
  white-space: nowrap;
}

.table-registry[data-col-map="id,platform,date,user,outcome,grade,subcodes"] :is(th, td):last-child {
  width: 17rem;
}

.table-matrix[data-col-map="outcome,count,a1,a2,b,c"] :is(th, td):not(:first-child),
.table-matrix[data-col-map="grade,records,with-fatalities,total-fatalities"] :is(th, td):not(:first-child) {
  white-space: nowrap;
  text-align: right;
}

.table-matrix[data-col-map="outcome,count,a1,a2,b,c"] :is(th, td):first-child,
.table-matrix[data-col-map="grade,records,with-fatalities,total-fatalities"] :is(th, td):first-child {
  width: 12rem;
}

.table-governance[data-col-map="id,organization,document-type,self-harm,risk-status,object-status,first-class,threshold,deployment,multi-turn"] :is(th, td):first-child {
  width: 9.5rem;
  white-space: nowrap;
}

.table-governance[data-col-map="id,organization,document-type,self-harm,risk-status,object-status,first-class,threshold,deployment,multi-turn"] :is(th, td):nth-child(2) {
  width: 8rem;
}

.table-governance[data-col-map="id,organization,document-type,self-harm,risk-status,object-status,first-class,threshold,deployment,multi-turn"] :is(th, td):nth-child(3) {
  width: 9rem;
}

.table-governance[data-col-map="id,organization,document-type,self-harm,risk-status,object-status,first-class,threshold,deployment,multi-turn"] :is(th, td):nth-child(4),
.table-governance[data-col-map="id,organization,document-type,self-harm,risk-status,object-status,first-class,threshold,deployment,multi-turn"] :is(th, td):nth-child(7),
.table-governance[data-col-map="id,organization,document-type,self-harm,risk-status,object-status,first-class,threshold,deployment,multi-turn"] :is(th, td):nth-child(8),
.table-governance[data-col-map="id,organization,document-type,self-harm,risk-status,object-status,first-class,threshold,deployment,multi-turn"] :is(th, td):nth-child(9),
.table-governance[data-col-map="id,organization,document-type,self-harm,risk-status,object-status,first-class,threshold,deployment,multi-turn"] :is(th, td):nth-child(10) {
  white-space: nowrap;
  text-align: center;
}

.table-governance[data-col-map="jurisdiction,framework,provisions,status"] :is(th, td):first-child {
  width: 8rem;
  white-space: nowrap;
}

.table-governance[data-col-map="jurisdiction,framework,provisions,status"] :is(th, td):nth-child(2) {
  width: 10rem;
}

.search-input {
  width: min(100%, var(--layout-search-measure));
  min-height: 3rem;
  padding: 0.78rem 0.95rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.search-input::placeholder {
  color: hsl(var(--foreground) / 0.45);
}

.search-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  font-family: var(--font-ui);
}

.search-pill,
.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 2.35rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--ref-control-radius);
  background: hsl(var(--card));
  color: hsl(var(--foreground) / 0.8);
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.2;
  white-space: nowrap;
}

.search-pill strong {
  color: hsl(var(--foreground));
}

.search-clear {
  cursor: pointer;
  min-width: max-content;
  padding-inline: 0.95rem;
}

.search-clear:hover {
  background: hsl(var(--muted));
}

.incident-year-heading {
  margin-top: 2.15rem;
  margin-bottom: 0.3rem;
}

.incident-year-group[hidden] {
  display: none;
}

.incident-entry {
  margin: 1.4rem 0 1.7rem;
  padding: 1.25rem 0 0;
  border-top: 1px solid hsl(var(--border));
}

.incident-entry.hidden {
  display: none;
}

.incident-entry h3 {
  margin-top: 0;
  margin-bottom: 0.55rem;
}

.directory-entry,
.entry-id {
  scroll-margin-top: var(--layout-anchor-offset);
}

.directory-entry:target {
  margin-left: -0.9rem;
  margin-right: -0.9rem;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
  border-radius: var(--radius-lg);
  background: hsl(var(--muted) / 0.7);
}

.entry-id {
  margin: 0 0 0.35rem;
}

.entry-id a {
  text-decoration: none;
}

.entry-summary {
  margin-bottom: 0.7rem;
}

.entry-links {
  margin: 0;
  color: hsl(var(--foreground) / 0.68);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.entry-divider {
  color: hsl(var(--foreground) / 0.35);
}

.small {
  font-size: 0.92rem;
}

.site-footer {
  margin: 4rem auto 2rem;
  color: hsl(var(--foreground) / 0.78);
}

.footer-card {
  padding: 1.5rem 0 0;
  border-top: 1px solid hsl(var(--border));
}

.footer-card p {
  margin: 0.35rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr);
  gap: 1.5rem 2.25rem;
  align-items: start;
}

.footer-block + .footer-block {
  margin-top: 1.5rem;
}

.footer-label {
  margin: 0 0 0.5rem;
  color: hsl(var(--foreground) / 0.46);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.footer-footnote {
  margin: 0;
  max-width: 44rem;
  color: hsl(var(--foreground) / 0.72);
  font-size: 0.96rem;
  line-height: 1.65;
}

.footer-meta {
  display: grid;
  gap: 0.6rem;
  margin: 0;
}

.footer-meta > div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.5rem;
}

.footer-meta dt {
  margin: 0;
  color: hsl(var(--foreground) / 0.46);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.footer-meta dd {
  margin: 0;
  color: hsl(var(--foreground) / 0.82);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  line-height: 1.45;
}

.footer-meta code {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 0.88em;
  color: hsl(var(--foreground) / 0.68);
}

.footer-block-closing {
  margin-top: 1.75rem;
  max-width: 44rem;
}

.footer-kicker {
  margin: 0 0 0.45rem;
  color: hsl(var(--foreground));
  font-size: 1rem;
  line-height: 1.5;
}

.footer-supporting {
  margin: 0.35rem 0 0;
  color: hsl(var(--foreground) / 0.62);
  font-size: 0.92rem;
  line-height: 1.6;
}

#ref1,
#fn1 a {
  text-decoration: none;
}

.version-stamp {
  margin-bottom: 0.7rem;
}

@media (max-width: 760px) {
  :root {
    --layout-page-gutter: 0.875rem;
  }

  .site-nav {
    width: calc(100vw - (2 * var(--layout-page-gutter)));
    max-width: none;
  }

  .page-shell {
    margin-top: 1.35rem;
  }

  .document-masthead .document-title {
    font-size: 2rem;
    max-width: none;
    text-wrap: pretty;
  }

  .document-date {
    margin-top: 1rem;
    font-size: 0.98rem;
  }

  .page-header h1,
  .hero h1 {
    font-size: 2rem;
  }

  .page-meta {
    flex-direction: column;
    gap: 0.25rem;
  }

  .article-meta-primary {
    gap: 0.75rem;
  }

  .article-authors {
    font-size: 0.96rem;
  }

  .content-body h2,
  .incident-directory h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
  }

  .content-body h3,
  .incident-entry h3 {
    font-size: 1.0625rem;
  }

  .content-body,
  .lead,
  .document-intro,
  .directory-note,
  .lead-block {
    font-size: 0.98rem;
  }

  .content-body {
    line-height: 1.72;
  }

  .document-intro {
    line-height: 1.6;
  }

  .content-body > :where(pre, .table-scroll, .callout, .citation-block) {
    max-width: 100%;
  }

  .table-scroll::before,
  .table-scroll::after {
    width: 1rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .footer-meta > div {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .footer-block-closing {
    margin-top: 1.5rem;
  }
}

/* Reading polish */

.site-header {
  border-bottom: 0;
}

.site-nav {
  border-color: transparent;
  background: hsl(var(--card) / 0.98);
  box-shadow: var(--shadow-overlay);
}

.content-body {
  color: hsl(var(--foreground) / 0.86);
}

.lead,
.document-intro,
.directory-note {
  color: hsl(var(--foreground) / 0.8);
}

.content-body > :where(p, ul, ol, blockquote, pre, hr, .table-scroll, .callout, .citation-block) {
  margin-bottom: 1.15rem;
}

.content-body h2,
.incident-directory h2 {
  margin-top: 3.35rem;
  margin-bottom: 0.85rem;
}

.content-body h3,
.incident-entry h3 {
  margin-top: 2rem;
  margin-bottom: 0.55rem;
}

/* Desktop TOC rail */

.page-aside {
  display: none;
  min-width: 0;
}

.page-aside-inner {
  display: grid;
  gap: 0.35rem;
}

.toc-aside {
  gap: 0.1rem;
}

.toc-aside a {
  padding-left: 0;
}

.toc-aside a.active {
  color: hsl(var(--foreground));
  font-weight: 600;
}

@media (min-width: 1180px) {
  .page-grid,
  .page-grid.no-aside {
    grid-template-columns:
      minmax(0, var(--layout-body-measure))
      minmax(13rem, var(--layout-aside-width));
    gap: clamp(2rem, 4vw, 4rem);
    align-items: start;
  }

  .page-aside {
    display: block;
  }

  .page-aside-inner {
    position: sticky;
    top: calc(var(--layout-anchor-offset) + 0.25rem);
    padding-left: 1rem;
    border-left: 1px solid hsl(var(--foreground) / 0.08);
  }
}

/* Heading permalinks */

.content-body :is(h1, h2, h3, h4, h5, h6) {
  position: relative;
}

.heading-anchor {
  margin-left: 0.45rem;
  color: hsl(var(--foreground) / 0.28);
  font-family: var(--font-ui);
  font-size: 0.82em;
  font-weight: 600;
  text-decoration: none;
  opacity: 0;
  transition:
    opacity var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.content-body :is(h1, h2, h3, h4, h5, h6):hover .heading-anchor,
.content-body :is(h1, h2, h3, h4, h5, h6):focus-within .heading-anchor {
  opacity: 1;
}

.heading-anchor:hover,
.heading-anchor:focus-visible {
  color: hsl(var(--foreground) / 0.72);
  opacity: 1;
}

/* Fewer borders, more surfaces */

.search-input,
.search-pill,
.search-clear {
  border-color: hsl(var(--foreground) / 0.08);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.callout,
.document-overview,
.citation-block {
  border-color: hsl(var(--foreground) / 0.08);
  background: hsl(var(--surface-subtle));
}

/* Tables: quieter borders, stronger hierarchy */

.table-scroll {
  border-color: hsl(var(--foreground) / 0.08);
  background: hsl(var(--surface-raised));
}

.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: hsl(var(--surface-subtle));
  box-shadow: inset 0 -1px 0 hsl(var(--foreground) / 0.08);
}

.table-scroll th,
.table-scroll td {
  border-bottom-color: hsl(var(--foreground) / 0.08);
}

.table-scroll tbody tr:nth-child(even) td {
  background: hsl(var(--surface-subtle) / 0.58);
}

.table-scroll tbody tr:hover td {
  background: hsl(var(--muted) / 0.8);
}

/* Search empty state */

.search-empty {
  max-width: min(100%, 36rem);
  margin: 1rem 0 1.75rem;
  padding: 1rem 1.05rem 1.05rem;
  border: 1px solid hsl(var(--foreground) / 0.08);
  border-radius: var(--radius-lg);
  background: hsl(var(--surface-subtle));
  box-shadow: var(--shadow-soft);
}

.search-empty-title {
  margin: 0 0 0.25rem;
  color: hsl(var(--foreground));
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
}

.search-empty-copy {
  margin: 0;
  color: hsl(var(--foreground) / 0.7);
  font-family: var(--font-ui);
  font-size: 0.94rem;
  line-height: 1.55;
}


/* -----------------------------------------------------------------------------
   Reference shell refactor
   Serious, durable, less decorative, stronger hierarchy
----------------------------------------------------------------------------- */

:root {
  --surface-raised: var(--card);
  --surface-subtle: var(--surface-inset);
  --ref-shell-max: 90rem;
  --ref-measure: 46rem;
  --ref-rail-width: 15rem;
  --ref-control-radius: 0.375rem;
  --ref-panel-radius: 0.625rem;
  --ref-control-height: 2.375rem;
  --ref-control-height-sm: 2.125rem;
}

body {
  background: hsl(var(--background));
}

:focus-visible {
  outline: 2px solid hsl(var(--foreground) / 0.22);
  outline-offset: 3px;
}

.skip-link {
  border-radius: var(--ref-control-radius);
}

.site-header {
  backdrop-filter: saturate(120%) blur(8px);
  background: hsl(var(--background) / 0.97);
  border-bottom: 0;
}

.site-header-inner,
.page-shell,
.site-footer {
  width: min(calc(100% - (2 * var(--layout-page-gutter))), var(--ref-shell-max));
}

.site-header-inner {
  gap: 1.5rem;
  padding: 0.875rem 0;
}

.brand a {
  color: hsl(var(--foreground) / 0.9);
}

.brand-title {
  font-size: clamp(1rem, 0.84rem + 0.68vw, 1.18rem);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.nav-toggle {
  width: 2rem;
  height: 2rem;
  border-radius: var(--ref-control-radius);
}

.site-nav {
  border-radius: var(--ref-panel-radius);
}

.menu-links a,
.toc a,
.site-nav a {
  border-radius: var(--ref-control-radius);
}

.page-shell {
  margin-top: 2rem;
  margin-bottom: 4.5rem;
}

.page-header,
.hero {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom-color: hsl(var(--foreground) / 0.08);
}

.page-header--longform {
  gap: 1.25rem;
}

.page-header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.document-header-grid {
  display: grid;
  gap: 1.25rem 2rem;
}

.document-header-main {
  min-width: 0;
}

.document-header-support {
  display: grid;
  gap: 0.875rem;
  align-content: start;
}

.page-header h1,
.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.25rem, 1.7rem + 2vw, 3.25rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.page-meta {
  gap: 0.35rem 1rem;
}

.page-meta dt,
.footer-label,
.footer-meta dt,
.document-overview-label,
.menu-heading {
  color: hsl(var(--foreground) / 0.48);
}

.page-meta dd {
  color: hsl(var(--foreground) / 0.72);
}

.lead-block {
  max-width: 42rem;
}

.lead,
.document-intro,
.directory-note {
  color: hsl(var(--foreground) / 0.76);
}

.lead {
  font-size: clamp(1.05rem, 0.98rem + 0.2vw, 1.2rem);
  line-height: 1.68;
}

.article-meta-card,
.callout,
.document-overview,
.citation-block,
.search-empty {
  border-color: hsl(var(--foreground) / 0.08);
  border-radius: var(--ref-panel-radius);
  background: hsl(var(--surface-subtle));
  box-shadow: none;
}

.article-meta-card {
  max-width: 100%;
  margin: 0;
  padding: 0.9rem 1rem 1rem;
}

.article-meta-primary {
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.article-authors {
  font-size: 0.96rem;
  font-weight: 600;
}

.article-meta-actions {
  gap: 0.5rem;
}

.meta-chip,
.button,
.button-like,
.tag,
.search-pill,
.search-clear {
  min-height: var(--ref-control-height-sm);
  padding: 0.375rem 0.75rem;
  border-radius: var(--ref-control-radius);
  border-color: hsl(var(--foreground) / 0.1);
  background: hsl(var(--background));
  color: hsl(var(--foreground) / 0.82);
  font-size: 0.875rem;
  font-weight: 550;
  box-shadow: none;
}

.meta-chip:hover,
.button:hover,
.button-like:hover,
.tag:hover,
.search-clear:hover {
  background: hsl(var(--muted));
}

.button,
.button-like {
  transition:
    background var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

.button:active,
.button-like:active {
  transform: translateY(1px);
}

.button.primary {
  background: hsl(var(--foreground));
  border-color: hsl(var(--foreground));
  color: hsl(var(--background));
}

.meta-action {
  min-height: var(--ref-control-height);
  padding: 0.4rem 0.75rem;
  font-size: 0.84rem;
}

.meta-action--subtle {
  min-height: auto;
  padding-inline: 0;
  border-color: transparent;
  background: transparent;
  color: hsl(var(--foreground) / 0.68);
}

.meta-action--subtle:hover {
  background: transparent;
  color: hsl(var(--foreground));
  text-decoration: underline;
  text-decoration-color: hsl(var(--foreground) / 0.3);
}

.document-summary {
  margin: 0;
}

.copy-status {
  margin-top: 0.6rem;
  color: hsl(var(--foreground) / 0.56);
  font-size: 0.8rem;
}

.copy-status:empty {
  display: none;
}

.content-card {
  padding: 0;
}

.content-body {
  max-width: min(100%, var(--ref-measure));
  color: hsl(var(--foreground) / 0.88);
  font-size: 1rem;
  line-height: 1.76;
}

.content-body > :where(p, ul, ol, blockquote, pre, hr, .table-scroll, .callout, .citation-block) {
  margin-bottom: 1.15rem;
}

.content-body > :where(pre, .table-scroll, .callout, .citation-block) {
  max-width: min(100%, 54rem);
}

.content-body h2,
.incident-directory h2 {
  font-size: 1.7rem;
  line-height: 1.08;
  margin-top: 3.5rem;
  margin-bottom: 0.8rem;
}

.content-body h3,
.incident-entry h3 {
  font-size: 1.18rem;
  line-height: 1.24;
  margin-top: 2rem;
  margin-bottom: 0.55rem;
}

.content-body h4,
.content-body h5,
.content-body h6 {
  margin-top: 1.6rem;
}

.content-body blockquote {
  padding-left: 1.1rem;
  border-left-color: hsl(var(--foreground) / 0.14);
  color: hsl(var(--foreground) / 0.74);
}

.table-scroll {
  border-radius: var(--ref-panel-radius);
  border-color: hsl(var(--foreground) / 0.08);
  background: hsl(var(--surface-raised));
  box-shadow: none;
}

.table-scroll thead th {
  background: hsl(var(--surface-subtle));
  box-shadow: inset 0 -1px 0 hsl(var(--foreground) / 0.08);
}

.table-scroll th,
.table-scroll td {
  border-bottom-color: hsl(var(--foreground) / 0.08);
}

.table-scroll tbody tr:nth-child(even) td {
  background: hsl(var(--surface-subtle) / 0.58);
}

.table-scroll tbody tr:hover td {
  background: hsl(var(--muted) / 0.82);
}

/* --------------------------------------------------------------------------
   Table readability fix
   Let tables scroll before words disintegrate
--------------------------------------------------------------------------- */

.table-scroll table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.table-scroll th,
.table-scroll td {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: auto;
}

/* Generic longform data tables need a sensible floor */
.table-scroll .table-data {
  min-width: 52rem;
}

/* Figure 1 / study architecture table */
.table-data[data-col-map="layer,unit,question,artifact"] {
  min-width: 60rem;
}

.table-data[data-col-map="layer,unit,question,artifact"] :is(th, td):first-child {
  width: 10rem;
}

.table-data[data-col-map="layer,unit,question,artifact"] :is(th, td):nth-child(2) {
  width: 14rem;
}

.table-data[data-col-map="layer,unit,question,artifact"] :is(th, td):nth-child(3) {
  width: 16rem;
}

.table-data[data-col-map="layer,unit,question,artifact"] :is(th, td):nth-child(4) {
  width: 16rem;
}

.search-input {
  min-height: 2.875rem;
  border-radius: var(--ref-control-radius);
  border-color: hsl(var(--foreground) / 0.1);
  background: hsl(var(--background));
  box-shadow: none;
}

.search-meta {
  gap: 0.5rem 0.75rem;
}

.incident-entry {
  margin: 1.5rem 0 1.75rem;
  padding-top: 1.35rem;
  border-top-color: hsl(var(--foreground) / 0.08);
}

.page-grid,
.page-grid.no-aside {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.page-aside {
  display: none;
  min-width: 0;
}

.page-aside-label {
  margin: 0;
  color: hsl(var(--foreground) / 0.48);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.page-aside-inner {
  display: grid;
  gap: 0.625rem;
}

.toc-aside {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  max-height: calc(100vh - var(--layout-anchor-offset) - 2rem);
  overflow: auto;
  padding-left: 0;
  border-left: 0;
}

.toc-aside a {
  padding: 0.3rem 0;
  margin-left: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: hsl(var(--foreground) / 0.56);
  font-size: 0.875rem;
}

.toc-aside a:hover {
  background: transparent;
  color: hsl(var(--foreground));
}

.toc-aside a.active {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.toc-aside .level-3 {
  padding-left: 1.4rem;
  font-size: 0.82rem;
}

.toc-aside .level-4 {
  padding-left: 2rem;
  font-size: 0.78rem;
}

.heading-anchor {
  margin-left: 0.35rem;
  color: hsl(var(--foreground) / 0.24);
}

.site-footer {
  color: hsl(var(--foreground) / 0.74);
}

.footer-card {
  padding-top: 1.75rem;
  border-top-color: hsl(var(--foreground) / 0.08);
}

.footer-supporting {
  color: hsl(var(--foreground) / 0.6);
}

@media (min-width: 980px) {
  .document-header-grid {
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
    align-items: start;
  }
}

@media (min-width: 1040px) {
  .site-header-inner {
    align-items: baseline;
  }

  .nav-toggle {
    display: none;
  }

  .site-nav {
    position: static;
    display: block;
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .site-header.open .site-nav {
    display: block;
  }

  .menu-links-section .menu-heading {
    display: none;
  }

  .menu-section + .menu-section {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .menu-links {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.125rem;
  }

  .menu-links a {
    padding: 0.5rem 0.75rem;
    border: 0;
    background: transparent;
    color: hsl(var(--foreground) / 0.62);
    font-size: 0.9rem;
  }

  .menu-links a:hover {
    background: hsl(var(--foreground) / 0.04);
    color: hsl(var(--foreground));
  }

  .menu-links a.active,
  .menu-links a[aria-current="page"] {
    background: transparent;
    color: hsl(var(--foreground));
    box-shadow: none;
  }

  .menu-toc-section {
    display: none !important;
  }

  body[data-nav-mode="overlay"] .site-header-inner {
    align-items: center;
  }

  body[data-nav-mode="overlay"] .nav-toggle {
    display: inline-flex;
  }

  body[data-nav-mode="overlay"] .site-nav {
    position: absolute;
    right: 0;
    top: calc(100% + 0.55rem);
    display: none;
    width: min(var(--layout-menu-measure), calc(100vw - (2 * var(--layout-page-gutter))));
    padding: 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--ref-panel-radius);
    background: hsl(var(--card));
    box-shadow: var(--shadow-overlay);
  }

  body[data-nav-mode="overlay"] .site-header.open .site-nav {
    display: block;
  }

  body[data-nav-mode="overlay"] .menu-links-section .menu-heading {
    display: block;
  }

  body[data-nav-mode="overlay"] .menu-section + .menu-section {
    margin-top: 0.95rem;
    padding-top: 0.95rem;
    border-top: 1px solid hsl(var(--border));
  }

  body[data-nav-mode="overlay"] .menu-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
  }

  body[data-nav-mode="overlay"] .menu-links a {
    padding: 0.5rem 0.65rem;
    border: 1px solid transparent;
    background: transparent;
    color: hsl(var(--foreground) / 0.78);
    font-size: 0.95rem;
  }

  body[data-nav-mode="overlay"] .menu-links a:hover,
  body[data-nav-mode="overlay"] .menu-links a.active,
  body[data-nav-mode="overlay"] .menu-links a[aria-current="page"] {
    background: hsl(var(--muted));
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
    box-shadow: none;
  }

  body[data-nav-mode="overlay"] .menu-toc-section {
    display: block !important;
  }
}

@media (min-width: 1180px) {
  .page-grid,
  .page-grid.no-aside {
    grid-template-columns: minmax(0, var(--ref-measure)) minmax(14rem, var(--ref-rail-width));
    gap: clamp(3rem, 5vw, 5rem);
    align-items: start;
  }

  .page-aside {
    display: block;
  }

  .page-aside-inner {
    position: sticky;
    top: calc(var(--layout-anchor-offset) + 0.5rem);
  }
}

@media (max-width: 760px) {
  .page-shell {
    margin-top: 1.35rem;
    margin-bottom: 4rem;
  }

  .page-header h1,
  .hero h1 {
    font-size: 2rem;
  }

  .page-header-top {
    align-items: start;
  }

  .page-meta {
    flex-direction: column;
    gap: 0.25rem;
  }

  .content-body {
    font-size: 0.98rem;
    line-height: 1.72;
  }

  .content-body h2,
  .incident-directory h2 {
    font-size: 1.45rem;
    margin-top: 2.75rem;
  }

  .content-body h3,
  .incident-entry h3 {
    font-size: 1.0625rem;
  }

  .document-header-support {
    gap: 0.75rem;
  }
}

/* Home-page action strip + switchable overview/citation panel */

.article-author-line {
  margin: -0.15rem 0 0;
  color: hsl(var(--foreground) / 0.56);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.4;
}

.paper-actions-stack {
  --paper-actions-padding: 0.5rem;
  --paper-action-min-height: 2.2rem;
  --paper-action-padding-block: 0.3rem;
  --paper-action-padding-inline: 0.72rem;
  display: grid;
  gap: 0;
  width: min(100%, 46rem);
}

.paper-actions-card {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.5rem;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--paper-actions-padding);
  border: 1px solid hsl(var(--foreground) / 0.08);
  border-radius: var(--ref-panel-radius);
  background: hsl(var(--surface-subtle));
}

.paper-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--paper-action-min-height);
  padding: var(--paper-action-padding-block) var(--paper-action-padding-inline);
  border: 1px solid transparent;
  border-radius: var(--ref-control-radius);
  background: transparent;
  color: hsl(var(--foreground) / 0.76);
  font-family: var(--font-ui);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

.paper-action:hover {
  background: hsl(var(--background));
  border-color: hsl(var(--foreground) / 0.08);
  color: hsl(var(--foreground));
  text-decoration: none;
}

.paper-action:active {
  transform: translateY(1px);
}

.paper-action.is-active {
  background: hsl(var(--background));
  border-color: hsl(var(--foreground) / 0.08);
  color: hsl(var(--foreground));
}

.paper-action--primary {
  background: hsl(var(--foreground) / 0.9);
  border-color: hsl(var(--foreground) / 0.1);
  color: hsl(var(--background));
}

.paper-action--primary:hover {
  background: hsl(var(--foreground) / 0.94);
  border-color: hsl(var(--foreground) / 0.12);
  color: hsl(var(--background));
}

.paper-action-icon {
  width: 1rem;
  height: 1rem;
  flex: none;
  opacity: 0.58;
}

.paper-action:hover .paper-action-icon,
.paper-action.is-active .paper-action-icon,
.paper-action--primary .paper-action-icon {
  opacity: 0.8;
}

.paper-actions-stack.has-open-panel .paper-actions-card {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.document-panel-shell {
  width: 100%;
  max-width: none;
  margin: -1px 0 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.page-header--home {
  margin-bottom: 1.25rem;
  padding-bottom: 0;
  border-bottom: 0;
}

.document-panel[hidden] {
  display: none !important;
}

.document-panel-citation {
  margin: 0;
  max-width: 42rem;
  color: hsl(var(--foreground) / 0.78);
  font-size: 0.95rem;
  line-height: 1.62;
}

.document-panel-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.document-panel-actions .meta-action {
  min-height: var(--ref-control-height-sm);
}

@media (max-width: 760px) {
  .article-author-line {
    font-size: 0.92rem;
  }

  .paper-actions-card {
    width: 100%;
  }

  .paper-action {
    flex: 1 1 calc(50% - 0.65rem);
  }
}

/* --------------------------------------------------------------------------
   Match preview warmth + lighter editorial feel
--------------------------------------------------------------------------- */

body {
  background:
    radial-gradient(980px 420px at 0% 0%, hsl(var(--foreground) / 0.018), transparent 56%),
    linear-gradient(180deg, hsl(var(--background)) 0%, hsl(var(--surface-subtle)) 100%);
  color: hsl(var(--foreground) / 0.96);
}

.site-header {
  background: hsl(var(--background) / 0.96);
}

.brand a {
  color: hsl(var(--foreground) / 0.92);
}

.brand-title {
  font-size: clamp(1rem, 0.84rem + 0.68vw, 1.16rem);
  font-weight: 580;
  letter-spacing: -0.025em;
}

.page-header h1,
.hero h1 {
  color: hsl(var(--foreground) / 0.94);
  font-size: clamp(2.15rem, 1.65rem + 1.9vw, 3.05rem);
  line-height: 0.96;
  font-weight: 650;
  letter-spacing: -0.045em;
}

.article-author-line {
  color: hsl(var(--foreground) / 0.52);
  font-weight: 400;
}

.lead,
.document-intro,
.directory-note {
  color: hsl(var(--foreground) / 0.74);
}

.paper-actions-card,
.callout,
.document-overview,
.citation-block,
.document-panel-shell {
  background: hsl(var(--surface-raised));
}

.paper-action {
  color: hsl(var(--foreground) / 0.7);
}

.paper-action--primary {
  background: hsl(227 28% 14%);
  border-color: transparent;
  color: hsl(var(--surface-raised));
}

.paper-action--primary:hover {
  background: hsl(227 28% 12%);
  color: hsl(var(--surface-raised));
}

/* --------------------------------------------------------------------------
   Home header tightening
--------------------------------------------------------------------------- */

.page-header--home {
  margin-top: -0.3rem;
}

.page-header--home .eyebrow {
  color: hsl(var(--foreground) / 0.38);
}

/* --------------------------------------------------------------------------
   Serif heading weight normalization
--------------------------------------------------------------------------- */

.page-header h1,
.hero h1,
.document-masthead .document-title,
.content-body h1:not(.document-title),
.content-body h2,
.content-body h3,
.incident-entry h3 {
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Table overflow indicator removal
--------------------------------------------------------------------------- */

.table-scroll {
  scrollbar-gutter: auto;
}

.table-scroll::before,
.table-scroll::after {
  display: none;
}

.breadcrumbs {
  margin: 0 0 1rem;
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: hsl(var(--foreground) / 0.56);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  line-height: 1.4;
}

.breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumb-list li + li::before {
  content: "/";
  color: hsl(var(--foreground) / 0.34);
}

.breadcrumb-list a {
  color: inherit;
  text-decoration-color: hsl(var(--foreground) / 0.22);
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.route-grid--stats {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.route-card,
.mini-card {
  padding: 1rem 1.05rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  background: hsl(var(--card));
  box-shadow: var(--shadow-soft);
}

.route-card h3,
.mini-card p {
  margin: 0;
}

.route-card h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.15;
}

.route-card p {
  margin: 0.55rem 0 0;
  color: hsl(var(--foreground) / 0.72);
}

.mini-card-label {
  color: hsl(var(--foreground) / 0.46);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.mini-card-value {
  margin-top: 0.2rem;
  color: hsl(var(--foreground));
  font-family: var(--font-serif);
  font-size: 1.55rem;
  line-height: 1.05;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
}

.tools-row--actions {
  margin-top: 0.35rem;
}

.page-header--reference {
  display: grid;
  gap: 0.65rem;
}

.page-header--reference .lead-block {
  max-width: 38rem;
}

.page--reference .content-body {
  max-width: min(100%, 44rem);
}

.page--reference .content-body h2 {
  margin: 2.2rem 0 0.55rem;
  color: hsl(var(--foreground) / 0.58);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  line-height: 1.3;
  text-transform: uppercase;
}

.page--reference .content-body h3 {
  margin: 1.35rem 0 0.35rem;
  font-size: 1.05rem;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

.fact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin: 0.2rem 0 0;
  padding: 0;
}

.fact-strip > div {
  display: inline-flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 8.25rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background: hsl(var(--surface-inset));
}

.fact-strip dt {
  color: hsl(var(--foreground) / 0.46);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.fact-strip dd {
  margin: 0;
  color: hsl(var(--foreground));
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.45;
}

.inline-link-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.8rem 0 0;
  color: hsl(var(--foreground) / 0.72);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.45;
}

.inline-link-label {
  color: hsl(var(--foreground) / 0.46);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.inline-link-divider {
  color: hsl(var(--foreground) / 0.28);
}

.menu-links--utility a {
  color: hsl(var(--foreground) / 0.62);
}

@media (max-width: 760px) {
  .page--reference .content-body h2 {
    margin-top: 2rem;
  }

  .fact-strip {
    gap: 0.5rem;
  }

  .fact-strip > div {
    min-width: calc(50% - 0.5rem);
  }
}
