/* Stable Tape Authority Documents: Clinical Courthouse Stylesheet
   Standalone institutional stylesheet for /standards/st-01 and /governance/due-diligence.
   Strict black and white paper/ink tokens matching Stable Tape V2, with Assay Blue (#1d2a5a / #a9b8f0)
   reserved solely for institutional authority marks and statutory notice accents.
   Includes full @media print pagination rules for citation grade A4 and US Letter PDF export. */

/* Size matched fallbacks matching v2/v2.css so text renders with minimal shift before webfonts load. */
@font-face {
  font-family: "Plex Sans fallback";
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo");
  font-weight: 100 700;
  font-style: normal;
  size-adjust: 101.3%;
  ascent-override: 101.2%;
  descent-override: 27.1%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Fraunces fallback";
  src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif"), local("Tinos");
  font-weight: 100 900;
  font-style: normal;
  size-adjust: 114%;
  ascent-override: 85.8%;
  descent-override: 22.4%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "PlexMono fallback";
  src: local("Courier New"), local("CourierNewPSMT"), local("Liberation Mono"), local("Cousine");
  font-weight: 400 500;
  size-adjust: 100%;
  ascent-override: 102.5%;
  descent-override: 27.5%;
  line-gap-override: 0%;
}

/* Stable Tape local WOFF2 faces: works both when served from site root (/v2/fonts/) and directly from standalone-pages/authority/. */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/v2/fonts/sans-latin.woff2") format("woff2"),
       url("../../v2/fonts/sans-latin.woff2") format("woff2"),
       url("/v2/fonts/IBMPlexSans-VF.woff2") format("woff2"),
       url("../../v2/fonts/IBMPlexSans-VF.woff2") format("woff2");
  font-weight: 100 700;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("/v2/fonts/serif-latin.woff2") format("woff2"),
       url("../../v2/fonts/serif-latin.woff2") format("woff2"),
       url("/v2/fonts/Fraunces-VF.woff2") format("woff2"),
       url("../../v2/fonts/Fraunces-VF.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PlexMono";
  src: url("/v2/fonts/mono-400-latin.woff2") format("woff2"),
       url("../../v2/fonts/mono-400-latin.woff2") format("woff2"),
       url("/v2/fonts/IBMPlexMono-Regular.woff2") format("woff2"),
       url("../../v2/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "PlexMono";
  src: url("/v2/fonts/mono-500-latin.woff2") format("woff2"),
       url("../../v2/fonts/mono-500-latin.woff2") format("woff2"),
       url("/v2/fonts/IBMPlexMono-Medium.woff2") format("woff2"),
       url("../../v2/fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #555555;
  --rule: #d6d6d6;
  --rule-strong: #111111;
  --soft: #f4f4f4;
  --raised: #fafafa;
  --control: #767676;
  --assay-ink: #1d2a5a;
  --sans: "IBM Plex Sans", "Plex Sans fallback", Arial, sans-serif;
  --serif: "Fraunces", "Fraunces fallback", Georgia, serif;
  --mono: "PlexMono", "PlexMono fallback", monospace;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b0b0b;
  --ink: #ededed;
  --muted: #a3a3a3;
  --rule: #2b2b2b;
  --rule-strong: #ededed;
  --soft: #161616;
  --raised: #121212;
  --control: #828282;
  --assay-ink: #a9b8f0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0b0b0b;
    --ink: #ededed;
    --muted: #a3a3a3;
    --rule: #2b2b2b;
    --rule-strong: #ededed;
    --soft: #161616;
    --raised: #121212;
    --control: #828282;
    --assay-ink: #a9b8f0;
  }
}

@media (prefers-contrast: more) {
  :root,
  :root[data-theme="light"] {
    --rule: #767676;
    --muted: #333333;
  }
  :root[data-theme="dark"] {
    --rule: #8f8f8f;
    --muted: #d6d6d6;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

@media (min-width: 641px) {
  html {
    scrollbar-gutter: stable;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.62 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

/* Skip link: visually clipped until keyboard focus so it can never bleed on print or narrow viewports. */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  background: var(--ink);
  color: var(--paper);
  font: 500 14px/1 var(--sans);
  text-decoration: none;
}
.skip-link:not(:focus) {
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Typography foundations */
h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-style: normal;
  font-weight: 500;
  color: var(--ink);
  text-wrap: balance;
}

p {
  margin: 0 0 14px;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

code,
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums lining-nums;
}

code {
  font-size: 0.88em;
  overflow-wrap: break-word;
}

.nowrap {
  white-space: nowrap;
}

.tabular {
  font-variant-numeric: tabular-nums lining-nums;
}

/* Courthouse top utility bar */
.authority-masthead {
  border-top: 3px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.authority-masthead-inner {
  width: min(calc(100% - 32px), 1120px);
  margin-inline: auto;
  padding-block: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
}

.authority-brand {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
}

.authority-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.authority-brand-mark {
  flex: none;
  display: block;
  width: 17px;
  height: 24px;
  color: var(--ink);
}

.authority-brand-name {
  font: 550 20px/1 var(--serif);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.authority-brand-sep {
  color: var(--rule);
  font: 400 16px/1 var(--mono);
  user-select: none;
}

.authority-doc-code {
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--assay-ink);
  border: 1px solid var(--assay-ink);
  padding: 4px 8px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .authority-brand-sep {
    display: none;
  }
  .authority-controls {
    width: 100%;
    justify-content: space-between;
  }
  .authority-sibling-link {
    flex: 1 1 100%;
    min-height: 36px;
    padding-inline: 0;
  }
}

.authority-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.authority-sibling-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 4px;
  font: 400 14px/1.2 var(--sans);
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.authority-sibling-link:hover {
  color: var(--ink);
}

.authority-print-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 14px/1 var(--sans);
  cursor: pointer;
}
.authority-print-btn:hover {
  background: var(--soft);
}

.authority-theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.authority-theme-btn:hover {
  border-color: var(--ink);
}
.authority-theme-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}
.authority-theme-btn .icon-sun {
  display: none;
}
:root[data-theme="dark"] .authority-theme-btn .icon-moon {
  display: none;
}
:root[data-theme="dark"] .authority-theme-btn .icon-sun {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .authority-theme-btn .icon-moon {
    display: none;
  }
  :root:not([data-theme="light"]) .authority-theme-btn .icon-sun {
    display: block;
  }
}

/* Main courthouse layout shell */
.authority-page {
  width: min(calc(100% - 32px), 1120px);
  margin-inline: auto;
  padding-block: 36px 72px;
}

/* Title block */
.authority-title-block {
  padding-bottom: 24px;
  border-bottom: 3px double var(--rule-strong);
  margin-bottom: 32px;
}

.authority-kicker {
  margin: 0 0 12px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--assay-ink);
}

.authority-title-block h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 3.8vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 30ch;
}

.authority-lead {
  margin: 0 0 24px;
  max-width: 66ch;
  font: 400 17px/1.55 var(--sans);
  color: var(--muted);
}

/* Document control metadata ledger */
.control-ledger {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
  background: var(--raised);
}

.control-ledger > div {
  padding: 12px 14px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.control-ledger > div:nth-child(4n) {
  border-right: 0;
}

.control-ledger > div:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.control-ledger dt {
  margin: 0 0 4px;
  font: 500 10.5px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.control-ledger dd {
  margin: 0;
  font: 400 13.5px/1.4 var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums lining-nums;
}

@media (max-width: 900px) {
  .control-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .control-ledger > div {
    border-right: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
  }
  .control-ledger > div:nth-child(2n) {
    border-right: 0;
  }
  .control-ledger > div:nth-last-child(-n + 4) {
    border-bottom: 1px solid var(--rule);
  }
  .control-ledger > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 520px) {
  .control-ledger {
    grid-template-columns: 1fr;
  }
  .control-ledger > div {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }
  .control-ledger > div:last-child {
    border-bottom: 0;
  }
}

/* Two column desktop grid: sticky left contents rail + document body */
.authority-body-grid {
  display: block;
}

.authority-toc {
  margin: 0 0 32px;
  border-top: 1px solid var(--rule-strong);
  padding-top: 12px;
}

.authority-toc-label {
  margin: 0 0 8px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.authority-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.authority-toc li {
  border-bottom: 1px solid var(--rule);
}

.authority-toc a {
  display: grid;
  grid-template-columns: 4.15rem minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  min-height: 44px;
  padding: 10px 4px 10px 0;
  font: 400 13.5px/1.35 var(--sans);
  color: var(--muted);
  text-decoration: none;
}

.authority-toc a:hover,
.authority-toc a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

.authority-toc a[aria-current="true"] {
  color: var(--ink);
  font-weight: 600;
  border-left: 2px solid var(--ink);
  padding-left: 8px;
}

.authority-toc .toc-code {
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.04em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.authority-toc a[aria-current="true"] .toc-code {
  color: var(--ink);
}

.authority-content {
  min-width: 0;
  max-width: 820px;
}

@media (min-width: 1024px) {
  .authority-body-grid {
    display: grid;
    grid-template-columns: 244px minmax(0, 1fr);
    column-gap: 52px;
    align-items: start;
  }
  .authority-toc {
    position: sticky;
    top: 24px;
    margin: 0;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
  }
}

/* Statutory notice box (Regulatory Status Notice & CC BY 4.0 Clause) */
.statutory-notice {
  margin: 0 0 32px;
  padding: 20px 24px;
  border: 1px solid var(--rule-strong);
  border-left: 4px solid var(--assay-ink);
  background: var(--raised);
}

.statutory-notice-label {
  margin: 0 0 10px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--assay-ink);
}

.statutory-notice p {
  margin: 0;
  font: 400 15.5px/1.64 var(--sans);
  color: var(--ink);
}

/* Sections */
.doc-section {
  padding-top: 28px;
  margin-top: 32px;
  border-top: 1.5px solid var(--rule-strong);
  scroll-margin-top: 20px;
}

.doc-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 16px;
}

.section-eyebrow {
  margin: 0 0 6px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-section h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.principle-badge {
  display: inline-block;
  padding: 4px 9px;
  border: 1px solid var(--rule-strong);
  font: 500 11px/1.25 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

.doc-section h3 {
  margin: 24px 0 10px;
  font-size: 20px;
  line-height: 1.25;
}

/* Numbered clauses (Courthouse marginalia rhythm) */
.clause {
  display: grid;
  grid-template-columns: 3.9rem minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  margin: 0 0 14px;
  scroll-margin-top: 20px;
}

.clause-num {
  font: 500 12px/1.6 var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  user-select: all;
}

.clause-body {
  min-width: 0;
  max-width: 68ch;
}

.clause-body strong {
  font-weight: 600;
  color: var(--ink);
}

@media (max-width: 520px) {
  .clause {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Bullet and numbered sublists aligned with clause text */
.clause-list {
  margin: 6px 0 18px;
  padding-left: calc(3.9rem + 28px);
  max-width: calc(68ch + 3.9rem + 28px);
}

.clause-list li {
  margin-bottom: 8px;
}

@media (max-width: 520px) {
  .clause-list {
    padding-left: 20px;
  }
}

/* Formal mathematical equation plate (NRIS identity) */
.equation-plate {
  margin: 20px 0 24px;
  padding: 22px 24px;
  border-top: 2px solid var(--rule-strong);
  border-bottom: 2px solid var(--rule-strong);
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  background: var(--raised);
}

.equation-kicker {
  margin: 0 0 12px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--assay-ink);
}

.math-equation {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  background: var(--paper);
  font-variant-numeric: tabular-nums lining-nums;
}

.math-equation-verbal {
  margin: 0 0 12px;
  font: 500 clamp(15px, 1.7vw, 18px)/1.55 var(--serif);
  color: var(--ink);
}

.math-equation-symbolic {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font: 500 14px/1.6 var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.math-equation-symbolic var {
  font-style: normal;
  font-weight: 500;
}

.math-equation-symbolic sub {
  font-size: 0.76em;
  line-height: 0;
}

.math-op {
  padding-inline: 0.18em;
  font-weight: 600;
}

.equation-legend {
  margin: 12px 0 0;
  font: 400 13px/1.55 var(--sans);
  color: var(--muted);
}

/* Schedule blocks for ST 01.0 to ST 01.5 */
.schedule-block {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--rule-strong);
  scroll-margin-top: 20px;
}

.schedule-block:first-of-type {
  margin-top: 16px;
}

.schedule-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.schedule-title-wrap {
  min-width: 0;
}

.schedule-code {
  display: block;
  margin-bottom: 4px;
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--assay-ink);
}

.schedule-head h3 {
  margin: 0;
  font-size: clamp(19px, 2vw, 23px);
  line-height: 1.2;
}

.schedule-effect {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--rule-strong);
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
}

.schedule-effect.is-memorandum {
  border-style: dashed;
  color: var(--muted);
}

/* Clinical tables */
.table-wrap {
  margin: 16px 0 22px;
  overflow-x: auto;
  border-top: 1.5px solid var(--rule-strong);
  border-bottom: 1.5px solid var(--rule-strong);
}

.clinical-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums lining-nums;
}

.clinical-table caption {
  caption-side: top;
  text-align: left;
  padding: 0 0 8px;
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.clinical-table thead th {
  text-align: left;
  vertical-align: bottom;
  padding: 10px 12px 10px 0;
  background: var(--soft);
  border-bottom: 1px solid var(--rule-strong);
  font: 500 11px/1.35 var(--mono);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink);
}

.clinical-table thead th:first-child,
.clinical-table tbody th:first-child,
.clinical-table tbody td:first-child {
  padding-left: 10px;
}

.clinical-table thead th:last-child,
.clinical-table tbody td:last-child {
  padding-right: 10px;
}

.clinical-table tbody th,
.clinical-table tbody td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
}

.clinical-table tbody tr:last-child th,
.clinical-table tbody tr:last-child td {
  border-bottom: 0;
}

.clinical-table tbody th {
  font-weight: 600;
  width: 24%;
}

.clinical-table .col-mono {
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: nowrap;
}

.clinical-table .col-narrow {
  width: 18%;
}

/* Responsive table stacking on small phones so zero horizontal overflow occurs */
@media screen and (max-width: 640px) {
  .table-wrap {
    overflow-x: visible;
  }
  .clinical-table,
  .clinical-table tbody,
  .clinical-table tr,
  .clinical-table th,
  .clinical-table td {
    display: block;
    width: 100%;
  }
  .clinical-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .clinical-table tbody tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }
  .clinical-table tbody tr:last-child {
    border-bottom: 0;
  }
  .clinical-table tbody th,
  .clinical-table tbody td {
    padding: 3px 0 !important;
    border-bottom: 0;
    width: auto;
  }
  .clinical-table tbody th {
    font-size: 15px;
    margin-bottom: 4px;
  }
  .clinical-table .col-mono {
    white-space: normal;
  }
  .clinical-table tbody td[data-label]::before {
    content: attr(data-label) ": ";
    display: inline;
    font: 500 11px/1.4 var(--mono);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

/* Copyable CC BY 4.0 Basis of Presentation Clause Box */
.clause-box {
  margin: 20px 0 24px;
  border: 1.5px solid var(--rule-strong);
  border-left: 4px solid var(--assay-ink);
  background: var(--raised);
}

.clause-box-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rule);
  background: var(--soft);
}

.clause-box-meta {
  min-width: 0;
}

.clause-box-kicker {
  display: block;
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--assay-ink);
}

.clause-box-title {
  margin: 2px 0 0;
  font: 500 17px/1.25 var(--serif);
  color: var(--ink);
}

.copy-control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 500 14px/1 var(--sans);
  cursor: pointer;
}
.copy-button:hover {
  opacity: 0.86;
}

.copy-button.is-outline {
  background: transparent;
  color: var(--ink);
}
.copy-button.is-outline:hover {
  background: var(--soft);
  opacity: 1;
}

.copy-status {
  font: 400 12.5px/1.3 var(--mono);
  color: var(--muted);
  min-height: 1.3em;
}

.clause-box-quote {
  margin: 0;
  padding: 20px 22px;
  font: 400 15.5px/1.68 var(--sans);
  color: var(--ink);
  background: var(--paper);
}

.clause-box-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  font: 400 13px/1.5 var(--sans);
  color: var(--muted);
}

/* Two track callout grid (Due Diligence Section 5) */
.track-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 22px;
}

.track-panel {
  padding: 18px 20px;
  border: 1px solid var(--rule-strong);
  background: var(--raised);
}

.track-panel-kicker {
  margin: 0 0 6px;
  font: 500 11px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--assay-ink);
}

.track-panel h3 {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.22;
}

.track-panel p {
  font-size: 14.5px;
  line-height: 1.55;
  margin-bottom: 10px;
}

.track-panel dl {
  margin: 12px 0 0;
  border-top: 1px solid var(--rule);
}

.track-panel dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 13.5px;
}

.track-panel dl > div:last-child {
  border-bottom: 0;
}

.track-panel dt {
  font: 500 11px/1.5 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.track-panel dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
  .track-grid {
    grid-template-columns: 1fr;
  }
}

/* Citation & Print Colophon Footer */
.citation-block {
  margin-top: 20px;
  padding: 16px 20px;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--raised);
}

.citation-text {
  margin: 0 0 12px;
  font: 400 13.5px/1.55 var(--mono);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.authority-footer {
  width: min(calc(100% - 32px), 1120px);
  margin-inline: auto;
  padding: 20px 0 40px;
  border-top: 2px solid var(--rule-strong);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  font: 400 13px/1.5 var(--mono);
  color: var(--muted);
}

.authority-footer p {
  margin: 0;
}

.print-only-banner {
  display: none;
}

/* ==========================================================================
   CITATION GRADE @media print CSS (A4 and US Letter PDF Export)
   ========================================================================== */
@page {
  margin: 16mm 14mm 18mm 14mm;
  @top-left {
    content: "STABLE TAPE";
    font-family: "PlexMono", "Courier New", monospace;
    font-size: 7.5pt;
    letter-spacing: 0.08em;
    color: #444444;
  }
  @bottom-left {
    content: "stabletape.com · CERN Zenodo DOI 10.5281/zenodo.24425821";
    font-family: "PlexMono", "Courier New", monospace;
    font-size: 7.5pt;
    color: #444444;
  }
  @bottom-right {
    content: "Page " counter(page) " of " counter(pages);
    font-family: "PlexMono", "Courier New", monospace;
    font-size: 7.5pt;
    color: #444444;
  }
}

@page :first {
  @top-left { content: none; }
  @top-right { content: none; }
}

@media print {
  html:root,
  html:root[data-theme="dark"],
  html:root[data-theme="light"],
  html:root:not([data-theme="light"]) {
    color-scheme: light !important;
    --paper: #ffffff !important;
    --ink: #000000 !important;
    --muted: #3d3d3d !important;
    --rule: #bfbfbf !important;
    --rule-strong: #000000 !important;
    --soft: #f2f2f2 !important;
    --raised: #fafafa !important;
    --assay-ink: #1d2a5a !important;
  }

  html,
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9.25pt;
    line-height: 1.46;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .skip-link,
  .authority-controls,
  .authority-toc,
  .copy-control-group,
  .screen-only {
    display: none !important;
  }

  .authority-masthead {
    border-top: 2pt solid #000000;
    border-bottom: 0.75pt solid #000000;
    background: #ffffff !important;
  }

  .authority-masthead-inner,
  .authority-page,
  .authority-footer {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .authority-masthead-inner {
    padding-block: 5pt;
  }

  .authority-brand {
    min-height: 0;
  }

  .authority-page {
    padding-block: 12pt 12pt;
  }

  .authority-title-block {
    padding-bottom: 10pt;
    margin-bottom: 12pt;
    border-bottom: 2pt double #000000;
  }

  .authority-kicker {
    font-size: 7.5pt;
    margin-bottom: 6pt;
  }

  .authority-title-block h1 {
    font-size: 19pt;
    line-height: 1.12;
    max-width: none;
    margin-bottom: 7pt;
  }

  .authority-lead {
    font-size: 9.75pt;
    max-width: none;
    margin-bottom: 10pt;
  }

  .control-ledger {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .control-ledger > div {
    padding: 5pt 6pt;
    border-right: 0.5pt solid #bfbfbf !important;
    border-bottom: 0.5pt solid #bfbfbf !important;
  }
  .control-ledger > div:nth-child(4n) {
    border-right: 0 !important;
  }
  .control-ledger > div:nth-last-child(-n + 4) {
    border-bottom: 0 !important;
  }

  .control-ledger dt {
    font-size: 6.5pt;
  }

  .control-ledger dd {
    font-size: 7.35pt;
  }

  .authority-body-grid {
    display: block !important;
  }

  .authority-content {
    max-width: none !important;
  }

  .statutory-notice,
  .equation-plate,
  .clause-box,
  .citation-block,
  .track-panel,
  .track-grid,
  .section-head,
  .schedule-head {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .statutory-notice {
    padding: 10pt 12pt;
    margin-bottom: 14pt;
    border: 0.75pt solid #000000;
    border-left: 3pt solid #1d2a5a;
  }

  .statutory-notice p {
    font-size: 9.25pt;
    line-height: 1.46;
  }

  .doc-section {
    margin-top: 14pt;
    padding-top: 10pt;
    border-top: 1pt solid #000000;
  }

  .doc-section h2 {
    font-size: 13.5pt;
  }

  .schedule-block {
    margin-top: 12pt;
    padding-top: 9pt;
  }

  .schedule-head {
    margin-bottom: 8pt;
  }

  .schedule-head h3 {
    font-size: 11.5pt;
  }

  h1,
  h2,
  h3,
  h4,
  .section-head,
  .schedule-head,
  .clause-box-head,
  .clinical-table caption,
  .clinical-table thead {
    break-after: avoid;
    page-break-after: avoid;
  }

  p,
  li,
  .clause {
    orphans: 3;
    widows: 3;
  }

  .clause {
    grid-template-columns: 3.1rem minmax(0, 1fr);
    gap: 8pt;
    margin-bottom: 6pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .clause-body {
    max-width: none;
  }

  .clause-list {
    padding-left: 4.2rem;
    max-width: none;
  }

  .equation-plate {
    margin: 9pt 0 12pt;
    padding: 10pt 12pt;
  }

  .math-equation {
    padding: 8pt 10pt;
  }

  .math-equation-verbal {
    font-size: 10.5pt;
    margin-bottom: 6pt;
  }

  .math-equation-symbolic {
    font-size: 8.5pt;
    padding-top: 5pt;
  }

  .equation-legend {
    font-size: 8pt;
    margin-top: 7pt;
  }

  .table-wrap {
    overflow: visible !important;
    margin: 8pt 0 11pt;
    border-top: 1pt solid #000000;
    border-bottom: 1pt solid #000000;
  }

  .clinical-table {
    font-size: 8.25pt;
    line-height: 1.38;
  }

  .clinical-table caption {
    font-size: 7pt;
    padding-bottom: 4pt;
  }

  .clinical-table thead {
    display: table-header-group;
  }

  .clinical-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .clinical-table thead th {
    font-size: 7pt;
    padding: 4.5pt 6pt 4.5pt 0;
  }

  .clinical-table tbody th,
  .clinical-table tbody td {
    padding: 4.5pt 6pt 4.5pt 0;
  }

  .clinical-table .col-mono {
    font-size: 7.75pt;
  }

  .track-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 9pt;
    margin: 9pt 0 11pt;
  }

  .track-panel {
    padding: 9pt 11pt;
  }

  .track-panel h3 {
    font-size: 10.5pt;
  }

  .track-panel p,
  .track-panel dl > div {
    font-size: 8.25pt;
  }

  .clause-box {
    margin: 10pt 0 12pt;
    border: 0.75pt solid #000000;
    border-left: 3pt solid #1d2a5a;
  }

  .clause-box-head {
    padding: 6pt 10pt;
  }

  .clause-box-title {
    font-size: 11pt;
  }

  .clause-box-quote {
    padding: 9pt 11pt;
    font-size: 9pt;
    line-height: 1.48;
  }

  .clause-box-foot {
    padding: 6pt 10pt;
    font-size: 7.75pt;
  }

  .citation-block {
    margin-top: 10pt;
    padding: 9pt 11pt;
  }

  .citation-text {
    margin-bottom: 0;
    font-size: 8pt;
  }

  .print-only-banner {
    display: none;
  }

  .authority-footer {
    margin-top: 12pt !important;
    padding: 8pt 0 0;
    border-top: 1pt solid #000000;
    font-size: 7.75pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  a {
    color: #000000 !important;
    text-decoration: none;
  }
}

@media (forced-colors: active) {
  .authority-print-btn,
  .copy-button,
  .statutory-notice,
  .clause-box,
  .equation-plate {
    border: 1px solid CanvasText;
  }
  :focus-visible {
    outline: 2px solid Highlight;
    outline-offset: 2px;
  }
}
