/* ============================================================
   Peptide Codex — design system
   Dark Lab palette ported verbatim from tinyhealthtools
   (~/Projects/tinyhealthtools/production/assets/style.css).
   Codex-specific components are appended at the end of this file.
   ============================================================ */
:root {
  /* surfaces */
  --bg:            #0d1117;
  --bg-raise:      #141b24;
  --bg-card:       #171f29;
  --bg-inset:      #0a0f15;
  --line:          #243040;
  --line-soft:     #1c2632;

  /* text */
  --ink:           #e8edf3;
  --ink-mid:       #a8b6c6;
  --ink-dim:       #6f8098;

  /* dual accent — amber is the "result", teal is the "method" */
  --amber:         #f5b642;
  --amber-soft:    rgba(245, 182, 66, 0.14);
  --amber-glow:    rgba(245, 182, 66, 0.18);
  --teal:          #4ec9a5;
  --teal-soft:     rgba(78, 201, 165, 0.14);
  --blue:          #4aa8d8;
  --blue-soft:     rgba(74, 168, 216, 0.14);
  --ember:         #f0883e;
  --ember-soft:    rgba(240, 136, 62, 0.14);
  --danger:        #e5534b;
  --danger-soft:   rgba(229, 83, 75, 0.14);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --measure: 42rem;
  --wide: 66rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 640px) { body { font-size: 16px; } }

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

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem; }
.wrap-wide { max-width: var(--wide); margin: 0 auto; padding: 0 1.5rem; }

section { padding: 3.25rem 0; }
section + section { border-top: 1px solid var(--line-soft); }

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

h1, h2 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3.3rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.1rem); margin: 0 0 0.4rem; }
h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 650; line-height: 1.35;
     letter-spacing: -0.005em; margin: 0 0 0.4rem; color: var(--ink); }

p { margin: 0 0 1.15rem; color: var(--ink-mid); }
p strong, li strong { color: var(--ink); font-weight: 600; }

a { color: var(--amber); text-decoration-color: rgba(245,182,66,0.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--amber); }

ul, ol { color: var(--ink-mid); padding-left: 1.3rem; margin: 0 0 1.15rem; }
li { margin-bottom: 0.5rem; }

.lede { font-size: 1.18rem; color: var(--ink); line-height: 1.6; max-width: 34rem; }

.eyebrow {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-dim);
  margin: 0 0 0.7rem; display: block;
}
.section-head { margin-bottom: 1.9rem; }
.section-head p { margin-bottom: 0; }

code, .mono { font-family: var(--mono); }

code {
  font-size: 0.86em; padding: 0.1em 0.4em; border-radius: 4px;
  background: var(--bg-inset); border: 1px solid var(--line); color: var(--ink);
}

/* ---------- nav ---------- */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 17, 23, 0.9);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: var(--wide); margin: 0 auto; padding: 0.7rem 1.5rem;
  display: flex; align-items: center; gap: 1.4rem;
}
.brand {
  font-family: var(--serif); font-size: 1rem; font-weight: 600;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--amber); }
.topnav { display: flex; gap: 1.1rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-dim); text-decoration: none; white-space: nowrap;
  padding: 0.3rem 0; border-bottom: 2px solid transparent;
}
.topnav a:hover { color: var(--ink); }
.topnav a.active { color: var(--amber); border-bottom-color: var(--amber); }

/* ---------- hero ---------- */

.hero { padding: 4.25rem 0 3rem; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; inset: -40% 0 auto 0; height: 480px;
  background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(245,182,66,0.08), transparent 70%);
  pointer-events: none;
}
.hero .wrap-wide, .hero .wrap { position: relative; }

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 2.5rem; align-items: center;
}
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .hero-art { order: -1; }
}
.hero-art svg { width: 100%; height: auto; display: block; }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 0.45rem 1.4rem; margin-top: 1.5rem;
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-dim);
}
.hero-meta span { display: flex; align-items: center; gap: 0.45rem; }
.hero-meta i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); display: inline-block; }

/* ---------- tool cards ---------- */

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 0.9rem;
}
.card {
  display: block; text-decoration: none; color: inherit;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.15rem 1.25rem 1.05rem;
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
  position: relative;
}
.card p { font-size: 0.9rem; margin: 0 0 0.9rem; color: var(--ink-mid); line-height: 1.55; }
.card:hover { border-color: var(--teal); transform: translateY(-2px); background: var(--bg-raise); }
.card:hover .card-foot .go { color: var(--teal); }
.card:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.card .tag {
  display: inline-block; font-family: var(--mono); font-size: 0.62rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--teal); border: 1px solid rgba(78,201,165,0.32);
  background: var(--teal-soft); border-radius: 100px;
  padding: 0.12rem 0.5rem; margin-bottom: 0.75rem;
}
.card .tag.amber { color: var(--amber); border-color: rgba(245,182,66,0.32); background: var(--amber-soft); }

.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-top: 1px solid var(--line-soft); padding-top: 0.7rem;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.06em;
  color: var(--ink-dim); text-transform: uppercase;
}
.card-foot .go { color: var(--ink-dim); transition: color 0.16s ease; }

/* ---------- calculator panel ---------- */

.panel {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 16px; padding: 1.5rem; margin: 0 0 1.75rem;
}
@media (max-width: 560px) { .panel { padding: 1.15rem; border-radius: 14px; } }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.panel-head .eyebrow { margin: 0; }

.calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1rem; }
.calc-grid .full { grid-column: 1 / -1; }
@media (max-width: 480px) { .calc-grid { grid-template-columns: 1fr; } }

.field label {
  display: block; font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: 0.35rem;
}
.field input, .field select {
  width: 100%; font-family: var(--mono); font-size: 0.95rem;
  color: var(--ink); background: var(--bg-inset);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 0.6rem 0.7rem; appearance: none; -webkit-appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field select {
  font-family: var(--sans); font-size: 0.9rem;
  background-image: linear-gradient(45deg, transparent 50%, #6f8098 50%), linear-gradient(135deg, #6f8098 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 1px), calc(100% - 13px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 2.2rem;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(78,201,165,0.12);
}
.field .hint { font-family: var(--mono); font-size: 0.64rem; color: var(--ink-dim); margin-top: 0.3rem; display: block; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

/* segmented unit toggle */
.toggle {
  display: inline-flex; background: var(--bg-inset);
  border: 1px solid var(--line); border-radius: 100px; padding: 3px;
}
.toggle button {
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-dim); background: transparent; border: 0; cursor: pointer;
  padding: 0.35rem 0.85rem; border-radius: 100px; transition: all 0.15s ease;
}
.toggle button:hover { color: var(--ink); }
.toggle button[aria-pressed="true"] {
  background: var(--amber-soft); color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(245,182,66,0.45);
}

/* ---------- the hero number ---------- */

.readout {
  margin-top: 1.5rem; padding: 1.6rem 1.25rem 1.4rem;
  background: var(--bg-inset); border: 1px solid var(--line);
  border-radius: 14px; text-align: center; position: relative; overflow: hidden;
}
.readout::before {
  content: ''; position: absolute; inset: auto 0 -60% 0; height: 200px;
  background: radial-gradient(ellipse 50% 100% at 50% 100%, rgba(245,182,66,0.07), transparent 70%);
  pointer-events: none;
}
.readout .k {
  font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-dim); display: block; margin-bottom: 0.35rem;
}
.big {
  font-family: var(--mono); font-weight: 600;
  font-size: clamp(3.2rem, 13vw, 5.4rem); line-height: 1;
  color: var(--amber); letter-spacing: -0.03em;
  text-shadow: 0 0 34px rgba(245,182,66,0.22);
  font-variant-numeric: tabular-nums;
  display: inline-block;
}
.big .unit {
  font-size: 0.2em; font-weight: 500; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-dim);
  text-shadow: none; margin-left: 0.55em; vertical-align: 1.9em;
}
.readout .sub {
  font-family: var(--mono); font-size: 0.76rem; color: var(--ink-dim);
  margin: 0.6rem 0 0; letter-spacing: 0.04em;
}
.readout .sub b { color: var(--teal); font-weight: 600; }

/* budget bar figure */
.budget { margin-top: 1.5rem; }
.budget svg { width: 100%; height: auto; display: block; }
.figfoot {
  font-family: var(--mono); font-size: 0.68rem; line-height: 1.6;
  color: var(--ink-dim); margin: 0.7rem 0 0;
}
@media (max-width: 700px) {
  /* the bar keeps its full width; the fine print moves out to HTML */
  .budget #bud-ticks { display: none; }
  .budget .svg-tiny { font-size: 19px; letter-spacing: 0.04em; }
  .budget .svg-num { font-size: 23px; }
}
.legend {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0.85rem 0 0;
  font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.05em; color: var(--ink-dim);
}
.legend span { display: flex; align-items: center; gap: 0.42rem; }
.legend b { color: var(--ink-mid); font-weight: 600; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }

/* target tiles */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-top: 1.5rem; }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }
.tile {
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: 12px; padding: 0.95rem 1rem; text-align: left;
}
.tile .v {
  font-family: var(--mono); font-size: 1.55rem; font-weight: 600;
  color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.tile .k {
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--ink-dim); margin-top: 0.15rem;
}
.tile.cut { border-color: rgba(74,168,216,0.35); background: linear-gradient(180deg, var(--blue-soft), transparent 70%); }
.tile.cut .v { color: var(--blue); }
.tile.hold { border-color: rgba(245,182,66,0.4); background: linear-gradient(180deg, var(--amber-soft), transparent 70%); }
.tile.hold .v { color: var(--amber); }
.tile.gain { border-color: rgba(240,136,62,0.35); background: linear-gradient(180deg, var(--ember-soft), transparent 70%); }
.tile.gain .v { color: var(--ember); }

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

.note {
  border-left: 3px solid var(--amber);
  background: linear-gradient(90deg, var(--amber-glow), transparent 60%);
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.25rem; margin: 1.6rem 0; font-size: 0.95rem;
}
.note > :last-child { margin-bottom: 0; }
.note .note-label {
  display: block; font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--amber); margin-bottom: 0.4rem;
}
.note.method { border-left-color: var(--teal); background: linear-gradient(90deg, var(--teal-soft), transparent 60%); }
.note.method .note-label { color: var(--teal); }
.note.caution { border-left-color: var(--danger); background: linear-gradient(90deg, var(--danger-soft), transparent 60%); }
.note.caution .note-label { color: var(--danger); }

.equations {
  background: var(--bg-inset); border: 1px dashed var(--line);
  border-radius: 12px; padding: 1.1rem 1.3rem; margin: 1.6rem 0;
}
.equations .note-label {
  display: block; font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 0.7rem;
}
.eq { font-family: var(--mono); font-size: 0.84rem; color: var(--ink-mid); line-height: 1.9; overflow-x: auto; }
.eq b { color: var(--ink); font-weight: 600; }
.eq .op { color: var(--amber); }
.eq .who { color: var(--teal); }

/* ---------- figures ---------- */

figure { margin: 2rem 0; }
.figbox {
  background: var(--bg-inset); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.25rem; overflow-x: auto;
}
.figbox svg { width: 100%; height: auto; display: block; }
figcaption { margin-top: 0.85rem; font-size: 0.85rem; color: var(--ink-dim); line-height: 1.55; }
figcaption b { color: var(--ink-mid); font-weight: 600; }

/* ---------- FAQ ---------- */

.faq details {
  border-bottom: 1px solid var(--line-soft); padding: 0.15rem 0;
}
.faq details:first-of-type { border-top: 1px solid var(--line-soft); }
.faq summary {
  cursor: pointer; list-style: none; padding: 0.95rem 2rem 0.95rem 0;
  font-size: 0.98rem; color: var(--ink); position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; position: absolute; right: 0.2rem; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); color: var(--ink-dim); font-size: 1.1rem;
}
.faq details[open] summary::after { content: '\2212'; color: var(--amber); }
.faq summary:hover { color: var(--amber); }
.faq details p { font-size: 0.93rem; margin: 0 0 1rem; padding-right: 1.5rem; }

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

footer { padding: 2.75rem 0 4rem; border-top: 1px solid var(--line-soft); }
footer p { font-size: 0.85rem; color: var(--ink-dim); }
footer .disclaimer { border-left: 2px solid var(--line); padding-left: 1rem; }
footer .disclaimer strong { color: var(--ink-mid); }
.footlinks {
  display: flex; flex-wrap: wrap; gap: 1.2rem; margin-bottom: 1.5rem;
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.footlinks a { color: var(--ink-dim); text-decoration: none; }
.footlinks a:hover { color: var(--amber); }

/* ---------- svg helpers ---------- */

.svg-label { font-family: var(--sans); font-size: 12px; fill: var(--ink); font-weight: 600; }
.svg-sub   { font-family: var(--sans); font-size: 10.5px; fill: var(--ink-dim); }
.svg-num   { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.svg-tiny  { font-family: var(--mono); font-size: 9px; fill: var(--ink-dim); letter-spacing: 0.06em; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Production extensions — article typography & misc
   ============================================================ */

/* article measure: ~68ch of body text, generous leading */
.article { padding: 3.25rem 0 1.5rem; }
.prose { max-width: 68ch; }
.prose p { line-height: 1.85; }
.prose h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.7rem);
  margin: 2.4rem 0 0.8rem;
}
.prose ul, .prose ol { line-height: 1.75; margin-bottom: 1.3rem; }
.prose li { margin-bottom: 0.55rem; }

/* teal links inside article prose */
.prose a {
  color: var(--teal);
  text-decoration-color: rgba(78, 201, 165, 0.35);
}
.prose a:hover { text-decoration-color: var(--teal); }

/* article header pieces */
.article-meta {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--ink-dim); margin: 0 0 0.8rem;
}
.article-meta b { color: var(--amber); font-weight: 600; }
.dek {
  font-family: var(--serif); font-size: 1.22rem; line-height: 1.65;
  color: var(--ink-mid); margin: 0 0 2rem;
}

/* amber pull-quote */
blockquote, .pullquote {
  margin: 2rem 0; padding: 1.2rem 1.4rem;
  border-left: 3px solid var(--amber);
  background: linear-gradient(90deg, var(--amber-glow), transparent 65%);
  border-radius: 0 10px 10px 0;
}
blockquote p, .pullquote p {
  font-family: var(--serif); font-size: 1.12rem; line-height: 1.6;
  color: var(--ink); margin: 0;
}

/* sources list */
.sources {
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px dashed var(--line);
}
.sources .note-label {
  display: block; font-family: var(--mono); font-size: 0.68rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-dim); margin-bottom: 0.7rem;
}
.sources ul { list-style: none; padding-left: 0; }
.sources li {
  font-size: 0.88rem; color: var(--ink-dim); line-height: 1.6;
  padding-left: 1.1rem; position: relative; margin-bottom: 0.45rem;
}
.sources li::before {
  content: '\00b7'; position: absolute; left: 0.2rem; color: var(--teal); font-weight: 700;
}
.sources em { color: var(--ink-mid); font-style: italic; }

/* 404 */
.notfound { text-align: center; padding: 5rem 0 3rem; }
.notfound .code {
  font-family: var(--mono); font-weight: 600; letter-spacing: -0.03em;
  font-size: clamp(4rem, 18vw, 7rem); line-height: 1; color: var(--amber);
  text-shadow: 0 0 34px rgba(245, 182, 66, 0.22);
  font-variant-numeric: tabular-nums;
}
.notfound h1 { margin-top: 0.6rem; }

/* ============================================================
   Explorer additions (ancestral-diet) — same Dark Lab idiom
   ============================================================ */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Toggle chip, dark idiom (the body-clock page styles its own chips locally;
   this is the shared version the explorer uses). */
.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--ink-mid);
  cursor: pointer;
}
.chip:hover { border-color: var(--teal); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--amber-soft);
  border-color: rgba(245, 182, 66, 0.45);
  color: var(--amber);
  font-weight: 600;
}
.chip:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

@media (pointer: coarse) {
  .chip { padding: 0.7rem 0.95rem; }
}

/* ============================================================
   CODEX COMPONENTS
   Everything below is specific to Peptide Codex.
   The palette above is untouched — only new classes here.
   ============================================================ */

/* --- evidence tier chips -------------------------------------
   Tier drives colour meaning across the whole site:
   strong human evidence reads teal/blue, animal & below fade
   toward dim. Never green-for-good — this is not a score. */
.tier {
  display: inline-flex; align-items: center; gap: .4em;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .04em;
  text-transform: uppercase; padding: .22em .55em; border-radius: 3px;
  border: 1px solid currentColor; white-space: nowrap; line-height: 1.4;
}
.tier::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: currentColor; }
.tier-a { color: var(--teal);     background: var(--teal-soft); }
.tier-b { color: var(--blue);     background: var(--blue-soft); }
.tier-c { color: var(--blue);     background: transparent; opacity: .88; }
.tier-d { color: var(--amber);    background: var(--amber-soft); }
.tier-e { color: var(--ember);    background: var(--ember-soft); }
.tier-f { color: var(--ink-dim);  background: transparent; }
.tier-g { color: var(--danger);   background: var(--danger-soft); }

.tier-legend { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.tier-legend .tier { cursor: default; }

/* --- sequence display ----------------------------------------
   Residues are individually addressable so seq.js can mark
   lysine (and terminal position) without string surgery. */
.seq {
  font-family: var(--mono); font-size: 1.35rem; letter-spacing: .18em;
  display: inline-flex; flex-wrap: wrap; gap: .12em; word-break: break-all;
}
.seq .res {
  display: inline-block; padding: .12em .18em; border-radius: 3px;
  color: var(--ink); background: var(--bg-inset);
  border: 1px solid var(--line-soft);
}
.seq .res.is-lys {
  color: var(--amber); background: var(--amber-soft);
  border-color: var(--amber); font-weight: 600;
}
.seq .res.is-terminal { box-shadow: 0 2px 0 var(--teal); }
.seq-mod {
  font-family: var(--mono); font-size: .78rem; color: var(--teal);
  border: 1px dashed var(--teal); border-radius: 3px;
  padding: .15em .4em; margin-left: .4em; vertical-align: middle;
}
.seq-inline { font-family: var(--mono); letter-spacing: .12em; color: var(--amber); }

/* --- provenance / honesty chips ------------------------------
   These exist to make an unverified field VISIBLE, not hidden.
   An empty sequence with a chip is a feature; a guessed one is a bug. */
.chip-status {
  display: inline-block; font-family: var(--mono); font-size: .7rem;
  text-transform: uppercase; letter-spacing: .05em;
  padding: .2em .5em; border-radius: 3px; border: 1px solid currentColor;
}
.chip-verified      { color: var(--teal);    background: var(--teal-soft); }
.chip-single_source { color: var(--amber);   background: var(--amber-soft); }
.chip-unverified    { color: var(--danger);  background: var(--danger-soft); }

.verdict { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.verdict-supported    { color: var(--teal); }
.verdict-mixed        { color: var(--amber); }
.verdict-unsupported  { color: var(--danger); }
.verdict-untested     { color: var(--ink-dim); }
.verdict-contradicted { color: var(--danger); font-weight: 600; }

/* --- the dose framing band -----------------------------------
   Rendered automatically above EVERY study table from
   taxonomy.json. Deliberately hard to miss and impossible to
   forget per-entry, because it is never authored per-entry. */
.dose-frame {
  border-left: 3px solid var(--ember);
  background: var(--ember-soft);
  padding: .85rem 1rem; border-radius: 0 4px 4px 0;
  margin: 1.25rem 0 .75rem;
  font-size: .9rem; color: var(--ink-mid); line-height: 1.55;
}
.dose-frame b { color: var(--ember); }

/* --- study table ---------------------------------------------- */
.study-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: .5rem 0 1.5rem; }
.study-table th {
  text-align: left; font-family: var(--mono); font-size: .7rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink-dim);
  border-bottom: 1px solid var(--line); padding: .5rem .6rem; font-weight: 500;
}
.study-table td { border-bottom: 1px solid var(--line-soft); padding: .6rem; vertical-align: top; color: var(--ink-mid); }
.study-table tr:hover td { background: var(--bg-raise); }
.study-table .verbatim {
  font-family: var(--mono); font-size: .78rem; color: var(--ink-dim);
  display: block; margin-top: .35rem; padding-left: .6rem;
  border-left: 2px solid var(--line);
}
.table-scroll { overflow-x: auto; }

/* --- "what we don't know" ------------------------------------
   A required field, so it gets required-looking treatment. */
.unknowns { border: 1px solid var(--amber); background: var(--amber-soft); border-radius: 4px; padding: 1rem 1.25rem; margin: 2rem 0; }
.unknowns .note-label { color: var(--amber); }
.unknowns ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.unknowns li { margin: .35rem 0; color: var(--ink-mid); }

/* --- filter bar ----------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 1.5rem 0; padding: 1rem; background: var(--bg-raise); border: 1px solid var(--line); border-radius: 6px; }
.filters input[type="search"] {
  flex: 1 1 15rem; background: var(--bg-inset); border: 1px solid var(--line);
  color: var(--ink); padding: .55rem .75rem; border-radius: 4px;
  font-family: var(--sans); font-size: .95rem;
}
.filters input[type="search"]:focus { outline: none; border-color: var(--teal); }
.filter-chip {
  font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
  padding: .3em .65em; border-radius: 3px; cursor: pointer; user-select: none;
  background: transparent; border: 1px solid var(--line); color: var(--ink-dim);
}
.filter-chip:hover { border-color: var(--ink-dim); color: var(--ink-mid); }
.filter-chip[aria-pressed="true"] { background: var(--teal-soft); border-color: var(--teal); color: var(--teal); }
.filter-count { font-family: var(--mono); font-size: .8rem; color: var(--ink-dim); margin-left: auto; }

/* --- computed findings band (bioregulators flagship) ----------
   Numbers here are COMPUTED from the dataset at render time,
   never authored — so the page cannot drift from the data. */
.finding {
  border: 1px solid var(--teal); background: var(--teal-soft);
  border-radius: 6px; padding: 1.5rem; margin: 2rem 0;
}
.finding .big { font-family: var(--serif); font-size: 2.4rem; color: var(--teal); line-height: 1.1; }
.finding .finding-sub { color: var(--ink-mid); font-size: .92rem; margin-top: .5rem; }
.finding .finding-list { font-family: var(--mono); font-size: .82rem; color: var(--ink-dim); margin-top: 1rem; line-height: 1.9; }

/* --- misc ------------------------------------------------------ */
.meta-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.card .seq-inline { font-size: .85rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--ink-dim); }
.crumb { font-family: var(--mono); font-size: .78rem; color: var(--ink-dim); margin-bottom: 1rem; }
.crumb a { color: var(--teal); }

.filters select {
  background: var(--bg-inset); border: 1px solid var(--line); color: var(--ink);
  padding: .45rem .6rem; border-radius: 4px;
  font-family: var(--mono); font-size: .8rem;
}
.filters select:focus { outline: none; border-color: var(--teal); }
