/* Dense, document-first styling for a research tool. No framework, no build. */
:root {
  --bg: #fbfaf8;
  --panel: #fff;
  --ink: #1b1b1a;
  --dim: #6a6862;
  --rule: #e2ded6;
  --accent: #7a4a1e;
  --link: #14507a;
  --belief: #2f6d4f;
  --context: #9a7420;
  --excluded: #8a8577;
  --warn-bg: #fdf6e6;
  --warn-rule: #e3cf9a;
  --mark: #ffe9a8;
  --wrap: 1180px;      /* content column; header and footer align to it */
  --gutter: 1.4rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a; --panel: #1d1f23; --ink: #e8e6e1; --dim: #9b978e;
    --rule: #32353b; --accent: #d3a06a; --link: #7fb6df;
    --belief: #6fbf95; --context: #d7ac53; --excluded: #8a8577;
    --warn-bg: #2a2418; --warn-rule: #5b4a25; --mark: #6a5717;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
       font-size: .86em; background: color-mix(in srgb, var(--rule) 45%, transparent);
       padding: .1em .35em; border-radius: 3px; }
mark { background: var(--mark); color: inherit; }
blockquote { margin: .5rem 0; padding: .55rem .9rem; border-left: 3px solid var(--rule);
             background: var(--panel); }

/* ---- chrome ---- */
header.site {
  padding: .7rem 0; border-bottom: 1px solid var(--rule); background: var(--panel);
  position: sticky; top: 0; z-index: 5;
}
/* Shared content column. The rule and background still span the viewport,
   but the brand and the search box line up with the page content. */
.wrap {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
}
header.site .wrap {
  display: flex; flex-wrap: wrap; gap: .6rem 1.1rem; align-items: center;
}
.brand { font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
header nav { display: flex; gap: 1rem; flex-wrap: wrap; }
header nav a { color: var(--dim); font-size: .93rem; }
header nav a:hover { color: var(--link); }
.quick { margin-left: auto; }
.quick input, .filters input, .filters select {
  font: inherit; font-size: .9rem; padding: .34rem .55rem; border: 1px solid var(--rule);
  border-radius: 5px; background: var(--bg); color: var(--ink);
}
.quick input { width: min(320px, 42vw); }
main { max-width: var(--wrap); margin: 0 auto; padding: 1.6rem var(--gutter) 4rem; }
footer.site { border-top: 1px solid var(--rule); padding: 1.2rem 0 2.4rem;
              color: var(--dim); font-size: .86rem; }
footer.site p { max-width: 78ch; margin: 0; }
/* Second footer paragraph: about the site rather than about the records.
   Ruled off so the two are not read as one block of boilerplate. */
footer.site p.site-note {
  margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--rule);
}

h1 { font-size: 1.7rem; margin: .2rem 0 .5rem; letter-spacing: -.015em; }
h2 { font-size: 1.12rem; margin: 1.9rem 0 .6rem; letter-spacing: -.01em; }
.lede { max-width: 78ch; color: var(--ink); }
.note { color: var(--dim); font-size: .88rem; max-width: 76ch; }
.dim { color: var(--dim); }
.empty { color: var(--dim); font-style: italic; }
.why { color: var(--dim); font-size: .78rem; margin-left: .4rem; }

.warn { background: var(--warn-bg); border: 1px solid var(--warn-rule);
        padding: .6rem .85rem; border-radius: 6px; font-size: .9rem; max-width: 88ch; }
.warn-inline { color: var(--context); font-size: .85em; }

/* ---- cards ---- */
.cards { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
         margin: 1.2rem 0 1.8rem; }
.card { display: flex; flex-direction: column; gap: .2rem; padding: .85rem 1rem;
        background: var(--panel); border: 1px solid var(--rule); border-radius: 8px;
        color: var(--ink); }
.card:hover { border-color: var(--link); text-decoration: none; }
.card strong { font-size: 1rem; }
.card span { color: var(--dim); font-size: .85rem; }
.card.accent { border-color: var(--accent); }

.two-col { display: grid; gap: 1.6rem 2.4rem; grid-template-columns: repeat(auto-fit, minmax(320px,1fr)); }

/* ---- tables ---- */
table.grid { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.grid th, table.grid td { text-align: left; padding: .34rem .55rem;
  border-bottom: 1px solid var(--rule); vertical-align: top; }
table.grid th { font-weight: 600; color: var(--dim); font-size: .8rem;
  text-transform: uppercase; letter-spacing: .04em; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid.wide { margin-bottom: 1rem; }
.quote-cell { max-width: 46ch; }
.hash { word-break: break-all; font-size: .74rem; }

/* ---- search ---- */
.filters { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center;
           margin: .9rem 0 1.1rem; }
.filters button, .btn { font: inherit; font-size: .88rem; padding: .34rem .8rem;
  border: 1px solid var(--rule); border-radius: 5px; background: var(--panel);
  color: var(--ink); cursor: pointer; }
.filters button:hover, .btn:hover { border-color: var(--link); text-decoration: none; }
.chk { font-size: .85rem; color: var(--dim); display: flex; align-items: center; gap: .25rem; }
.resultcount { color: var(--dim); font-size: .88rem; }
.hit { padding: .75rem 0; border-bottom: 1px solid var(--rule); }
.hit-head { display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap; }
.hit-title { font-weight: 600; }
.hit .meta { color: var(--dim); font-size: .8rem; }
.hit .who { margin: .15rem 0; font-size: .87rem; color: var(--ink); }
.hit .snip { margin: .3rem 0; }
.cite { color: var(--dim); font-size: .8rem; margin: .25rem 0 0; }
.cite.big { font-size: .88rem; }
.tag { display: inline-block; margin-left: .4rem; padding: .05rem .4rem; font-size: .74rem;
       border: 1px solid var(--rule); border-radius: 20px; color: var(--dim); }
.pager { display: flex; gap: 1.2rem; align-items: center; margin: 1.4rem 0; font-size: .9rem; }

/* ---- document ---- */
.doc .text { white-space: pre-wrap; background: var(--panel); border: 1px solid var(--rule);
  border-radius: 8px; padding: 1rem 1.15rem; margin: 1rem 0; max-width: 88ch;
  font-size: .95rem; overflow-wrap: anywhere; }
dl.facts { display: grid; gap: .3rem 1.2rem; grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
  margin: .9rem 0; font-size: .9rem; }
dl.facts div { display: flex; gap: .5rem; }
dl.facts dt { color: var(--dim); min-width: 5.5rem; text-transform: capitalize; }
dl.facts dd { margin: 0; }
/* Strain names in the glossary: the note matters more than the term, so it
   gets body width rather than a table cell. */
dl.terms { margin: .9rem 0; max-width: 88ch; }
dl.terms dt { margin-top: .9rem; }
dl.terms dd { margin: .25rem 0 0; color: var(--dim); font-size: .9rem; }
ul.links { list-style: none; padding: 0; font-size: .85rem; }
ul.links .kind { color: var(--dim); display: inline-block; min-width: 5rem; }
ul.links .url { overflow-wrap: anywhere; }

/* ---- threads ---- */
ol.thread { list-style: none; padding: 0; margin: .6rem 0; }
ol.thread li { padding: .5rem .8rem; border-left: 3px solid var(--rule); margin-bottom: .35rem; }
ol.thread li.current { border-left-color: var(--accent); background: var(--panel); }
.thread-meta { display: flex; gap: .7rem; font-size: .78rem; color: var(--dim); align-items: baseline; }
.thread-meta .sp { font-weight: 600; color: var(--ink); }
.thread-text { font-size: .92rem; overflow-wrap: anywhere; }
.jump { font-size: .75rem; }

/* ---- claims & strata ---- */
.claim { padding: .7rem 0; border-bottom: 1px solid var(--rule); }
.claim-head { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; font-size: .85rem; }
.claim-head .date { font-weight: 600; font-variant-numeric: tabular-nums; }
.pill { font-size: .72rem; padding: .08rem .5rem; border-radius: 20px; border: 1px solid; }
.pill.belief { color: var(--belief); border-color: var(--belief); }
.pill.context_required { color: var(--context); border-color: var(--context); }
.pill.excluded { color: var(--excluded); border-color: var(--excluded); }
.strata .bar { display: flex; height: 12px; border-radius: 20px; overflow: hidden;
               background: var(--rule); margin: .5rem 0 .45rem; }
.strata .seg.belief { background: var(--belief); }
.strata .seg.context { background: var(--context); }
.strata .seg.excluded { background: var(--excluded); }
ul.legend { list-style: none; padding: 0; margin: 0; font-size: .85rem; }
ul.legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px;
              margin-right: .4rem; }
ul.legend i.belief { background: var(--belief); }
ul.legend i.context { background: var(--context); }
ul.legend i.excluded { background: var(--excluded); }
.gradeswitch { font-size: .85rem; color: var(--dim); }
.gradeswitch a { margin-right: .6rem; }
.gradeswitch a.on { font-weight: 700; color: var(--ink); }

ul.taglist { list-style: none; padding: 0; font-size: .9rem; }
ul.taglist li { padding: .18rem 0; border-bottom: 1px dotted var(--rule);
                display: flex; justify-content: space-between; gap: 1rem; }
ul.taglist .count { color: var(--dim); font-variant-numeric: tabular-nums; }

/* ---- coverage heatmap ---- */
.scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px;
          background: var(--panel); }
table.heat { border-collapse: collapse; font-size: .78rem; }
table.heat th.rowhead { text-align: left; padding: .3rem .7rem; white-space: nowrap;
  position: sticky; left: 0; background: var(--panel); border-right: 1px solid var(--rule);
  font-weight: 500; }
table.heat th.mon { padding: .35rem .2rem; color: var(--dim); font-weight: 500;
  writing-mode: vertical-rl; text-orientation: mixed; height: 4.6rem; }
table.heat td.cell { width: 2.2rem; height: 1.7rem; text-align: center;
  border: 1px solid var(--bg); font-variant-numeric: tabular-nums; }
td.cell.has { background: color-mix(in srgb, var(--link) 16%, transparent); }
td.cell.has .dot { color: var(--ink); font-weight: 600; }
td.cell.gap { background: var(--warn-bg); }
td.cell.gap .zero { color: var(--context); font-weight: 700; }
td.cell.outside { background: repeating-linear-gradient(45deg,
    transparent, transparent 3px, var(--rule) 3px, var(--rule) 4px); }
td.cell.outside .x { color: var(--dim); }
.legend-row { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: center;
              font-size: .82rem; color: var(--dim); margin-top: .7rem; }
.legend-row .key { display: inline-flex; width: 2rem; height: 1.4rem; margin-right: .3rem;
  align-items: center; justify-content: center; border: 1px solid var(--rule); }
.legend-row .key.has { background: color-mix(in srgb, var(--link) 16%, transparent); }
.legend-row .key.gap { background: var(--warn-bg); }
.legend-row .key.outside { background: repeating-linear-gradient(45deg,
    transparent, transparent 3px, var(--rule) 3px, var(--rule) 4px); }

@media (max-width: 640px) {
  :root { --gutter: .9rem; }
  .quick { margin-left: 0; width: 100%; }
  .quick input { width: 100%; }
  main { padding: 1.1rem var(--gutter) 3rem; }
}

/* ---- provenance notice ---- */
.provenance {
  border: 1px solid var(--rule); border-left: 4px solid var(--accent);
  background: var(--panel); border-radius: 8px;
  padding: 1rem 1.25rem; margin: 2.6rem 0 .5rem; max-width: 90ch;
}
.provenance h2 { margin-top: 0; font-size: 1.02rem; }
.provenance p { margin: .55rem 0; font-size: .93rem; }
.provenance .emphatic { padding: .5rem .75rem; border-radius: 5px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* ---- question suggestions ---- */
.suggest { border: 1px solid var(--rule); border-radius: 8px; background: var(--panel);
           padding: .9rem 1.15rem; margin: 1rem 0 1.4rem; max-width: 80ch; }
.suggest h2 { margin-top: 0; font-size: 1rem; }
.suggest ul { margin: .4rem 0 .6rem; padding-left: 1.1rem; }
.suggest li { margin: .25rem 0; }

/* ---- code samples on the agent docs page ---- */
pre.code { background: var(--panel); border: 1px solid var(--rule); border-radius: 6px;
  padding: .7rem .9rem; overflow-x: auto; font-size: .8rem; line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.provenance ul { margin: .5rem 0; padding-left: 1.2rem; font-size: .93rem; }
.provenance li { margin: .3rem 0; }

/* ---- page-text matches, shown after record results ---- */
.pagehits { margin-top: 2rem; padding-top: .6rem; border-top: 2px solid var(--rule); }
.pagehits h2 { margin-top: .4rem; }

/* External links open in a new tab; mark them so leaving the site is visible.
   It matters here — following one means going to the Committee's own copy. */
a[target="_blank"]::after {
  content: "↗"; font-size: .78em; margin-left: .18em; opacity: .55;
  vertical-align: super; line-height: 0;
}
a[target="_blank"]:hover::after { opacity: .9; }
/* Not inside table cells that are already dense, or on the nav. */
header nav a[target="_blank"]::after { content: none; }
