/* Facility record. Same tokens as assets/site.css; rules in BRAND.md.
   Source Serif 4 for headings and reading, Source Sans 3 for tables, forms and controls,
   JetBrains Mono for identifiers. Evidence strength G0 to G4 is the slate scale and nothing
   else uses it; cobalt means act here (buttons, links). Role is a letter and a shape, never a colour. */

:root {
  --ground: #faf9f6;
  --ink: #141b2d;
  --soft: #566079;          /* secondary text, 6.0:1 on the ground */
  --rule: #e2e3e6;
  --rule-strong: #b9bdc6;
  --wash: #f1f2f5;          /* neutral row hover and table head */
  --cobalt: #2443d6;
  --cobalt-hover: #1b34ae;
  --serif: 'Source Serif 4', Charter, 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --sans: 'Source Sans 3', 'Source Sans Pro', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  /* The evidence scale: slate, five lightness steps, monotonic in greyscale. Never cobalt. */
  --g0: #eef0f3;
  --g1: #cdd2da;
  --g2: #9aa3b2;
  --g3: #5e6a7e;
  --g4: #2b3446;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.55;
  font-weight: 400;
}

.page { max-width: 1120px; margin: 0 auto; padding: 0 28px 64px; }

/* Prose stays in a reading column. Tables take the full width. */
.page > p, .page > ul, .page > h2, .page > h3, .body-text, .lede, .note,
.article-head, .legend, .src-note, .actions, .claims, .two-col, .first-engagement,
.contact, .form-card, .hero p { max-width: 41rem; }

a { color: var(--cobalt); text-decoration: underline; text-decoration-color: rgba(36, 67, 214, .35);
    text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--cobalt); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.25; margin: 0; }
h1 { font-size: 2.1rem; letter-spacing: 0; }
h2 { font-size: 1.35rem; margin: 2.2rem 0 0.6rem; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 0.4rem; }
p { margin: 0 0 1rem; }
ul { margin: 0 0 1rem; padding-left: 1.3rem; }
li { margin-bottom: 0.35rem; }
strong, b { font-weight: 600; }

/* ---- Site header ---- */
.site { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
        gap: 8px 24px; padding: 22px 0 14px; border-bottom: 1px solid var(--rule); margin-bottom: 40px; }
.site nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 0.95rem; }
.site nav a { text-decoration: none; padding: 2px 0; border-bottom: 1px solid transparent; }
.site nav a:hover, .site nav a[aria-current="page"] { border-bottom-color: var(--ink); }

/* ---- First screen ---- */
.hero h1 { max-width: 30ch; font-size: 2.3rem; margin-bottom: 1.1rem; }
.hero .lede { color: var(--ink); margin-bottom: 0.8rem; }
.lede { font-size: 1.1rem; }
.hero-sub { color: var(--soft); }

.actions { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0.4rem 0 1.6rem; font-size: 0.95rem; }
button, .btn-secondary { font-family: var(--sans); font-size: 0.95rem; color: var(--ink);
  background: transparent; border: 1px solid var(--rule-strong); padding: 6px 14px; cursor: pointer; }
button:hover { background: var(--wash); }
.btn-disabled { font-family: var(--mono); font-size: 13px; color: var(--soft); background: transparent;
  border: 1px dashed var(--rule-strong); padding: 10px 16px; align-self: flex-start; cursor: not-allowed; }

/* ---- Section headings. Weight and size only. ---- */
.section-label { font-size: 1.35rem; font-weight: 600; line-height: 1.25; margin: 2.6rem 0 0.7rem;
                 padding-top: 1.1rem; border-top: 1px solid var(--rule); }
.divider { border-top: 1px solid var(--rule); margin: 2.4rem 0; }

/* ---- Ledger: the counts, as a plain table ---- */
.ledger { border-collapse: collapse; margin: 0.4rem 0 0.4rem; font-size: 15px; }
.ledger th, .ledger td { padding: 4px 0; border-bottom: 1px solid var(--rule); text-align: left; font-weight: 400; }
.ledger td.n { font-family: var(--mono); font-size: 14px; text-align: right; padding-right: 18px; min-width: 6.5em; }
.ledger .g { margin-right: 6px; }

.src-note { font-size: 14.5px; color: var(--soft); line-height: 1.5; margin: 0.6rem 0 1rem; }

/* ---- Grade badge: one hue, 11px, readable in greyscale ---- */
.g { font-family: var(--mono); font-size: 11px; font-weight: 500; line-height: 1; display: inline-block;
     padding: 3px 5px; border: 1px solid var(--ink); color: var(--ink); vertical-align: 1px; white-space: nowrap; }
.g0 { background: var(--g0); }
.g1 { background: var(--g1); }
.g2 { background: var(--g2); }
.g3 { background: var(--g3); color: #fff; }
.g4 { background: var(--g4); color: #fff; }

/* ---- Role: letter and shape. E solid square, S open circle, U dashed square. ---- */
.role { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px;
        font-family: var(--mono); font-size: 10.5px; font-weight: 700; line-height: 1;
        margin-right: 6px; vertical-align: -3px; border: 1.5px solid var(--ink); flex: none; }
.role-e { background: var(--ink); color: var(--ground); }
.role-s { background: var(--ground); color: var(--ink); border-radius: 50%; }
.role-u { background: var(--ground); color: var(--ink); border-style: dashed; }

/* Institution and attribution badges are neutral. Named is solid, inferred is dashed. */
.badge { font-family: var(--mono); font-size: 11px; line-height: 1; padding: 3px 5px; display: inline-block;
         border: 1px solid var(--ink); color: var(--ink); white-space: nowrap; vertical-align: 1px; }
.badge-inferred { border-style: dashed; color: var(--soft); border-color: var(--soft); }

/* ---- Filters ---- */
.filters { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: flex-end;
           padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.filter { display: flex; flex-direction: column; gap: 4px; flex: 1 1 200px; min-width: 170px; }
.filter label, .form-row label { font-size: 14px; color: var(--soft); font-weight: 600; }
input[type="text"], select, textarea { font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: #fff; border: 1px solid var(--rule-strong); border-radius: 0; padding: 7px 9px; width: 100%; }
.filter-checks { display: flex; flex-direction: column; gap: 6px; flex: 1 1 300px; }
.chk { display: flex; align-items: flex-start; gap: 8px; font-size: 14.5px; line-height: 1.4; color: var(--soft); }
.chk input { margin-top: 4px; accent-color: var(--ink); }
.chk label { font-weight: 400; font-size: 14.5px; color: var(--soft); }
.filter-count { font-family: var(--mono); font-size: 12.5px; color: var(--soft); margin: 10px 0 6px; max-width: none; }
.filter-count b { color: var(--ink); font-weight: 500; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; margin: 0 0 1rem; }
.map-table, .data-table, .ev-table, .facts {
  width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.map-table th, .map-table td, .data-table th, .data-table td, .ev-table th, .ev-table td, .facts th, .facts td {
  text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); font-weight: 400; }
.map-table thead th, .data-table tr:first-child th, .ev-table thead th {
  font-size: 13.5px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--ink); white-space: nowrap; }
.map-table th button { all: unset; cursor: pointer; font: inherit; font-weight: 600; }
.map-table th button:hover { text-decoration: underline; }
.map-table th button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.map-table th[aria-sort="ascending"] button::after { content: " \25B2"; font-family: var(--mono); font-size: 10px; }
.map-table th[aria-sort="descending"] button::after { content: " \25BC"; font-family: var(--mono); font-size: 10px; }
.map-table td.num, .map-table th.num, .data-table td.num, .data-table th.num, .ev-table td.num {
  text-align: right; font-family: var(--mono); font-size: 13px; white-space: nowrap; padding-right: 12px; }
.map-table, .data-table, .ledger, .facts { font-family: var(--sans); }
.map-table th.num, .data-table th.num { font-family: var(--sans); font-size: 13.5px; }
.map-table tbody tr:hover { background: var(--wash); }
.map-table a.fac { font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.map-table a.fac:hover { border-bottom-color: var(--ink); }
.map-table .inst { font-size: 14px; }
.map-table .tech { font-size: 14px; }
.map-table .role-cell { font-size: 14px; white-space: nowrap; }
.dim { color: var(--soft); }
.data-table td.hl { font-family: var(--mono); font-weight: 500; }
.facts th { width: 15rem; font-size: 14px; color: var(--soft); }
.facts td { font-family: var(--mono); font-size: 13.5px; }
.facts-wrap { max-width: 41rem; margin: 0.6rem 0 1rem; }

/* ---- Evidence table: meta row, then the quote ---- */
.ev-table tbody.ev tr:first-child td { border-bottom: 0; padding-bottom: 2px; font-size: 13.5px; }
.ev-table tbody.ev tr.ev-body td { padding: 2px 0 14px; max-width: 46rem; }
.ev-table tbody.ev td { font-family: var(--sans); }
.ev-table tbody.ev .num { font-family: var(--mono); }
.ev-quote { font-size: 16.5px; line-height: 1.55; margin: 0 0 6px; padding-left: 14px; border-left: 2px solid var(--rule-strong); }
.ev-note { font-size: 14px; color: var(--soft); margin: 0; line-height: 1.5; }
.ev-note a, .ev-fix { font-size: 13px; }
.ev-fix { white-space: nowrap; }

/* ---- Notes, in place of boxes ---- */
.note, .warn-block, .case-block, .first-engagement { border-left: 3px solid var(--rule-strong);
  padding: 2px 0 2px 16px; margin: 1.6rem 0; }
.case-label, .first-engagement-label { font-weight: 600; margin-bottom: 4px; font-size: 1rem; }
.case-p, .first-engagement p, .warn-block p { margin: 0; }

.fix { margin: 2rem 0; padding: 12px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); max-width: 41rem; }
.fix p { margin: 0 0 4px; }
.fix .fix-title { font-weight: 600; }

/* ---- Prose blocks ---- */
.article-head { margin-bottom: 1.6rem; }
.kicker { font-family: var(--mono); font-size: 12.5px; color: var(--soft); margin-bottom: 8px; }
.article-title { font-size: 2rem; }
.article-dek { color: var(--soft); margin: 0.6rem 0 0; }
.body-text h2 { margin-top: 2.2rem; }
.limits-list { list-style: square; }
.claims, .two-col { display: block; }
.diff-card { border-top: 1px solid var(--rule); padding-top: 14px; margin-top: 18px; }
.diff-card-label { font-family: var(--mono); font-size: 12.5px; color: var(--soft); margin-bottom: 2px; }
.claim-h { font-size: 1.15rem; margin: 0 0 6px; }
.diff-card p { margin: 0 0 0.8rem; }
.legend { font-size: 15.5px; color: var(--soft); margin-top: 1rem; }
.legend b { color: var(--ink); font-weight: 600; }
.contact { margin: 2rem 0 1rem; font-size: 15.5px; }
.contact-label { font-weight: 600; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14.5px; margin-top: 2.4rem;
              padding-top: 14px; border-top: 1px solid var(--rule); }

/* ---- Scope form ---- */
.form-card { display: flex; flex-direction: column; gap: 18px; padding: 0; margin: 1.4rem 0 1rem; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row.half { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row .hint { font-size: 14.5px; color: var(--soft); line-height: 1.5; }
textarea { min-height: 110px; resize: vertical; }

@media (max-width: 720px) {
  body { font-size: 17px; }
  .page { padding: 0 18px 48px; }
  h1, .hero h1 { font-size: 1.75rem; }
  .form-row.half { grid-template-columns: 1fr; }
  .facts th { width: 9rem; }
}

@media print {
  body { background: #fff; font-size: 11pt; }
  .filters, .actions, button, .site nav, .footer-nav { display: none; }
  a { text-decoration: none; }
  .map-table tr, .ev-table tbody { break-inside: avoid; }
}

.divider + .section-label { border-top: 0; margin-top: 0; padding-top: 0; }
.section-label { max-width: none; }
.map-table td:first-child { min-width: 11rem; }

/* ---- Home page and request page (added 2026-11-13). Same system, no new hue. ---- */
.offer, .steps { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.5; margin: 0.4rem 0 1rem; }
.offer th, .offer td, .steps th, .steps td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--rule); font-weight: 400; }
.offer thead th, .steps thead th { font-size: 13.5px; font-weight: 600; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.offer td.n, .steps td.n { font-family: var(--mono); font-size: 13px; width: 2.6rem; color: var(--soft); }
.offer td.lead { font-weight: 600; width: 15rem; }
.steps td.who { font-weight: 600; width: 6.5rem; }
.pos { font-size: 1.35rem; font-weight: 600; line-height: 1.3; margin: 0 0 1rem; max-width: 41rem; }
.hero .hero-ambition { max-width: 24em; font-size: 2rem; line-height: 1.28; }
.page > .table-wrap, .page > table { max-width: 52rem; }
.refuse { list-style: square; max-width: 41rem; }
.mono { font-family: var(--mono); font-size: 0.92em; }
@media (max-width: 720px) { .hero .hero-ambition { font-size: 1.6rem; } .offer td.lead { width: auto; } }

/* ---- Product header and buttons, shared with assets/site.css ---- */
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
          padding: 16px 0 14px; border-bottom: 1px solid var(--rule); margin-bottom: 40px; }
.mark { display: inline-flex; align-items: center; gap: 0.4em; font-family: var(--serif); font-weight: 600; font-size: 1.32rem;
        color: var(--ink); text-decoration: none; }
.mark::before { content: ''; width: 1.2em; height: 1.2em; flex: none; background: url('/assets/brand/mark.svg') center / contain no-repeat; }
.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; font-family: var(--sans); font-size: 0.97rem; }
.topbar nav a { color: var(--ink); text-decoration: none; }
.topbar nav a[aria-current="page"] { border-bottom: 1px solid var(--ink); }
a.btn, button.btn { display: inline-block; font-family: var(--sans); font-weight: 600; font-size: 0.95rem; line-height: 1; padding: 9px 14px;
  border-radius: 6px; border: 1px solid var(--cobalt); background: var(--cobalt); color: #fff; text-decoration: none; }
a.btn:hover, button.btn:hover { background: var(--cobalt-hover); border-color: var(--cobalt-hover); }
.topbar nav a.btn { color: #fff; }
.save-btn { font-size: 0.8rem; padding: 4px 10px; border-radius: 6px; white-space: nowrap; }
.save-btn[aria-pressed="true"] { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page > .table-wrap.wide { max-width: none; }

/* ---- Facility pages and search, 2026-11 ---- */
.save-btn, .save-col { display: none; }
body.signed-in .save-btn { display: inline-block; }
body.signed-in .save-col { display: table-cell; }
.tech-list, .paper-list { list-style: none; padding: 0; margin: 0 0 1rem; max-width: 46rem; }
.tech-list li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.tech-list .refs { font-size: 14px; color: var(--soft); }
.paper-list li { padding: 4px 0; font-size: 15px; }
.report { margin: 2rem 0 1rem; max-width: 41rem; }
.report-form { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.report-form label { font-size: 14px; color: var(--soft); font-weight: 600; }
.report-status { font-size: 14px; color: var(--soft); }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: 0.95rem; color: var(--cobalt); text-decoration: underline; text-decoration-color: rgba(36, 67, 214, .35); cursor: pointer; }
.report-form[hidden] { display: none; }

/* Dense tables stay calm: names read in ink and turn cobalt on hover (BRAND.md). */
.map-table a, .data-table a { color: var(--ink); text-decoration-color: var(--rule-strong); }
.map-table a:hover, .data-table a:hover { color: var(--cobalt); text-decoration-color: var(--cobalt); }
.actions a.btn { margin-left: 4px; }

/* Buttons keep their own text colour inside any block that colours its links. */
a.btn, a.btn:visited, a.btn:hover { color: #fff !important; text-decoration: none; }

/* Facility page: headline figures, paper rows, method note. */
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6rem 0 0.4rem; max-width: 46rem; }
.stat { flex: 1 1 12rem; border: 1px solid var(--rule); border-radius: 6px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.7rem; line-height: 1.1; }
.stat-words b { font-size: 1.15rem; line-height: 1.3; }
.stat span { display: block; font-size: 14px; color: var(--soft); margin-top: 4px; line-height: 1.35; }
details.method { max-width: 46rem; font-size: 14.5px; color: var(--soft); margin: 0.6rem 0 0; }
details.method summary, details.more summary { cursor: pointer; color: var(--ink); }
details.method p { margin: 0.5rem 0 0; line-height: 1.5; }
.tech-head { font-size: 1.05rem; font-weight: 600; margin: 1.2rem 0 0.3rem; }
.paper-rows { list-style: none; padding: 0; margin: 0 0 0.6rem; max-width: 46rem; }
.paper-rows li { padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 15px; line-height: 1.35; }
.paper-rows .paper-meta { display: block; font-size: 13px; color: var(--soft); margin-top: 2px; }
details.more { max-width: 46rem; font-size: 14.5px; margin-bottom: 0.8rem; }

/* Charts: one slate series, recessive axis, values in text ink. */
svg.chart { display: block; width: 100%; max-width: 46rem; height: auto; margin: 0.4rem 0 0.2rem; overflow: visible; }
svg.chart .mark { fill: var(--g3); }
svg.chart .mark.partial { fill: var(--g2); }
svg.chart .hit { fill: transparent; }
svg.chart g:hover .mark { fill: var(--g4); }
svg.chart g:hover .mark.partial { fill: var(--g3); }
svg.chart .axis { stroke: var(--rule); stroke-width: 1; }
svg.chart .val { font: 600 12px var(--sans); fill: var(--ink); text-anchor: middle; }
svg.chart .val-l { font: 600 12px var(--sans); fill: var(--ink); }
svg.chart .tick { font: 12px var(--sans); fill: var(--soft); text-anchor: middle; }
svg.chart .lab { font: 13px var(--sans); fill: var(--ink); text-anchor: end; }
.chart-table { border-collapse: collapse; font-size: 14px; margin: 0.4rem 0; }
.chart-table th, .chart-table td { text-align: left; padding: 3px 14px 3px 0; border-bottom: 1px solid var(--rule); }
.chart-table th { color: var(--soft); font-weight: 600; }
td.num .est { display: block; font-size: 12px; color: var(--soft); white-space: nowrap; }
.named-row { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--rule); max-width: 46rem; }
.named-k { flex: 0 0 7.5rem; font-size: 14px; color: var(--soft); padding-top: 3px; }
.chip { display: inline-block; font-size: 13.5px; background: var(--wash); border-radius: 4px; padding: 2px 8px; margin: 2px 6px 2px 0; }
.chip b { font-weight: 600; color: var(--soft); margin-left: 6px; }
