/* =====================================================================
   Antibody Record — shared stylesheet

   Visual idea: a lab instrument readout. Identifiers (catalog numbers,
   lots, RRIDs, counts) are set in monospace because misreading a 0 for
   an O actually matters here. Prose is set in IBM Plex Sans. The
   recurring visual motif is the "verdict bar" — a segmented lane, like
   a gel, showing works / doesn't work / unknown at a glance.
   ===================================================================== */

:root {
  /* Surfaces */
  --paper:       #F1F2EF;   /* membrane off-white, slightly cool */
  --card:        #FBFBFA;
  --rule:        #D9DBD4;
  --rule-strong: #B9BCB2;

  /* Ink */
  --ink:         #16181A;
  --ink-soft:    #5C6066;
  --ink-faint:   #8B8F93;

  /* Semantic — named after the stains they come from */
  --works:       #2E6F4E;   /* deep malachite */
  --works-bg:    #DCE9E0;
  --fails:       #B4342A;   /* ponceau */
  --fails-bg:    #F2DEDB;
  --unknown:     #9A9484;   /* khaki */
  --unknown-bg:  #E4E2DA;

  --link:        #1E3A5F;   /* coomassie */

  --radius: 3px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

/* Every identifier on the site uses this. */
.mono, .id, input, textarea, select, .tally b, .count {
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-variant-ligatures: none;
}

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

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 700px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--rule-strong);
  background: var(--card);
}
.site-header .wrap {
  display: flex; align-items: baseline; gap: 20px;
  padding-top: 14px; padding-bottom: 14px;
  flex-wrap: wrap;
}
.wordmark {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark:hover { color: var(--link); }
.header-nav { margin-left: auto; display: flex; gap: 18px; align-items: baseline; font-size: 14px; }
.header-nav .who { color: var(--ink-faint); font-size: 13px; }

/* ---------- Type ---------- */
h1 {
  font-size: clamp(28px, 4.5vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 10px;
}
h2 {
  font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
  margin: 0 0 12px;
}

/* Small mono label used to head sections. Scientific vernacular:
   "REPORTS  n = 14" reads naturally to this audience. */
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px;
}
.eyebrow::after {
  content: ""; flex: 1; height: 1px; background: var(--rule);
}

.lede { font-size: 17px; color: var(--ink-soft); margin: 0 0 24px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }

/* ---------- Search ---------- */
.search-block { padding: 44px 0 28px; }
.search-row { display: flex; gap: 8px; }
.search-row input {
  flex: 1; font-size: 17px; padding: 13px 14px;
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
}
.search-row input:focus { border-color: var(--link); outline: none; }
.search-hint { font-size: 13px; color: var(--ink-faint); margin-top: 8px; }

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit; font-size: 15px; font-weight: 500;
  padding: 12px 20px; border-radius: var(--radius);
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.2;
}
.btn:hover { background: #000; }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover { background: var(--rule); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.small { font-size: 13px; padding: 7px 13px; }

/* ---------- The verdict bar: the signature element ---------- */
.verdict { margin: 0 0 8px; }
.verdict-bar {
  display: flex; height: 12px; width: 100%;
  background: var(--rule); border-radius: 2px; overflow: hidden;
}
.verdict-bar .seg { display: block; height: 100%; }
.seg-works   { background: var(--works); }
.seg-fails   { background: var(--fails); }
.seg-unknown { background: var(--unknown); }

@media (prefers-reduced-motion: no-preference) {
  .verdict-bar .seg { transition: width 480ms cubic-bezier(.2,.7,.3,1); }
}

.verdict-legend {
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-top: 8px; font-size: 13px; color: var(--ink-soft);
}
.tally b {
  font-weight: 600; font-size: 15px; margin-right: 4px;
}
.tally-works b   { color: var(--works); }
.tally-fails b   { color: var(--fails); }
.tally-unknown b { color: var(--unknown); }

.verdict.large .verdict-bar { height: 22px; }
.verdict.large .tally b { font-size: 22px; }
.verdict.large .verdict-legend { font-size: 14px; gap: 26px; margin-top: 12px; }

/* ---------- Summary banner above results ---------- */
.summary {
  background: var(--card);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 26px;
}
.summary .scope {
  font-family: "IBM Plex Mono", monospace; font-size: 12px;
  color: var(--ink-faint); letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 14px;
}

/* ---------- Result rows ---------- */
.result-list { list-style: none; margin: 0; padding: 0; }
.result {
  border-top: 1px solid var(--rule);
  padding: 18px 0;
  display: grid; grid-template-columns: 1fr 220px; gap: 28px; align-items: center;
}
.result:last-child { border-bottom: 1px solid var(--rule); }
.result .title { font-size: 17px; font-weight: 600; margin: 0 0 3px; letter-spacing: -0.01em; }
.result .title a { color: var(--ink); text-decoration: none; }
.result .title a:hover { color: var(--link); text-decoration: underline; }
.result .meta {
  font-family: "IBM Plex Mono", monospace; font-size: 13px; color: var(--ink-soft);
}
.result .n {
  font-family: "IBM Plex Mono", monospace; font-size: 11px;
  color: var(--ink-faint); letter-spacing: 0.08em; margin-bottom: 6px;
}

@media (max-width: 720px) {
  .result { grid-template-columns: 1fr; gap: 12px; }
}

/* ---------- Antibody detail header ---------- */
.ab-head {
  padding: 34px 0 26px;
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: 28px;
}
.ab-ident {
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px; color: var(--ink-soft);
  display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 12px 0 22px;
}
.ab-ident span b { color: var(--ink-faint); font-weight: 400; }

/* ---------- Report entries ---------- */
.report {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--card);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.report.is-works { border-left-color: var(--works); }
.report.is-fails { border-left-color: var(--fails); }
.report.is-unknown { border-left-color: var(--unknown); }

.report-top {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.badge {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 2px; font-weight: 500;
}
.badge-works   { background: var(--works-bg);   color: var(--works); }
.badge-fails   { background: var(--fails-bg);   color: var(--fails); }
.badge-unknown { background: var(--unknown-bg); color: var(--unknown); }

.report-by { font-size: 13px; color: var(--ink-soft); }
.report-when { font-size: 13px; color: var(--ink-faint); margin-left: auto; }
.report-body { margin: 0 0 12px; white-space: pre-wrap; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  font-family: "IBM Plex Mono", monospace; font-size: 12px;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 2px; padding: 2px 7px; color: var(--ink-soft);
}
.chip b { color: var(--ink-faint); font-weight: 400; }

.files { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.files img {
  max-height: 130px; border: 1px solid var(--rule); border-radius: 2px; display: block;
}
.file-link {
  font-family: "IBM Plex Mono", monospace; font-size: 12px;
  border: 1px solid var(--rule); border-radius: 2px;
  padding: 6px 10px; background: var(--paper); text-decoration: none;
}

/* ---------- Comments ---------- */
.comments { border-top: 1px dashed var(--rule); margin-top: 14px; padding-top: 12px; }
.comment { padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.comment:last-of-type { border-bottom: none; }
.comment .who { font-weight: 600; font-size: 13px; }
.comment .when { color: var(--ink-faint); font-size: 12px; margin-left: 8px; }
.comment p { margin: 3px 0 0; white-space: pre-wrap; }
.comment-form { display: flex; gap: 8px; margin-top: 10px; }
.comment-form input { flex: 1; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 5px; }
.field .help { font-size: 13px; color: var(--ink-faint); margin: 4px 0 0; }
.field input, .field textarea, .field select {
  width: 100%; font-size: 15px; padding: 10px 12px;
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius);
  background: var(--card); color: var(--ink);
}
.field textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--link); outline: none;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }

.req { color: var(--fails); }
.optional-note {
  font-family: "IBM Plex Mono", monospace; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint);
}

/* Outcome picker — three big mutually exclusive choices */
.outcome-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 620px) { .outcome-picker { grid-template-columns: 1fr; } }
.outcome-picker label {
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius);
  padding: 14px; cursor: pointer; background: var(--card);
  display: block; font-weight: 500; text-align: center;
}
.outcome-picker input { position: absolute; opacity: 0; pointer-events: none; }
.outcome-picker label:hover { border-color: var(--ink-faint); }
.outcome-picker input:checked + span { display: block; }
.outcome-picker label.sel-works   { border-color: var(--works); background: var(--works-bg); color: var(--works); }
.outcome-picker label.sel-fails   { border-color: var(--fails); background: var(--fails-bg); color: var(--fails); }
.outcome-picker label.sel-unknown { border-color: var(--unknown); background: var(--unknown-bg); color: var(--unknown); }

/* ---------- Notices ---------- */
.notice {
  border-radius: var(--radius); padding: 12px 15px; font-size: 14px;
  margin-bottom: 18px; border: 1px solid;
}
.notice-error { background: var(--fails-bg); border-color: var(--fails); color: #7A231B; }
.notice-ok    { background: var(--works-bg); border-color: var(--works); color: #1D4A34; }
.notice-info  { background: var(--card); border-color: var(--rule-strong); color: var(--ink-soft); }

.empty {
  border: 1px dashed var(--rule-strong); border-radius: var(--radius);
  padding: 34px 24px; text-align: center; color: var(--ink-soft);
}
.empty p { margin: 0 0 14px; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 60px; border-top: 1px solid var(--rule-strong);
  background: var(--card); padding: 24px 0;
  font-size: 13px; color: var(--ink-faint);
}
.site-footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; }
