:root {
  --ink: #17212b;
  --muted: #53606c;
  --line: #ccd3d8;
  --light-line: #e5e9ec;
  --paper: #ffffff;
  --page: #edf0f2;
  --navy: #173b57;
  --teal: #1d6f70;
  --teal-soft: #e9f3f1;
  --red: #9c382f;
  --red-soft: #f8ecea;
  --amber: #825f16;
  --amber-soft: #f8f2e4;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.68;
}
a { color: var(--navy); text-underline-offset: 0.18em; }
a:hover { color: var(--teal); }
code { font-family: var(--mono); font-size: 0.88em; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}
.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1180px, calc(100% - 40px));
  min-height: 58px;
  margin: 0 auto;
}
.wordmark {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
}
nav { display: flex; gap: 24px; }
nav a { color: #34414c; font-size: 13px; font-weight: 600; text-decoration: none; }
.text-button {
  justify-self: end;
  padding: 5px 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: 600 13px var(--sans);
}

.paper {
  width: min(1120px, calc(100% - 40px));
  margin: 38px auto 80px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.report-header { padding: 74px 86px 56px; border-bottom: 1px solid var(--line); }
.report-kind,
.section-label {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1, h2, h3 { color: #142330; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.025em; }
h1 { max-width: 850px; margin: 0; font-size: clamp(42px, 6vw, 68px); line-height: 1.08; }
.subtitle { max-width: 830px; margin: 24px 0 0; color: var(--muted); font-family: var(--serif); font-size: 23px; line-height: 1.45; }
.report-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 36px;
  margin: 48px 0 0;
  border-top: 1px solid var(--ink);
}
.report-meta div { display: grid; grid-template-columns: 122px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--light-line); }
.report-meta dt { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.report-meta dd { margin: 0; font-size: 14px; }
.status-note { margin-top: 30px; padding: 18px 20px; border-left: 3px solid var(--red); background: var(--red-soft); color: #4b302d; font-size: 14px; }

.contents { display: grid; grid-template-columns: 180px 1fr; gap: 28px; padding: 32px 86px; border-bottom: 1px solid var(--line); background: #f8f9fa; }
.contents h2 { margin: 0; font: 700 13px var(--sans); text-transform: uppercase; }
.contents ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 36px; margin: 0; padding-left: 22px; }
.contents a { font-size: 14px; }

.section { padding: 62px 86px; border-bottom: 1px solid var(--line); scroll-margin-top: 72px; }
.section h2 { max-width: 820px; margin: 0 0 26px; font-size: clamp(32px, 4.2vw, 46px); line-height: 1.18; }
.section h3 { margin: 42px 0 12px; font-size: 20px; line-height: 1.35; }
.section p, .section ul, .section ol:not(.future-list):not(.conclusions-list):not(.method-sequence) { max-width: 820px; }
.section p { margin: 0 0 18px; }
.section .lead { max-width: 900px; color: #34424e; font-family: var(--serif); font-size: 21px; line-height: 1.55; }
.abstract { background: #fcfdfd; }
.abstract > p { font-family: var(--serif); font-size: 18px; line-height: 1.7; }
.bottom-line { max-width: 820px; margin-top: 30px; padding: 24px 28px; border: 1px solid #9bb8b5; background: var(--teal-soft); }
.bottom-line h3 { margin: 0 0 8px; color: var(--teal); }
.bottom-line p { margin: 0; }

.table-wrap { max-width: 100%; margin: 24px 0 14px; overflow-x: auto; border-top: 2px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f5f7f8; color: #34414c; font-size: 11px; letter-spacing: 0.045em; text-transform: uppercase; }
tbody tr:nth-child(even) { background: #fbfcfc; }
.narrow-table { max-width: 820px; }
.total-row { background: #edf2f5 !important; }
.caption { max-width: 900px !important; color: var(--muted); font-size: 12px; }
.outcome, .mark { display: inline-block; border-radius: 2px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.outcome { margin-bottom: 5px; padding: 2px 7px; }
.mark { margin-left: 6px; padding: 1px 6px; }
.outcome.pass, .pass-mark { background: var(--teal-soft); color: #125758; }
.outcome.fail, .fail-mark { background: var(--red-soft); color: var(--red); }
.outcome.mixed { background: var(--amber-soft); color: var(--amber); }

.method-sequence, .future-list, .conclusions-list { max-width: 900px; margin: 20px 0 0; padding: 0; list-style: none; counter-reset: item; }
.method-sequence li, .future-list li, .conclusions-list li {
  position: relative;
  padding: 17px 0 17px 54px;
  border-top: 1px solid var(--light-line);
  counter-increment: item;
}
.method-sequence li::before, .future-list li::before, .conclusions-list li::before {
  position: absolute;
  top: 16px;
  left: 0;
  width: 32px;
  color: var(--teal);
  content: counter(item, decimal-leading-zero);
  font: 700 12px var(--mono);
}
.results-section { padding-top: 74px; }

.plot { max-width: 900px; margin: 28px 0 34px; padding: 22px 20px 18px; border: 1px solid var(--line); background: #fbfcfc; }
.plot-legend { display: flex; gap: 22px; justify-content: flex-end; margin-bottom: 20px; color: var(--muted); font-size: 12px; }
.plot-legend span { display: flex; align-items: center; gap: 7px; }
.plot-legend i { width: 18px; height: 7px; }
.completion-key, .bar.completion { background: var(--navy); }
.recovery-key, .bar.recovery { background: var(--teal); }
.plot-row { display: grid; grid-template-columns: 165px 1fr; gap: 18px; align-items: center; margin: 16px 0; }
.plot-label { font-size: 13px; font-weight: 600; }
.bars { display: grid; gap: 5px; background: linear-gradient(to right, transparent 24.8%, #dfe4e7 25%, transparent 25.2%, transparent 49.8%, #dfe4e7 50%, transparent 50.2%, transparent 74.8%, #dfe4e7 75%, transparent 75.2%); }
.bar { display: flex; width: calc(var(--value) * 1%); min-width: 2px; height: 18px; align-items: center; justify-content: flex-end; }
.bar span { min-width: 60px; margin-right: -67px; color: #293743; font: 600 11px var(--mono); }
.plot-axis { display: flex; justify-content: space-between; margin: 7px 0 0 183px; color: #7b858d; font: 10px var(--mono); }

.download-panel { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; max-width: 900px; margin: 28px 0; padding: 26px 28px; border: 1px solid #8da5b5; background: #f2f6f8; }
.download-panel h3 { margin: 0 0 6px; }
.download-panel p { margin: 0; color: var(--muted); font-size: 13px; }
.download-button { display: inline-flex; min-height: 44px; align-items: center; padding: 0 18px; border: 1px solid var(--navy); background: var(--navy); color: white; font-size: 13px; font-weight: 700; text-decoration: none; }
.download-button:hover { background: var(--teal); color: white; }
.download-actions { display: grid; gap: 9px; justify-items: start; }
.instruction-link { font-size: 12px; }
.checksum { margin-top: 14px !important; }
.checksum span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.checksum code { overflow-wrap: anywhere; color: var(--ink); }
.validation-steps { max-width: 900px; margin-top: 34px; }
.validation-steps li { margin-bottom: 8px; }
.artifact-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; max-width: 900px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.artifact-links a { font-size: 13px; }

.references ol { max-width: 900px; }
.references li { margin-bottom: 12px; }
.report-footer { padding: 30px 86px 42px; color: var(--muted); font-size: 12px; }
.report-footer p { margin: 5px 0; }

.audit-report .report-header { padding-top: 58px; padding-bottom: 46px; }
.audit-report h1 { max-width: 920px; font-size: clamp(38px, 5vw, 54px); line-height: 1.1; }
.audit-report .subtitle { font-size: 21px; }
.audit-report .section h2 { font-size: clamp(30px, 3.8vw, 42px); }

@media (max-width: 860px) {
  .topbar-inner { grid-template-columns: 1fr auto; }
  nav { display: none; }
  .report-header, .section { padding: 48px 30px; }
  .contents { grid-template-columns: 1fr; padding: 28px 30px; }
  .contents ol { grid-template-columns: 1fr; }
  .report-meta { grid-template-columns: 1fr; }
  .plot-row { grid-template-columns: 1fr; gap: 7px; }
  .plot-axis { margin-left: 0; }
  .download-panel { grid-template-columns: 1fr; }
  .download-button { width: fit-content; }
  .report-footer { padding: 30px; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .paper { width: 100%; margin: 0; border: 0; }
  .topbar-inner { width: calc(100% - 28px); }
  .report-header, .section { padding: 38px 20px; }
  .contents { padding: 24px 20px; }
  h1 { font-size: 38px; }
  .subtitle { font-size: 19px; }
  .report-meta div { grid-template-columns: 1fr; gap: 3px; }
  .artifact-links { grid-template-columns: 1fr; }
  .plot { padding: 18px 12px; }
  .plot-legend { display: grid; justify-content: start; }
  .method-sequence li, .future-list li, .conclusions-list li { padding-left: 44px; }
}

@media print {
  @page { size: A4; margin: 16mm; }
  body { background: white; color: black; font-size: 10pt; }
  .topbar, .skip-link, .download-button, .text-button { display: none !important; }
  .paper { width: 100%; margin: 0; border: 0; }
  .report-header, .section, .contents, .report-footer { padding: 10mm 0; }
  .report-header { padding-top: 0; }
  h1 { font-size: 30pt; }
  h2 { font-size: 21pt !important; break-after: avoid; }
  h3 { break-after: avoid; }
  p, li, table, .plot, .status-note, .bottom-line { break-inside: avoid; }
  a { color: black; text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8pt; overflow-wrap: anywhere; }
  .download-panel a::after, .artifact-links a::after { content: none; }
}

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