/* report.css — shared style for the INTERNAL pages: explore reports, strategy reports,
   config dumps. Deployed to <root>/report.css; pages link it as ../../report.css.
   Utilitarian on purpose: long, table-heavy documents read on a laptop. Optimized for
   scanning, not for charm — the warm client design lives in the quick-look skill. */

/* ---- tokens ------------------------------------------------------------ */
/* Every colour is defined here in light; the dark block only re-points tokens. */
:root {
  --bg:        #ffffff;
  --fg:        #1b1f24;
  --muted:     #5d666f;
  --faint:     #838d97;
  --rule:      #e2e6ea;   /* hairline row separators */
  --rule-hard: #c3cad1;   /* table outer edge, h2 underline */
  --th-bg:     #f2f4f7;
  --panel:     #f6f7f9;   /* code / pre / yaml tint */
  --link:      #14568f;
  --visited:   #5d3b8c;
  --quote-bar: #c3cad1;
  --row-done:  #f1f2f4;   /* Google 101 check: nothing to do */
  --row-do:    #fff6cc;   /* Google 101 check: something to do */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #14171a;
    --fg:        #dfe3e7;
    --muted:     #9aa3ad;
    --faint:     #77818b;
    --rule:      #272c31;
    --rule-hard: #3b434b;
    --th-bg:     #1e2328;
    --panel:     #1b1f23;
    --link:      #6fb3f2;
    --visited:   #b39ae0;
    --quote-bar: #3b434b;
    --row-done:  #1d2126;
    --row-do:    #3a3418;
  }
}

/* ---- page -------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0 auto;
  padding: 2rem 0 5rem;
  width: min(1100px, 92vw);          /* wider than a prose column: the tables need it */
  background: var(--bg);
  color: var(--fg);
  font: 15.5px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- masthead ---------------------------------------------------------- */
.rpt-head { border-bottom: 2px solid var(--rule-hard); padding-bottom: .9rem; margin-bottom: 2rem; }
.rpt-back {
  display: inline-block; margin-bottom: .8rem;
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.rpt-back:hover { color: var(--link); text-decoration: underline; }
.rpt-title { margin: 0; font-size: 1.75rem; line-height: 1.2; letter-spacing: -.01em; }
.rpt-sub   { margin: .4rem 0 0; font-size: .9rem; color: var(--muted); }

/* ---- headings: landmarks for "## 1. Section" scanning ------------------ */
.rpt-body h1, .rpt-body h2, .rpt-body h3, .rpt-body h4 {
  line-height: 1.25; scroll-margin-top: 1rem;
}
.rpt-body h1 { font-size: 1.5rem;  margin: 2.6rem 0 .8rem; }
.rpt-body h2 {
  font-size: 1.28rem; margin: 2.8rem 0 .9rem;
  padding-bottom: .3rem; border-bottom: 1px solid var(--rule-hard);
}
.rpt-body h3 { font-size: 1.06rem; margin: 2rem 0 .6rem; }
.rpt-body h4 { font-size: .95rem;  margin: 1.5rem 0 .4rem; color: var(--muted);
               text-transform: uppercase; letter-spacing: .04em; }
.rpt-body > :first-child { margin-top: 0; }

/* ---- text -------------------------------------------------------------- */
p, ul, ol { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin: .25rem 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4rem 0; }
a { color: var(--link); text-decoration: underline; text-underline-offset: .13em; }
a:visited { color: var(--visited); }
strong { font-weight: 650; }
em { color: inherit; }

/* ---- tables: the main event -------------------------------------------- */
/* display:block + overflow-x:auto makes each table its own scroll container, so a wide
   table scrolls itself instead of shoving the page body sideways. pandoc emits a bare
   <table> with no wrapper, so the scroller has to be the table. Cost: a narrow table no
   longer stretches to the full column (block width is auto, the inner anonymous table
   shrink-to-fits) — acceptable, and it keeps short tables from looking padded out. */
table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0 1.6rem;
  font-size: .9rem;
}
th, td {
  padding: .5rem .7rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
  white-space: normal;              /* long note cells wrap; only genuinely wide tables scroll */
  min-width: 4.5rem;                /* stops 6-column tables collapsing to one word per line */
}
thead th {
  background: var(--th-bg);
  border-bottom: 1px solid var(--rule-hard);
  font-weight: 650;
  white-space: nowrap;              /* headers are short; keep them on one line */
  position: sticky; top: 0;
}
tbody tr:last-child td { border-bottom: 0; }
tr.state-done td { background: var(--row-done); }
tr.state-do td   { background: var(--row-do); }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort="asc"]::after  { content: " \25B2"; color: var(--faint); }
th[data-sort="desc"]::after { content: " \25BC"; color: var(--faint); }
table code { font-size: .95em; }

/* ---- code, pre, quotes ------------------------------------------------- */
code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code {
  background: var(--panel); border: 1px solid var(--rule);
  border-radius: 3px; padding: .05em .3em; font-size: .875em;
}
pre {
  background: var(--panel); border: 1px solid var(--rule); border-radius: 4px;
  padding: .9rem 1rem; overflow-x: auto; font-size: .85rem; line-height: 1.5;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
pre.yaml {
  white-space: pre-wrap;            /* the record's bytes are untouched; wrapping is display only */
  overflow-wrap: anywhere;          /* values carry 90-char paths and ids with no break points */
  /* a wrapped continuation line starts at column 0, so it can read like a new key: accepted */
  line-height: 1.6; tab-size: 2;
}
blockquote {
  margin: 1.2rem 0; padding: .1rem 0 .1rem 1rem;
  border-left: 3px solid var(--quote-bar); color: var(--muted);
}

/* ---- print ------------------------------------------------------------- */
@media print {
  :root { --bg: #fff; --fg: #000; --muted: #333; --rule: #bbb; --rule-hard: #777;
          --th-bg: #eee; --panel: #f2f2f2; --link: #000; --visited: #000; --quote-bar: #999; }
  body { width: auto; padding: 0; font-size: 10.5pt; }
  .rpt-back { display: none; }
  /* scroll containers don't paginate — let tables lay out flat and keep rows intact */
  table { display: table; width: 100%; overflow: visible; page-break-inside: avoid; }
  thead th { position: static; }
  tr, blockquote, pre { page-break-inside: avoid; }
  h1, h2, h3, h4 { page-break-after: avoid; }
  a { text-decoration: none; }
}
