.ledger {
  overflow: clip;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}
.ledger [hidden] { display: none !important; }
.ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px 30px;
  padding: clamp(16px, 2.4vw, 28px);
  color: #edf5f2;
  background: radial-gradient(ellipse at 100% 0%, #1a3944, transparent 74%), #112c37;
}
.ledger-head .label { color: var(--arc); }
.ledger-head h3 {
  margin: .4rem 0;
  font-size: clamp(29px, 4vw, 47px);
  letter-spacing: -.05em;
}
.ledger-scope { margin-top: .55rem; color: #d1dfea; max-width: 72ch; }
.ledger-downloads { display: flex; align-items: center; flex-wrap: wrap; flex: 0 0 auto; gap: 8px; }
.ledger-downloads a,
.ledger-controls button,
.ledger-pages button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: .45rem .8rem;
  border: 1px solid #709496;
  border-radius: 5px;
  background: #e8f0ef;
  color: var(--ink);
  font: 650 .875rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
}
.ledger-downloads a { background: #143641; color: #d5f7ed; }
.ledger-downloads a:hover { background: #205657; }
.ledger-downloads a:focus-visible { outline-color: #ffca85; }
.ledger-controls button:hover,
.ledger-pages button:not(:disabled):hover { background: #d7ece9; }
.ledger-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: clamp(14px, 2vw, 21px);
  background: #e7efee;
  border-bottom: 1px solid var(--rule);
}
.ledger-controls label { display: grid; gap: 5px; font-weight: 650; font-size: .9rem; }
.ledger-controls :is(input,select) {
  width: 100%;
  min-height: 44px;
  min-width: 0;
  padding: .45rem .55rem;
  border: 1px solid #829c9c;
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: 1rem/1.25 var(--sans);
}
.ledger-readout,.ledger-guide,.ledger-fallback { padding-inline: clamp(14px, 2vw, 21px); color: var(--sub); }
.ledger-readout { margin-block: 13px 5px; color: var(--pine); font: 600 .875rem/1.45 var(--mono); }
.ledger-guide { font-size: .9rem; margin-bottom: 12px; }
.ledger-fallback { margin-block: 15px; }
.ledger-scroll { overflow: auto; border-block: 1px solid var(--rule); }
.ledger-scroll:focus-visible { outline-offset: -3px; }
.ledger table { min-width: 675px; }
.ledger th,.ledger td { padding: .55rem .6rem; overflow-wrap: anywhere; }
.ledger th button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ledger th button:hover { color: #073e42; text-decoration: underline; }
.ledger th button span { font-size: .8rem; }
.ledger-id { font-family: var(--mono); font-weight: 600; }
.ledger tr>:first-child { min-width: 85px; }
.ledger .ledger-evidence { min-width: 210px; max-width: 38ch; color: var(--sub); }
.ledger-evidence a { display: inline-block; margin-left: .45em; font-weight: 650; }
.ledger tr:nth-child(even) td,.ledger tr:nth-child(even) th[scope=row] { background: #f0f5f4; }
.ledger-status-tag {
  display: inline-block;
  border: 1px solid #a4b9b8;
  background: #ebf1f0;
  color: #244e51;
  border-radius: 4px;
  padding: .16rem .4rem;
  font-weight: 650;
}
.ledger-empty { color: var(--sub); }
.ledger-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px clamp(14px, 2vw, 21px);
  font: 600 .875rem/1.3 var(--mono);
}
.ledger-pages button:disabled { opacity: .56; cursor: not-allowed; }
@media (max-width: 1000px) {
  .ledger-head { align-items: flex-start; flex-direction: column; }
  .ledger-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ledger-search { grid-column: 1/-1; }
}
@media (max-width: 375px) {
  .ledger-controls { grid-template-columns: minmax(0,1fr); }
}
.ledger-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .45rem 1rem;
}
.ledger-guide button {
  min-height: 44px;
  padding: .4rem .65rem;
  border: 1px solid #709496;
  border-radius: 5px;
  background: #e8f0ef;
  color: var(--ink);
  font: 650 .875rem/1.2 var(--sans);
  cursor: pointer;
}
.ledger-guide button:not(:disabled):hover { background: #d7ece9; }
.ledger-guide button:disabled { opacity: .56; cursor: not-allowed; }

/* Record links and chapter folios */
.report section { position: relative; isolation: isolate; }
.chapter-watermark {
  position: absolute;
  inset: .01em .07em auto auto;
  z-index: -1;
  color: #185c64;
  opacity: .075;
  font: normal clamp(7rem, 17vw, 15rem)/.88 var(--serif);
  letter-spacing: -.11em;
  user-select: none;
  pointer-events: none;
}
.chapter-body { min-width: 0; }
#public-ledger, .ledger-scroll { scroll-margin-top: 65px; }
.ledger-mobile-sort { display: none !important; }
.ledger-record { cursor: pointer; }
.ledger-record:is(:hover,:focus-within) :is(td,th[scope=row]) { background: #e2f1ed; }
.ledger-title-cell { font-weight: 630; }
.ledger-record-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .2rem;
  min-height: 44px;
  color: #084b51;
  overflow-wrap: anywhere;
  font-weight: 680;
  text-decoration: underline;
}
.ledger-open-hint {
  align-self: flex-start;
  margin: 0;
  color: var(--sub);
  font: 600 .72rem/1.2 var(--mono);
  text-decoration: none;
}
.ledger-record-link:focus-visible { outline-offset: 1px; }
.ledger-source {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .35rem .65rem;
  border: 1px solid #709496;
  border-radius: 5px;
  background: #edf4f2;
  color: #084b51;
  font-size: .9rem;
  font-weight: 650;
  text-decoration: none;
}
.ledger-source { margin-top: 1rem; background: #123641; color: #d5f7ed; }
.ledger-source:hover { background: #205657; color: #fff; }
@media (max-width: 1050px) {
  .ledger table { min-width: 0; table-layout: auto; }
  .ledger .ledger-evidence { min-width: 0; max-width: 31ch; }
}
@media (max-width: 970px) {

  .chapter-watermark { inset: .06em .09em auto auto; font-size: clamp(5.5rem, 20vw, 9rem); }
  .ledger-mobile-sort { display: grid !important; }
  .ledger table,.ledger tbody { display: block; width: 100%; }
  .ledger thead,.ledger-record .ledger-evidence { display: none; }
  .ledger tbody .ledger-record {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr);
    gap: 1px .6rem;
    border-top: 1px solid var(--rule);
    padding: .65rem clamp(14px, 2vw, 21px);
  }
  .ledger tbody .ledger-record:first-child { border-top: 0; }
  .ledger tbody .ledger-record > * {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }
  .ledger .ledger-title-cell { grid-area: 1 / 1 / 2 / 3; }
  .ledger .ledger-id { grid-area: 2 / 1; font-size: .8rem; }
  .ledger .ledger-row-category { grid-area: 3 / 1; color: var(--sub); }
  .ledger .ledger-row-status { grid-area: 2 / 2 / 4 / 3; justify-self: end; align-self: center; }
  .ledger .ledger-status-tag { overflow-wrap: anywhere; }
  .ledger .ledger-evidence { display: none !important; }
  .ledger tr:nth-child(even) td,.ledger tr:nth-child(even) th[scope=row],
  .ledger-record:is(:hover,:focus-within) :is(td,th[scope=row]) { background: transparent; }
  .ledger-record:nth-child(even) { background: #f0f5f4; }
  .ledger-record:is(:hover,:focus-within) { background: #e2f1ed; }
}

/* Ledger category strip */
.ledger-quick-categories { display:flex; flex-wrap:wrap; gap:7px; padding:14px clamp(14px,2vw,21px); border-bottom:1px solid var(--rule); background:#f0f5f4; }
.ledger-quick-categories button { display:inline-flex; align-items:center; gap:7px; min-height:44px; padding:.35rem .65rem; border:1px solid #89a5a4; border-radius:5px; background:#fcfdfb; color:#154b51; font:650 .875rem/1.25 var(--sans); cursor:pointer; }
.ledger-quick-categories button span { border-radius:3px; padding:.08rem .25rem; background:#e0edeb; color:#31575c; font:600 .73rem/1.3 var(--mono); }
.ledger-quick-categories button[aria-pressed="true"],.ledger-quick-categories button:hover { color:#e4f6ef; background:#14575a; border-color:#14575a; }

.ledger-pages-top { border-top:1px solid var(--rule); background:#f4f8f6; }

/* Uniform preview width and more legible evidence labels. */
.ledger .ledger-evidence a { margin:.22rem 0 0; display:table; text-decoration-color:#698e8e; }
.ledger-title-cell { width:28%; }
.ledger-status-measured { border-color:#487d73; color:#164b41; background:#d9efe4; }
.ledger th[aria-sort] { box-shadow:inset 0 -2px #167f78; }
@media(max-width:970px){ .ledger-title-cell { width:auto; } }

.ledger-retry{padding:4px clamp(14px,2vw,21px) 16px}
.ledger-retry button{min-height:44px;border:1px solid #709496;border-radius:5px;background:#edf4f2;color:#084b51;padding:.35rem .65rem;font:650 .9rem var(--sans);cursor:pointer}
.ledger-retry button:hover{background:#d8eee9}

.ledger-card-key{display:none}
@media(max-width:970px){
  .ledger-card-key{display:inline;color:var(--sub);font:650 .74rem var(--sans);margin-right:.3rem}
  .ledger-row-status .ledger-card-key{display:block;margin-bottom:.16rem;text-align:right}
  .ledger-record-link .ledger-open-hint{text-decoration:none}
}
@media(forced-colors:active){.ledger-record-link{text-decoration:underline}.ledger th[aria-sort]{box-shadow:none;border-bottom:2px solid currentColor}.ledger-status-tag{border:1px solid currentColor}}

/* Tie the ledger controls back to the Atlas chapter system. */
.ledger{border-color:#9bb4b5;box-shadow:inset 0 1px #fff}
.ledger-head{border-bottom:1px solid #49636c}
.ledger-pages:focus-within,.ledger-retry:focus-within{background:#e9f2ef}
.ledger-empty{padding-block:1.2rem !important}
@media(max-width:970px){
  .chapter-watermark{opacity:.085}
  .ledger-quick-categories button{min-height:44px}
  .ledger-record-link{font-size:.98rem}
  .ledger-pages{font-size:.78rem}
}
@media(max-width:540px){.ledger-quick-categories{display:none}}
@media print{
  .ledger-quick-categories,.ledger-downloads,.ledger-controls,.ledger-pages,.ledger-guide{display:none!important}
  .ledger-head{background:#fff;color:#112d38}
  .ledger-head .label,.ledger-scope{color:#145e61}
}

.subnav a[aria-current=location]{color:#fff;background:#214451}
.subnav a[aria-current=location]:after{transform:scaleX(1)}

@media(max-width:690px){#public-ledger,.ledger-scroll{scroll-margin-top:105px}}

/* Round 11: compact phone controls and consistent tablet table switching. */
.ledger-controls { grid-template-columns:minmax(0,1.7fr) minmax(0,3fr) auto; }
.ledger-filter-disclosure { min-width:0; }
.ledger-advanced-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.ledger-filter-disclosure > summary { display:none; }
.chapter-watermark { opacity:.105; }
@media(max-width:1070px) {
  .ledger-controls { grid-template-columns:minmax(0,1fr) auto; }
  .ledger-controls .ledger-search { grid-column:1/-1; }
}
@media(max-width:970px) { .ledger-advanced-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:540px) {
  .ledger-controls { grid-template-columns:minmax(0,1fr) auto; }
  .ledger-controls .ledger-search { grid-column:1/-1; }
  .ledger-filter-disclosure { display:block; border:1px solid #8aa8a6; border-radius:5px; background:#f3f8f6; }
  .ledger-filter-disclosure > summary { display:list-item; min-height:44px; padding:.55rem .6rem; color:#164b51; font:650 .875rem/1.5 var(--sans); cursor:pointer; }
  .ledger-advanced-grid { padding:.55rem .6rem; }
  .ledger-controls > button { align-self:start; }
}

@media(max-width:375px) { .ledger-advanced-grid { grid-template-columns:minmax(0,1fr); } }

/* Research paper: soft technical grid, chapter fields, and instrument surfaces. */
:root {
  color-scheme: light dark;
  --ledger-paper: #e8f0f1;
  --ledger-shell: #f2f7f6;
  --ledger-well: #e0eceb;
  --ledger-line: #9bb9bd;
  --ledger-control-line: #66888d;
  --ledger-glint: #f5fffc;
  --ledger-stripe: #e6efef;
  --ledger-hover: #dbece8;
  --ledger-accent: #145e61;
  --ledger-grid: #537a8015;
  --ledger-aura: #c1e2dd;
  --ledger-lilac: #d4d9eb;
  --ledger-folio: #225568;
  --ledger-caution: #eee5d5;
  --ledger-caution-edge: #a7775b;
  --ledger-active: #15595b;
  --ledger-active-text: #ecfffa;
  --ledger-pass: #d7eee2;
  --ledger-pass-text: #145245;
  --ledger-shadow: #12374722;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7f3f1;
    --sub: #b9ccd2;
    --pine: #a9ecdb;
    --rule: #39535c;
    --surface: #172e39;
    --ledger-paper: #0e1e2a;
    --ledger-shell: #172e39;
    --ledger-well: #1e3944;
    --ledger-line: #57757e;
    --ledger-control-line: #7898a0;
    --ledger-glint: #aef5e11e;
    --ledger-stripe: #1b333e;
    --ledger-hover: #254b50;
    --ledger-accent: #a9ecdb;
    --ledger-grid: #98cccb18;
    --ledger-aura: #1c414b;
    --ledger-lilac: #2a324f;
    --ledger-folio: #9adacc;
    --ledger-caution: #342d2c;
    --ledger-caution-edge: #d5a78b;
    --ledger-active: #a9ecdb;
    --ledger-active-text: #102b2c;
    --ledger-pass: #214c42;
    --ledger-pass-text: #b9f2d7;
    --ledger-shadow: #0007;
  }
  .report :focus-visible { outline-color: #ffca85; }
  .skip { background: var(--ledger-shell); }
}
body {
  background-color: var(--ledger-paper);
  background-image:
    linear-gradient(90deg, var(--ledger-grid) 1px, transparent 1px),
    linear-gradient(var(--ledger-grid) 1px, transparent 1px),
    radial-gradient(ellipse at 96% 11%, var(--ledger-lilac), transparent 33rem),
    radial-gradient(ellipse at 0 23%, var(--ledger-aura), transparent 35rem),
    radial-gradient(ellipse at 100% 76%, var(--ledger-aura), transparent 42rem);
  background-size: 32px 32px, 32px 32px, auto, auto, auto;
}
.report section {
  --chapter-aura: var(--ledger-aura);
  border-bottom-color: var(--ledger-line);
}
.report :is(#implementation, #evidence) { --chapter-aura: var(--ledger-lilac); }
.report section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(90deg, var(--ledger-line) 0 1px, transparent 1px calc(100% - 1px), var(--ledger-line) calc(100% - 1px)) right 0 top 0 / 8rem .34rem no-repeat,
    repeating-linear-gradient(90deg, var(--ledger-line) 0 1px, transparent 1px 8px) right 0 top 0 / 8rem .34rem no-repeat,
    radial-gradient(ellipse at 100% 0, var(--chapter-aura) 0%, transparent min(60%, 34rem)),
    linear-gradient(110deg, transparent 0%, var(--ledger-shell) 49%, transparent 93%);
  opacity: .8;
}
.chapter-watermark {
  color: var(--ledger-folio);
  opacity: .17;
}
.chapter-rail { color: var(--sub); border-color: var(--ledger-line); }
.chapter-rail b { color: var(--ledger-accent); }
.report .scope-note { border-left-color: var(--ledger-caution-edge); background-color: var(--ledger-caution); }
.report .table-wrap,
.ledger {
  border: 1px solid var(--ledger-line);
  background: var(--ledger-shell);
  box-shadow: inset 0 1px var(--ledger-glint), 0 14px 28px -19px var(--ledger-shadow);
}
.report .table-wrap { border-radius: 8px; }
.report thead th { background: var(--ledger-well); color: var(--ink); }
.report .table-wrap tbody tr:nth-child(even) > * { background: var(--ledger-stripe); }
.report .table-wrap td:last-child { color: var(--ledger-accent); font-weight: 700; }
.ledger-head {
  background:
    repeating-linear-gradient(90deg, #baf7e00b 0 1px, transparent 1px 20px),
    radial-gradient(ellipse at 92% 0%, #2a4b59, transparent 72%),
    linear-gradient(115deg, #102837, #143c47);
}
.ledger-controls,
.ledger-quick-categories,
.ledger-pages-top {
  background: linear-gradient(114deg, var(--ledger-well), var(--ledger-shell));
}
.ledger-controls :is(input, select),
.ledger-controls button,
.ledger-pages button,
.ledger-guide button,
.ledger-quick-categories button,
.ledger-filter-disclosure,
.ledger-retry button {
  background: var(--ledger-shell);
  color: var(--ink);
  border-color: var(--ledger-control-line);
}
.ledger-filter-disclosure > summary,
.ledger-record-link,
.ledger th button:hover { color: var(--ledger-accent); }
.ledger-quick-categories button[aria-pressed="true"],
.ledger-quick-categories button:hover {
  background: var(--ledger-active);
  color: var(--ledger-active-text);
  border-color: var(--ledger-active);
}
.ledger-quick-categories button span,
.ledger-status-tag {
  background: var(--ledger-well);
  color: var(--ink);
  border-color: var(--ledger-line);
}
.ledger-status-measured {
  background: var(--ledger-pass);
  color: var(--ledger-pass-text);
}
.ledger tr:nth-child(even) :is(td, th[scope=row]) { background: var(--ledger-stripe); }
.ledger-record:is(:hover, :focus-within) :is(td, th[scope=row]),
.ledger-controls button:hover,
.ledger-pages button:not(:disabled):hover,
.ledger-guide button:not(:disabled):hover,
.ledger-retry button:hover,
.ledger-pages:focus-within,
.ledger-retry:focus-within { background: var(--ledger-hover); }
@media (max-width: 970px) {
  .ledger tr:nth-child(even) :is(td, th[scope=row]),
  .ledger-record:is(:hover, :focus-within) :is(td, th[scope=row]) { background: transparent; }
  .ledger-record:nth-child(even) { background: var(--ledger-stripe); }
  .ledger-record:is(:hover, :focus-within) { background: var(--ledger-hover); }
}
@media (max-width: 690px) {
  body { background-size: 24px 24px, 24px 24px, auto, auto, auto; }
  .report section::before { background-size: 4rem .34rem, 4rem .34rem, auto, auto; }
}
@media (forced-colors: active), print {
  body, .report section::before, .chapter-watermark { background: none; }
  .report section::before, .chapter-watermark { display: none; }
  .report .table-wrap, .ledger { box-shadow: none; }
}
@media print {
  :root {
    color-scheme: light;
    --ink: #112d38;
    --sub: #465d65;
    --pine: #145e61;
    --rule: #c7d4d4;
    --surface: white;
    --ledger-shell: white;
    --ledger-well: #e0eceb;
    --ledger-stripe: #f2f7f6;
    --ledger-line: #9bb9bd;
    --ledger-accent: #145e61;
    --ledger-caution: #eee5d5;
    --ledger-caution-edge: #a7775b;
    --ledger-pass: #d7eee2;
    --ledger-pass-text: #145245;
  }
  .ledger-head { background: none; }
}
