/* ============================================================
   Robot Dataset Audits — stylesheet
   Single stylesheet shared by the ledger index and each report.
   ============================================================ */

:root {
  --ink:          #16191d;
  --ink-soft:     #3d454f;
  --muted:        #6b7480;
  --faint:        #8d949e;
  --rule:         #e2e5e9;
  --rule-strong:  #c9ced5;
  --bg:           #ffffff;
  --bg-alt:       #f7f8fa;
  --bg-code:      #f4f5f7;

  --accent:       #1f3f6e;
  --accent-soft:  #eef2f8;

  --pass:         #1a6b46;
  --pass-bg:      #e8f4ed;
  --warn:         #8a5a00;
  --warn-bg:      #fdf3e0;
  --fail:         #9b2c2c;
  --fail-bg:      #fbeceb;
  --na:           #5d6570;
  --na-bg:        #eef0f2;

  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;

  --measure: 74ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:          #e8eaed;
    --ink-soft:     #c3c8cf;
    --muted:        #949ba5;
    --faint:        #767d87;
    --rule:         #2b3037;
    --rule-strong:  #3a4048;
    --bg:           #121417;
    --bg-alt:       #191c21;
    --bg-code:      #1b1f24;

    --accent:       #8fb2e8;
    --accent-soft:  #1b2430;

    --pass:         #6dc79a;
    --pass-bg:      #16281f;
    --warn:         #e0b263;
    --warn-bg:      #2a2216;
    --fail:         #e88b84;
    --fail-bg:      #2b1a19;
    --na:           #98a0ab;
    --na-bg:        #1e2126;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- layout ---------- */

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 28px 96px;
}

.col {
  max-width: var(--measure);
}

header.site {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 56px;
  padding: 22px 0 18px;
}

header.site .wrap {
  padding-bottom: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.brand span { color: var(--faint); font-weight: 400; }

nav.site a {
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  margin-left: 20px;
  font-family: var(--mono);
}

nav.site a:hover { color: var(--accent); }

/* ---------- type ---------- */

h1 {
  font-size: 34px;
  line-height: 1.22;
  letter-spacing: -0.018em;
  font-weight: 650;
  margin: 0 0 14px;
}

h1.report-title { font-size: 30px; }

h2 {
  font-size: 20px;
  line-height: 1.35;
  letter-spacing: -0.008em;
  font-weight: 640;
  margin: 56px 0 16px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

h2 .num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  font-weight: 400;
  margin-right: 10px;
  letter-spacing: 0;
}

h3 {
  font-size: 16px;
  font-weight: 640;
  margin: 32px 0 10px;
  letter-spacing: -0.004em;
}

p { margin: 0 0 16px; }

p.lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration: none; }

strong { font-weight: 640; }

em { font-style: italic; }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-code);
  padding: 0.12em 0.36em;
  border-radius: 3px;
  border: 1px solid var(--rule);
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 20px;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 13px;
}

pre .c { color: var(--faint); }

/* ---------- meta block ---------- */

.meta {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 6px 20px;
  margin: 0 0 36px;
  background: var(--bg-alt);
}

.meta dl {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 0;
  margin: 0;
}

.meta dt {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 9px 0;
  border-top: 1px solid var(--rule);
}

.meta dd {
  margin: 0;
  padding: 9px 0;
  font-size: 14.5px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
}

.meta dt:first-of-type, .meta dd:first-of-type { border-top: 0; }

/* ---------- disclosure ---------- */

.disclosure {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 14px 18px;
  margin: 0 0 32px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  border-radius: 0 6px 6px 0;
}

.disclosure b { color: var(--ink); }

/* ---------- tables ---------- */

.table-scroll {
  overflow-x: auto;
  margin: 0 0 22px;
  border: 1px solid var(--rule);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  background: var(--bg);
}

thead th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule-strong);
  background: var(--bg-alt);
  white-space: nowrap;
}

tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink-soft);
}

tbody tr:last-child td { border-bottom: 0; }

tbody tr:hover td { background: var(--bg-alt); }

td.num, th.num { text-align: right; font-family: var(--mono); font-size: 13px; }

td strong { color: var(--ink); }

/* ---------- status pills ---------- */

.pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  font-weight: 500;
}

.pill.pass { color: var(--pass); background: var(--pass-bg); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.fail { color: var(--fail); background: var(--fail-bg); }
.pill.na   { color: var(--na);   background: var(--na-bg); }

/* ---------- callouts ---------- */

.note {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 0 0 24px;
  background: var(--bg-alt);
  font-size: 14.5px;
  line-height: 1.6;
}

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

.note .label {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}

.note.correction {
  border-left: 3px solid var(--warn);
  background: var(--warn-bg);
}

.note.correction .label { color: var(--warn); }

/* ---------- verdict banner ---------- */

.verdict {
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  padding: 24px 26px;
  margin: 0 0 40px;
  background: var(--bg-alt);
}

.verdict .top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.verdict h2 {
  border: 0;
  padding: 0;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.verdict p {
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.6;
}

.verdict p:last-child { margin-bottom: 0; }

/* ---------- ledger index ---------- */

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 0 0 28px;
}

.card {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 18px 20px;
  background: var(--bg);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.card p {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.card .kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  display: block;
  margin-bottom: 10px;
}

/* ---------- dataset row link ---------- */

a.row-link {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
}

a.row-link:hover { border-bottom-color: var(--accent); color: var(--accent); }

/* ---------- footer ---------- */

footer.site {
  border-top: 1px solid var(--rule);
  margin-top: 64px;
  padding: 22px 0 0;
  font-size: 13px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--mono);
}

footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--accent); }

/* ---------- misc ---------- */

ul, ol { margin: 0 0 18px; padding-left: 22px; }
li { margin-bottom: 7px; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 40px 0; }

.kv {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink-soft);
}

.small { font-size: 13.5px; color: var(--muted); }

.print-only { display: none; }

@media (max-width: 720px) {
  .wrap { padding: 0 18px 64px; }
  h1 { font-size: 27px; }
  h1.report-title { font-size: 25px; }
  h2 { margin-top: 44px; }
  .meta dl { grid-template-columns: 1fr; }
  .meta dt { border-top: 1px solid var(--rule); padding-bottom: 0; }
  .meta dd { padding-top: 2px; }
  header.site .wrap { padding-bottom: 0; }
}

@media print {
  header.site, footer.site, nav.site { display: none; }
  body { font-size: 11pt; }
  h2 { page-break-after: avoid; }
  .table-scroll { border: 0; }
  table { font-size: 9.5pt; }
  a { color: var(--ink); text-decoration: none; }
}
