/* ============================================================
   PeptideHelper.org — editorial / laboratory aesthetic
   ============================================================ */

:root {
  /* palette — light, clinical, clean */
  --bg: #fafbfa;            /* near-white with a whisper of green */
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --ink: #1f2523;           /* soft charcoal, not pure black */
  --ink-muted: #6b736e;
  --ink-soft: #9ea49f;
  --rule: #e8ebe7;
  --rule-soft: #f1f3ef;
  --primary: #2f9c6a;        /* vibrant sage-emerald */
  --primary-ink: #185e3d;
  --primary-soft: #cfecd9;
  --accent: #e25c3b;          /* vibrant terracotta */
  --accent-soft: #fbd8cb;
  --slate: #5d6b78;
  --slate-soft: #e2e8ee;
  --warn: #e3a61f;
  --warn-soft: #fbe5a5;
  --ok: #38ad66;
  --ok-soft: #cdedd6;
  --accent-strong: #c45a44;   /* between warn and accent — used for moderate-high risk */

  /* Always-dark ink for use on data-driven hex backgrounds that stay light in both themes. */
  --category-ink: #1f2523;
  --on-accent: #ffffff;
  --scrim: rgba(23, 28, 22, 0.55);

  /* Per-view accent palette — quiet personality per tab.
     Aliases reuse semantic tokens; three are net-new and need dark-mode overrides. */
  --view-about: var(--slate);              /* neutral colophon */
  --view-discover: var(--primary);         /* welcoming entry */
  --view-browse: #3d6b6b;                  /* muted teal — encyclopedic */
  --view-compare: var(--accent);           /* decisive head-to-head */
  --view-evaluator: var(--warn);           /* analysis with caution */
  --view-matrix: #4a6480;                  /* slate-indigo — structural */
  --view-calculator: var(--ok);            /* math / computation */
  --view-essential-guides: #a36c2c;        /* leather-amber — practitioner manual */

  /* Sticky layout offsets — overridden in narrow media queries */
  --header-offset: 92px;

  /* type */
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* motion */
  --t-fast: 140ms cubic-bezier(.2,.8,.2,1);
  --t-med: 280ms cubic-bezier(.2,.8,.2,1);
  --shadow-sm: 0 1px 2px rgba(23,28,22,0.05);
  --shadow-md: 0 6px 20px rgba(23,28,22,0.08), 0 1px 2px rgba(23,28,22,0.04);
  --shadow-lg: 0 18px 48px rgba(23,28,22,0.15), 0 2px 6px rgba(23,28,22,0.05);
  --radius: 4px;
  --radius-lg: 8px;

  /* z-index scale (semantic, replaces ad-hoc numerics).
     Matrix tokens stack within the matrix scroller; page tokens stack globally. */
  --z-matrix-row: 2;
  --z-matrix-col: 3;
  --z-matrix-hover: 4;
  --z-matrix-corner: 5;
  --z-popover: 20;
  --z-header: 40;
  --z-modal: 100;
}

[data-theme="dark"] {
  --bg: #111311;
  --bg-elevated: #1a1d19;
  --bg-card: #1f2320;
  --ink: #ece8dd;
  --ink-muted: #b4b5ac;
  --ink-soft: #818178;
  --rule: #2f332d;
  --rule-soft: #252925;
  --primary: #5cc78e;
  --primary-ink: #d8f0e1;
  --primary-soft: #1c3a2a;
  --accent: #ee7a5a;
  --accent-soft: #4a2a22;
  --slate: #b5bfc9;
  --slate-soft: #232a31;
  --warn: #f0bf40;
  --warn-soft: #4a3a1c;
  --ok: #6fd28a;
  --ok-soft: #1a3323;
  --accent-strong: #d47a63;   /* dark-mode lift of accent-strong */
  --scrim: rgba(0, 0, 0, 0.70);

  /* Per-view accents — only the net-new tones need overrides; aliases inherit through their base token. */
  --view-browse: #6fa3a3;
  --view-matrix: #8aa3c0;
  --view-essential-guides: #d49a5e;
  /* --category-ink intentionally NOT re-declared in dark mode — data hex backgrounds stay light */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 6px 20px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.25);
  --shadow-lg: 0 18px 48px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.3);
}

/* WCAG 2.3.3 — collapse animations and transitions globally for users
   who request reduced motion. Per-rule motion can opt back in if essential. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body {
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 0.88em; }

/* ==========================================================
   Header
   ========================================================== */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  backdrop-filter: saturate(140%) blur(4px);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 48px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 36px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 34px; height: 34px;
  stroke: var(--primary);
  fill: var(--primary);
  fill-opacity: 0.15;
  stroke-width: 1.5;
}
.brand-mark circle { fill-opacity: 1; }
.brand-title {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-sub {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}

.nav-tabs {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.tab {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 999px;
  color: var(--ink-muted);
  transition: all var(--t-fast);
  border: 1px solid transparent;
}
.tab:hover {
  color: var(--ink);
  background: var(--rule-soft);
  text-decoration: none;
}
.tab.active {
  color: var(--primary-ink);
  background: var(--primary-soft);
  border-color: var(--primary);
}

.theme-toggle {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--t-fast);
  font-size: 15px;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: inline; }

/* ==========================================================
   Disclaimer banner
   ========================================================== */
.disclaimer-banner {
  background: var(--warn-soft);
  color: var(--ink);
  font-size: 12.5px;
  padding: 8px 48px;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}

/* FTC affiliate disclosure banner. Hidden by default; surfaced by
   toggleAffiliateBanner() on routes that expose vendor links. */
.affiliate-banner {
  background: var(--slate-soft);
  color: var(--ink);
  font-size: 12.5px;
  padding: 8px 48px;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}
.affiliate-banner[hidden] { display: none; }
.affiliate-banner a {
  color: var(--primary-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
[data-theme="dark"] .affiliate-banner a { color: var(--primary); }
@media (max-width: 768px) {
  .affiliate-banner { padding: 8px 18px; font-size: 11.5px; }
}

/* Promo chip — used inside the modal vendor-list rows. Clicking anywhere
   on the chip copies the discount code to the clipboard. */
.vendor-promo {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 8px 6px 10px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--rule));
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.vendor-promo:hover,
.vendor-promo:focus-within {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 4%, var(--bg-elevated));
}
.vendor-promo-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--primary);
  padding: 3px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}
[data-theme="dark"] .vendor-promo-tag { color: #0f1310; }
.vendor-promo-text {
  font-size: 12.5px;
  color: var(--ink);
}
.vendor-promo-code {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-ink);
  background: color-mix(in srgb, var(--primary) 14%, var(--bg-elevated));
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  user-select: all;
}
[data-theme="dark"] .vendor-promo-code { color: var(--primary); }
.vendor-promo-copy {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.vendor-promo-copy:hover {
  border-color: var(--primary);
  color: var(--primary-ink);
}
[data-theme="dark"] .vendor-promo-copy:hover { color: var(--primary); }
.vendor-promo.copied .vendor-promo-copy {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
[data-theme="dark"] .vendor-promo.copied .vendor-promo-copy { color: #0f1310; }
.vendor-promo.copied .vendor-promo-copy::before { content: '✓ '; }
@media (max-width: 540px) {
  .vendor-promo { gap: 8px; }
  .vendor-promo-text { font-size: 12px; flex-basis: 100%; order: 4; }
}

/* ==========================================================
   Main view
   ========================================================== */
.view-root {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 48px;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 32px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.view-header h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 38px;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}
.view-header .eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
  display: block;
}
.view-header .count {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-muted);
}

/* Per-view personality — coordinated 2px accent underline + glyph tint per tab.
   `data-view="X"` on the view-header drives both the border color and the glyph color. */
.view-header[data-view] {
  border-bottom-width: 2px;
  border-bottom-color: var(--view-color, var(--rule));
}
.view-header-lead {
  display: flex;
  align-items: center;
  gap: 14px;
}
.view-glyph {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--view-color, var(--ink-soft));
}
.view-glyph svg {
  display: block;
  width: 28px;
  height: 28px;
}
.view-header[data-view="about"]            { --view-color: var(--view-about); }
.view-header[data-view="discover"]         { --view-color: var(--view-discover); }
.view-header[data-view="browse"]           { --view-color: var(--view-browse); }
.view-header[data-view="compare"]          { --view-color: var(--view-compare); }
.view-header[data-view="evaluator"]        { --view-color: var(--view-evaluator); }
.view-header[data-view="matrix"]           { --view-color: var(--view-matrix); }
.view-header[data-view="calculator"]       { --view-color: var(--view-calculator); }
.view-header[data-view="info"]             { --view-color: var(--view-essential-guides); }

/* Active-tab pill picks up the view's accent in the border ring only — keeps
   the chrome calm while still tying the active state to the view's color. */
.tab.active[data-route="about"]            { border-color: var(--view-about); }
.tab.active[data-route="browse"]           { border-color: var(--view-browse); }
.tab.active[data-route="compare"]          { border-color: var(--view-compare); }
.tab.active[data-route="evaluator"]        { border-color: var(--view-evaluator); }
.tab.active[data-route="matrix"]           { border-color: var(--view-matrix); }
.tab.active[data-route="calculator"]       { border-color: var(--view-calculator); }
.tab.active[data-route="info"]             { border-color: var(--view-essential-guides); }
/* Discover keeps the existing primary border (--view-discover === --primary). */

/* Decorative molecular divider */
.molecule-divider {
  display: block;
  margin: 42px auto;
  width: 140px;
  opacity: 0.45;
}
.molecule-divider circle { fill: var(--ink-soft); }
.molecule-divider line { stroke: var(--ink-soft); stroke-width: 1; }

/* ==========================================================
   Browse view — search/filter + card grid
   ========================================================== */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  align-items: stretch;
}
.search-input {
  flex: 1;
  padding: 14px 18px;
  font: inherit;
  font-size: 15px;
  border: 1px solid var(--rule);
  background: var(--bg-card);
  border-radius: var(--radius);
  color: var(--ink);
  transition: border-color var(--t-fast);
}
.search-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  align-items: center;
}
.filter-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-right: 8px;
  font-weight: 500;
}

/* ----- Filter dropdown bar ----- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}
.filter-dropdown { position: relative; }
.filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}
.filter-trigger:hover { border-color: var(--primary); color: var(--ink); }
.filter-trigger.has-active {
  border-color: var(--primary);
  color: var(--primary-ink);
  background: var(--primary-soft);
}
.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  background: var(--primary);
  color: var(--on-accent);
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 600;
}
.filter-caret {
  font-size: 10px;
  color: var(--ink-soft);
  transition: transform var(--t-fast);
}
.filter-dropdown.open .filter-caret { transform: rotate(180deg); }
.filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: var(--z-popover);
  min-width: 100%;
  max-width: 360px;
  max-height: 320px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: none;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-dropdown.open .filter-menu { display: flex; }
.filter-clear {
  margin-left: auto;
  padding: 6px 12px;
  background: transparent;
  border: none;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.filter-clear:hover { color: var(--accent); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all var(--t-fast);
  user-select: none;
}
.chip:hover { border-color: var(--primary); color: var(--ink); }
.chip.active {
  background: var(--primary);
  color: var(--on-accent);
  border-color: var(--primary);
}
.chip-count {
  font-family: var(--mono);
  font-size: 10px;
  opacity: 0.7;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  margin-top: 24px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--t-med);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--ink-soft);
}
.card {
  cursor: pointer;
}
.card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
}
.card-category-strip {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.card-rank {
  position: absolute;
  top: 14px; right: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
}
.card-name {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  color: var(--ink);
  line-height: 1.15;
}
.card-aliases {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 12px;
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-category {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 3px;
  margin-bottom: 10px;
  align-self: flex-start;
}
.card-benefit {
  color: var(--ink-muted);
  font-size: 13.5px;
  line-height: 1.45;
  margin-top: auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
}

.badge {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 3px;
  background: var(--slate-soft);
  color: var(--slate);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.badge.evidence-fda { background: var(--ok-soft); color: var(--ok); }
.badge.evidence-phase3 { background: var(--primary-soft); color: var(--primary-ink); }
.badge.evidence-phase2 { background: var(--slate-soft); color: var(--slate); }
.badge.evidence-anec { background: var(--warn-soft); color: var(--warn); }
.badge.evidence-preclin { background: var(--rule-soft); color: var(--ink-muted); }
.badge.stack { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }

/* ==========================================================
   Modal
   ========================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: var(--z-modal);
  padding: 48px 24px;
  overflow-y: auto;
}
/* Scroll-lock body while the modal is open so the page doesn't scroll behind it */
body.modal-open { overflow: hidden; }
.modal-backdrop.open { display: flex; animation: fadeIn var(--t-med); }
.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  max-width: 780px;
  width: 100%;
  padding: 40px 48px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: slideUp var(--t-med);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 4px;
}
.modal-close:hover { background: var(--rule-soft); color: var(--ink); }

.modal h2 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
  line-height: 1.1;
}
.modal .aliases-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.modal .field-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 24px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  margin-top: 16px;
}
.modal .field-label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  padding-top: 3px;
}
.modal .field-value {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.modal .stack-mention {
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  padding: 12px 16px;
  margin-top: 20px;
  border-radius: 2px;
  font-size: 13px;
}
.modal .stack-mention strong {
  color: var(--primary-ink);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================
   Evaluator view — two-column layout
   ========================================================== */
.evaluator-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 960px) {
  .evaluator-layout { grid-template-columns: 1fr; }
}

.picker-panel {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: sticky;
  top: var(--header-offset);
}
@media (max-width: 960px) {
  .picker-panel { position: static; }
}
.result-panel {
  background: transparent;
  border: none;
  padding: 0;
}

.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}
.picker-header h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  letter-spacing: -0.01em;
}
.selected-count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
  background: var(--rule-soft);
  padding: 3px 9px;
  border-radius: 3px;
}

.picker-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.picker-search {
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--rule);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  color: var(--ink);
}
.picker-search:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.picker-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.btn-clear, .btn-share {
  padding: 7px 10px;
  font-size: 12px;
  font-family: var(--sans);
  font-weight: 500;
  border: 1px solid var(--rule);
  background: var(--bg-elevated);
  color: var(--ink-muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: center;
  white-space: nowrap;
}
.btn-clear:hover { border-color: var(--accent); color: var(--accent); }
.btn-share:hover { border-color: var(--primary); color: var(--primary); }

.picker-list {
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}
.picker-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule-soft);
  cursor: pointer;
  transition: background var(--t-fast);
  align-items: center;
}
.picker-row:last-child { border-bottom: none; }
.picker-row:hover { background: var(--rule-soft); }
.picker-row.selected { background: var(--primary-soft); }
.picker-row input[type="checkbox"] {
  margin: 0;
  accent-color: var(--primary);
}
.picker-row .row-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
.picker-row .row-meta {
  font-size: 11px;
  color: var(--ink-soft);
  font-family: var(--mono);
}

.toggle-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--rule);
}
.toggle-section h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin: 0 0 10px;
  font-weight: 600;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--ink-muted);
  cursor: pointer;
}
.toggle-label input[type="checkbox"] {
  accent-color: var(--accent);
}

/* Shared: class-chip used by modal + evaluator; risk-pill used by evaluator entries */
.class-chip {
  font-size: 10.5px;
  padding: 2px 8px;
  background: var(--slate-soft);
  color: var(--slate);
  border-radius: 3px;
  font-family: var(--mono);
  font-weight: 500;
}

.risk-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
  margin-left: 4px;
  font-family: var(--mono);
}
.risk-pill.high { background: var(--accent); color: var(--on-accent); }
.risk-pill.moderate-high { background: var(--accent-strong); color: var(--on-accent); }
.risk-pill.moderate { background: var(--warn); color: var(--on-accent); }

/* ==========================================================
   Evaluator results — site-native grammar
   Rounded cards, sage/clay palette, top-edge severity strips,
   eyebrow + h2 section heads.
   ========================================================== */

.eval-empty {
  text-align: center;
  padding: 72px 20px 80px;
}
.eval-empty .molecule-divider {
  margin: 0 auto 20px;
}
.eval-empty-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.eval-empty-sub {
  font-size: 14px;
  color: var(--ink-muted);
  max-width: 44ch;
  margin: 0 auto;
  line-height: 1.55;
}

.eval-results {
  animation: evalRise var(--t-med);
}
@keyframes evalRise {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.eval-head .eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
  display: block;
}
.eval-head h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}

.section-caption {
  font-size: 13px;
  color: var(--ink-muted);
  margin: 0;
  line-height: 1.5;
}

/* --- Verdict ribbon: the one tinted block --- */
.eval-verdict {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  margin: 10px 0 28px;
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--ink-soft);
  background: var(--rule-soft);
}
.eval-verdict-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 600;
  line-height: 1;
  background: var(--ink-soft);
  color: var(--on-accent);
}
.eval-verdict-body { min-width: 0; }
.eval-verdict-head {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink);
}
.eval-verdict-sub {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 4px;
}
.eval-verdict-caption {
  font-size: 13px;
  color: var(--ink-muted);
  margin-top: 6px;
  line-height: 1.5;
}
.eval-verdict-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  max-width: 320px;
}
.eval-verdict-jump {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--ink-muted);
  border: 1px solid var(--rule);
  transition: all var(--t-fast);
  text-decoration: none;
  white-space: nowrap;
}
.eval-verdict-jump:hover {
  color: var(--ink);
  border-color: var(--ink-soft);
  text-decoration: none;
}
.eval-verdict--alert   { background: var(--accent-soft);  border-left-color: var(--accent); }
.eval-verdict--alert .eval-verdict-icon { background: var(--accent); }
.eval-verdict--ok      { background: var(--primary-soft); border-left-color: var(--primary); }
.eval-verdict--ok    .eval-verdict-icon { background: var(--primary); }
.eval-verdict--warn    { background: var(--warn-soft);    border-left-color: var(--warn); }
.eval-verdict--warn  .eval-verdict-icon { background: var(--warn); }
.eval-verdict--neutral { background: var(--rule-soft);    border-left-color: var(--ink-soft); }

/* --- Metric strip --- */
.eval-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 32px;
}
.eval-metric {
  position: relative;
  display: grid;
  grid-template-columns: 10px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 2px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: all var(--t-fast);
}
.eval-metric::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--ink-soft);
  transition: width var(--t-fast);
}
a.eval-metric:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
a.eval-metric:hover::before { width: 3px; }
.eval-metric-dot {
  grid-row: 1 / span 2;
  align-self: center;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-soft);
}
.eval-metric-value {
  grid-column: 2;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.eval-metric-label {
  grid-column: 2;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.eval-metric--alert .eval-metric-dot { background: var(--accent); }
.eval-metric--alert::before           { background: var(--accent); }
.eval-metric--ok    .eval-metric-dot { background: var(--primary); }
.eval-metric--ok::before              { background: var(--primary); }
.eval-metric--warn  .eval-metric-dot { background: var(--warn); }
.eval-metric--warn::before            { background: var(--warn); }
.eval-metric--info  .eval-metric-dot { background: var(--slate); }
.eval-metric--info::before            { background: var(--slate); }
.eval-metric--zero .eval-metric-dot { background: var(--rule); }
.eval-metric--zero .eval-metric-value { color: var(--ink-soft); }

/* --- Section slug: the quiet, left-ruled header used by every section --- */
.eval-slug {
  margin: 56px 0 14px;
  padding-left: 14px;
  border-left: 3px solid var(--ink-soft);
  scroll-margin-top: 24px;
}
.eval-slug-eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 3px;
  background: var(--rule-soft);
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.eval-slug h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 4px;
  color: var(--ink);
}
.eval-slug .section-caption { font-size: 13px; }

.eval-slug--alert   { border-left-color: var(--accent); }
.eval-slug--alert   .eval-slug-eyebrow { background: var(--accent);  color: var(--on-accent); }
.eval-slug--ok      { border-left-color: var(--primary); }
.eval-slug--ok      .eval-slug-eyebrow { background: var(--primary); color: var(--on-accent); }
.eval-slug--warn    { border-left-color: var(--warn); }
.eval-slug--warn    .eval-slug-eyebrow { background: var(--warn);    color: var(--on-accent); }
.eval-slug--info    { border-left-color: var(--slate); }
.eval-slug--info    .eval-slug-eyebrow { background: var(--slate);   color: var(--on-accent); }

/* --- Flat entry: thin left bar on a tinted ground, no outer frame --- */
.eval-flat-entry {
  position: relative;
  padding: 14px 16px 14px 18px;
  margin-top: 10px;
  border-left: 4px solid var(--ink-soft);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-soft) 8%, var(--bg-card));
}
.eval-flat-entry--alert {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-card));
}
.eval-flat-entry--ok {
  border-left-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, var(--bg-card));
}
.eval-flat-entry--warn {
  border-left-color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--bg-card));
}

.eval-entry-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.eval-entry-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--ink);
  flex: 1;
  line-height: 1.3;
}
.eval-entry-evidence,
.eval-entry-purpose {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.eval-entry-body p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 12px;
}
.eval-entry-meta {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 13px;
}
.eval-entry-meta dt {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-weight: 600;
  padding-top: 4px;
}
.eval-entry-meta dd {
  margin: 0;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  line-height: 1.5;
}
.eval-entry-meta dd.note {
  font-style: italic;
  color: var(--ink-muted);
  font-size: 12.5px;
}

/* class-chip severity modifiers */
.class-chip--alert { background: var(--accent-soft);  color: var(--accent); }
.class-chip--ok    { background: var(--primary-soft); color: var(--primary-ink); }
.class-chip--warn  { background: var(--warn-soft);    color: var(--warn); }

/* Near-miss cards */
.nearmiss-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}
.nearmiss-card {
  flex: 1 1 260px;
  min-width: 220px;
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.nearmiss-card .eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary-ink);
  display: block;
  margin-bottom: 4px;
}
.nearmiss-card-title {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.3;
}
.nearmiss-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.nearmiss-card-chips .chip {
  background: var(--bg-card);
  border-color: var(--primary);
  color: var(--primary-ink);
}
.nearmiss-card-chips .chip:hover {
  background: var(--primary);
  color: var(--on-accent);
}

/* Coverage matrix */
.coverage-wrap {
  overflow-x: auto;
  margin-top: 4px;
}
.coverage-matrix {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 11.5px;
  table-layout: fixed;
}
.coverage-matrix th,
.coverage-matrix td {
  padding: 5px 2px;
  text-align: center;
  font-weight: 400;
}
.coverage-matrix thead th {
  padding: 4px 2px;
  height: 110px;
  vertical-align: bottom;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-muted);
  font-weight: 500;
}
.coverage-head-vertical {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  letter-spacing: 0.01em;
  font-size: 12px;
  font-family: var(--sans);
  text-align: left;
  padding: 4px 0;
  display: inline-block;
  color: var(--ink-muted);
}
.coverage-matrix .matrix-corner {
  width: 170px;
  min-width: 150px;
  border-bottom-color: var(--rule);
  height: 110px;
}
.coverage-matrix .matrix-name {
  text-align: left;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  padding: 8px 10px 8px 0;
  letter-spacing: -0.005em;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coverage-matrix tbody td {
  border-bottom: 1px solid var(--rule-soft);
  padding: 6px 2px;
}
.coverage-matrix td .cov-dot {
  display: inline-block;
  border-radius: 50%;
  vertical-align: middle;
}
.coverage-matrix td.hit .cov-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent);
}
.coverage-matrix td.miss .cov-dot {
  width: 3px;
  height: 3px;
  background: var(--rule);
  opacity: 0.6;
}
.coverage-matrix tbody tr:hover { background: var(--rule-soft); }
.coverage-matrix tbody tr:hover .matrix-name { color: var(--primary-ink); }
.coverage-matrix tbody tr:hover td.hit .cov-dot {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent);
}

/* Row-total heat column */
.coverage-matrix .matrix-row-total-head {
  width: 44px;
  min-width: 44px;
  border-left: 1px solid var(--rule);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  vertical-align: middle;
  height: auto;
}
.coverage-matrix .matrix-row-total {
  border-left: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--primary-ink);
  padding: 6px 8px;
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--primary) 22%, transparent) var(--heat, 0%),
    transparent var(--heat, 0%)
  );
}
.coverage-matrix .matrix-row-total.zero {
  color: var(--ink-soft);
  background: none;
}

.coverage-matrix tfoot .matrix-total-label,
.coverage-matrix tfoot .matrix-total {
  border-top: 1px solid var(--rule);
  border-bottom: none;
  font-size: 11px;
  color: var(--ink-muted);
  padding-top: 6px;
}
.coverage-matrix tfoot .matrix-total-label {
  text-align: right;
  padding-right: 10px;
  border-right: 1px solid var(--rule);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
}
.coverage-matrix tfoot .matrix-total {
  position: relative;
  padding: 6px 2px 10px;
}
.coverage-matrix tfoot .matrix-total-num {
  display: block;
  font-family: var(--mono);
}
.coverage-matrix tfoot .matrix-total-bar {
  display: block;
  height: 3px;
  width: var(--bar, 0%);
  margin: 4px auto 0;
  background: var(--primary);
  border-radius: 2px;
  opacity: 0.7;
}
.coverage-matrix tfoot .matrix-total.zero { color: var(--ink-soft); opacity: 0.5; }
.coverage-matrix tfoot .matrix-total.zero .matrix-total-bar { display: none; }
.coverage-caption {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin: 12px 0 0;
  line-height: 1.5;
}

/* Class pill cloud (replaces vertical class rows) */
.class-pill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.class-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--rule-soft);
  color: var(--ink);
  line-height: 1.35;
  max-width: 100%;
}
.class-pill-name {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-muted);
  flex: 0 0 auto;
}
.class-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary-ink);
  border-radius: 999px;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}
.class-pill-peptides {
  font-size: 13px;
  color: var(--ink);
}

/* Sources — compact footnote block, no card frame */
.eval-footnotes {
  margin-top: 64px;
  border-top: 1px dashed var(--rule);
  padding-top: 18px;
}
.eval-footnotes-head { margin-bottom: 10px; }
.eval-footnotes-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}
.eval-footnotes .eval-ref-list {
  column-count: 2;
  column-gap: 32px;
}
.eval-footnotes .eval-ref-list li {
  break-inside: avoid;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 6px;
  padding: 5px 0;
  border-bottom: none;
}
.eval-footnotes .eval-ref-list .ref-text {
  font-size: 11.5px;
  color: var(--ink-muted);
  line-height: 1.45;
}

/* References — numbered list (also reused in footnotes) */
.eval-ref-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.eval-ref-list li {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--rule-soft);
}
.eval-ref-list li:last-child { border-bottom: none; }
.eval-ref-list li:target { background: var(--warn-soft); }
.eval-ref-list li.ref-flash { animation: refFlash 1.6s ease-out; }
@keyframes refFlash {
  0%   { background: var(--warn-soft); box-shadow: inset 3px 0 0 var(--warn); }
  100% { background: transparent;      box-shadow: inset 3px 0 0 transparent; }
}
.eval-ref-list .ref-num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  padding-top: 2px;
}
.eval-ref-list .ref-text {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* Citation superscripts */
.ref-sup {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  margin-left: 3px;
  vertical-align: super;
  line-height: 0;
  letter-spacing: 0.02em;
}
.ref-sup a {
  color: var(--ink-muted);
  text-decoration: none;
  padding: 0 1px;
}
.ref-sup a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 768px) {
  .eval-entry-meta { grid-template-columns: 1fr; gap: 2px; }
  .eval-entry-meta dt { padding-top: 10px; }
  .coverage-matrix { font-size: 10px; }
  .coverage-matrix .matrix-name { font-size: 12.5px; padding-right: 6px; }

  .eval-verdict {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
    text-align: left;
  }
  .eval-verdict-jumps { justify-content: flex-start; max-width: none; }
  .eval-metrics { grid-template-columns: repeat(3, 1fr); }
  .eval-footnotes .eval-ref-list { column-count: 1; }
  .class-pill { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .eval-metrics { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================
   About view
   ========================================================== */
.about-content {
  max-width: 720px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
}
.about-content h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 500;
  margin: 36px 0 12px;
  letter-spacing: -0.01em;
}
.about-content p {
  margin-bottom: 16px;
  color: var(--ink-muted);
}
.about-content ul {
  padding-left: 22px;
  color: var(--ink-muted);
}
.about-content li { margin-bottom: 6px; }
.about-content .full-disclaimer {
  background: var(--warn-soft);
  padding: 18px 22px;
  border-left: 3px solid var(--warn);
  border-radius: 2px;
  font-size: 13.5px;
  margin-top: 20px;
}

/* ==========================================================
   Footer
   ========================================================== */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-elevated);
  padding: 18px 48px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-soft);
}
.footer-meta { font-family: var(--mono); }
.footer-reviewed {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
}
.footer-reviewed time { color: var(--ink-muted); }
.footer-legal {
  max-width: 1400px;
  margin: 12px auto 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}
.footer-legal a {
  color: var(--ink-muted);
  text-decoration: none;
}
.footer-legal a:hover { color: var(--ink); text-decoration: underline; }
.footer-legal span { color: var(--ink-soft); }

/* Affiliate vendor list inside the modal */
.vendor-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--rule);
}
.vendor-section-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.vendor-section-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--ink);
}
.vendor-section-note {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-bottom: 12px;
  font-style: italic;
}
.vendor-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.vendor-list li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}
.vendor-row-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.vendor-list .vendor-name { font-weight: 500; color: var(--ink); }
.vendor-list .vendor-link {
  color: var(--primary-ink);
  text-decoration: none;
  font-size: 12.5px;
  font-family: var(--mono);
}
[data-theme="dark"] .vendor-list .vendor-link { color: var(--primary); }
.vendor-list .vendor-link::after { content: ' ↗'; opacity: 0.7; }

/* Inline source-footnote superscripts within field values */
sup.src-footnote {
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--primary-ink);
  margin-left: 1px;
  font-weight: 500;
}
[data-theme="dark"] sup.src-footnote { color: var(--primary); }

/* Per-peptide source citations */
.sources-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--rule);
}
.sources-list {
  margin: 0;
  padding-left: 22px;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.sources-list li { margin-bottom: 4px; }
.sources-list a {
  color: var(--primary-ink);
  text-decoration: none;
  word-break: break-word;
}
[data-theme="dark"] .sources-list a { color: var(--primary); }
.sources-list a:hover { text-decoration: underline; }

/* Path-B prerender shell — server-rendered preview of a single peptide page.
   Visible briefly before the SPA hydrates and replaces it with the modal,
   plus the entire reading surface for crawlers and no-JS visitors. */
.prerender-shell {
  max-width: 720px;
  margin: 0 auto;
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.65;
}
.prerender-shell h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 38px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.prerender-shell .prerender-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
.prerender-shell .prerender-aliases {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 18px;
}
.prerender-shell p { margin-bottom: 12px; color: var(--ink-muted); }
.prerender-shell strong { color: var(--ink); }
.prerender-shell .prerender-loading {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-soft);
  font-style: italic;
}
.prerender-sources {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--rule);
}
.prerender-sources h2 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: 8px;
}
.prerender-sources ol {
  margin: 0;
  padding-left: 22px;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.prerender-sources li { margin-bottom: 4px; }
.prerender-sources a {
  color: var(--primary-ink);
  text-decoration: none;
  word-break: break-word;
}
[data-theme="dark"] .prerender-sources a { color: var(--primary); }
.prerender-sources a:hover { text-decoration: underline; }

/* Browse-card affiliate-chevron — only on cards for peptides with vendors */
.card .card-affiliate-chevron {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 14px;
  color: var(--ink-soft);
  font-family: var(--mono);
}

/* Inline affiliate pill linking to Certified Peptides — surfaces on every
   peptide container in Browse, Discover, Compare, Evaluator, and Matrix
   when the peptide is stocked on the certified-pep.com storefront.
   Uses the site's own --primary sage-emerald token so it matches the rest
   of the site's green and auto-adapts in dark mode. */
.cert-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  border: 1px solid var(--primary);
  text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}
.cert-link:hover,
.cert-link:focus-visible {
  background: color-mix(in srgb, var(--primary) 88%, black);
  border-color: color-mix(in srgb, var(--primary) 88%, black);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 40%, transparent);
  outline: none;
}
.cert-link-arrow {
  font-family: var(--mono);
  font-size: 11px;
  transition: transform var(--t-fast);
}
.cert-link:hover .cert-link-arrow,
.cert-link:focus-visible .cert-link-arrow {
  transform: translate(2px, -2px);
}

/* Per-view placement tweaks — keeps the pill's footprint tight inside each
   container without altering the pill itself. */
.card .cert-link {
  margin-top: 10px;
  align-self: flex-start;
}
.discover-peptide-mini .cert-link {
  margin-top: 8px;
  align-self: flex-start;
}
.compare-cell--header .cert-link {
  margin-top: 8px;
}
.picker-row .cert-link {
  /* Grid column 4 — sits flush right of row-meta */
}

/* Matrix detail surfaces both peptides; group them as a labeled pair below the
   relationship copy so the link reads as "buy this specific compound", not a
   loose afterthought. */
.matrix-detail-cert {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed color-mix(in srgb, var(--ink-soft) 35%, transparent);
}
.matrix-detail-cert-pair {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-muted);
}
.matrix-detail-cert-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink);
  letter-spacing: -0.005em;
}

/* Legal-page shell (privacy/terms/disclosure/methodology) reuses about-content
   styling but adds dt/dd + section spacing. */
.legal-shell h2 {
  margin-top: 28px;
}
.legal-shell h3 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  margin-top: 18px;
  margin-bottom: 8px;
  color: var(--ink);
}
.legal-shell dl {
  margin: 12px 0 18px;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
}
.legal-shell dt {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding-top: 2px;
}
.legal-shell dd { margin: 0; color: var(--ink-muted); }
.legal-shell .review-stamp {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
@media (max-width: 768px) {
  .legal-shell dl { grid-template-columns: 1fr; }
}

/* ==========================================================
   Responsive
   ========================================================== */
@media (max-width: 768px) {
  .header-inner { padding: 12px 18px; grid-template-columns: auto 1fr; }
  .nav-tabs { grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; }
  .disclaimer-banner { padding: 8px 18px; font-size: 11.5px; }
  .view-root { padding: 24px 18px; }
  .view-header h1 { font-size: 28px; }
  .modal { padding: 28px 22px; }
  .modal .field-grid { grid-template-columns: 1fr; gap: 4px 0; }
  .modal .field-label { padding-top: 8px; }
  .site-footer { padding: 14px 18px; }
  .footer-inner { flex-direction: column; gap: 6px; text-align: center; }
}

/* ==========================================================
   Calculator view
   ========================================================== */
.calc-lede {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--ink-muted);
  max-width: 62ch;
  line-height: 1.5;
}
.calc-grid {
  display: grid;
  grid-template-columns: minmax(320px, 460px) 1fr;
  gap: 28px;
  align-items: start;
}
.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.calc-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.calc-card-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.calc-sub-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}
.calc-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.calc-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font: inherit;
  font-family: var(--mono);
  font-size: 14px;
  border: 1px solid var(--rule);
  background: var(--bg-card);
  border-radius: var(--radius);
  color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.calc-input:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.calc-select {
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--rule);
  background: var(--bg-card);
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
  min-width: 84px;
}
.calc-unit-fixed {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-muted);
  background: var(--rule-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  min-width: 56px;
  justify-content: center;
}
.calc-hint {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
}
.calc-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.calc-chip {
  padding: 5px 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.calc-chip.active {
  background: var(--primary-soft);
  color: var(--primary-ink);
  border-color: var(--primary);
}
.calc-custom-freq {
  max-width: 160px;
  margin-top: 2px;
}

/* Worksheet */
.calc-worksheet {
  position: sticky;
  top: 92px;
}
.calc-worksheet-inner {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 26px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.calc-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.calc-step {
  display: flex;
  align-items: center;
  gap: 10px;
}
.calc-step-num {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--rule-soft);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}
.calc-pill {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--rule-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-muted);
  flex-wrap: wrap;
}
.calc-pill-label {
  color: var(--ink-soft);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.14em;
}
.calc-pill-eq {
  color: var(--ink-muted);
}
.calc-pill-val {
  margin-left: auto;
  color: var(--ink);
  font-weight: 500;
}
.calc-pill-val--final {
  color: var(--primary-ink);
  font-weight: 600;
}
.calc-pill-unit {
  color: var(--ink-soft);
  font-size: 11.5px;
  margin-left: 3px;
}
.calc-placeholder {
  color: var(--ink-soft);
  font-style: italic;
  border-bottom: 1px dashed var(--rule);
  padding-bottom: 1px;
}
.calc-result {
  margin-top: 6px;
  padding: 18px 20px 16px;
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: var(--radius-lg);
}
.calc-result-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary-ink);
  opacity: 0.75;
}
.calc-result-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}
.calc-result-num {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--primary-ink);
}
.calc-result-num--empty {
  color: var(--ink-soft);
}
.calc-result-unit {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--primary-ink);
  letter-spacing: 0.08em;
  text-transform: lowercase;
}
.calc-meta {
  margin: 14px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--primary);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  font-family: var(--mono);
  font-size: 11.5px;
}
.calc-meta dt {
  color: var(--primary-ink);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10.5px;
}
.calc-meta dd {
  margin: 0;
  color: var(--primary-ink);
}
.calc-notices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.calc-notice {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.45;
  border: 1px solid var(--rule);
  background: var(--rule-soft);
  color: var(--ink-muted);
}
.calc-notice--warn {
  background: var(--warn-soft);
  border-color: var(--warn);
  color: var(--ink);
}
.calc-notice--info {
  background: var(--rule-soft);
  border-color: var(--rule);
  color: var(--ink-muted);
}

@media (max-width: 900px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-worksheet { position: static; }
  .calc-result-num { font-size: 44px; }
}

/* ==========================================================
   Discover view — goal cards + detail panel
   ========================================================== */
.discover-lede {
  font-size: 14px;
  color: var(--ink-muted);
  max-width: 64ch;
  margin: -8px 0 28px;
  line-height: 1.55;
}
.discover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.discover-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px 22px 20px;
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.discover-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--ink-soft) 25%, transparent);
}
.discover-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.discover-card-strip {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: var(--ink-soft);
  transition: width var(--t-fast);
}
.discover-card:hover .discover-card-strip,
.discover-card:focus .discover-card-strip { width: 6px; }
.discover-card-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.discover-card-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}
.discover-card-rationale {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0;
}

/* Per-tone strip + eyebrow accents (no new vars — reuse tokens) */
.discover-card--accent  .discover-card-strip { background: var(--accent); }
.discover-card--primary .discover-card-strip { background: var(--primary); }
.discover-card--slate   .discover-card-strip { background: var(--slate); }
.discover-card--warn    .discover-card-strip { background: var(--warn); }
.discover-card--mixed   .discover-card-strip {
  background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 100%);
}
.discover-card--accent  .discover-card-eyebrow { color: var(--accent); }
.discover-card--primary .discover-card-eyebrow { color: var(--primary-ink); }
.discover-card--slate   .discover-card-eyebrow { color: var(--slate); }
.discover-card--warn    .discover-card-eyebrow { color: var(--warn); }
.discover-card--mixed   .discover-card-eyebrow {
  color: color-mix(in srgb, var(--accent) 70%, var(--primary) 30%);
}

/* Goal detail panel */
.discover-breadcrumb { margin-bottom: 10px; }
.discover-crumb {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.discover-crumb:hover { color: var(--primary); text-decoration: none; }
.discover-detail-head { align-items: flex-start; }
.discover-eyebrow--accent  { color: var(--accent); }
.discover-eyebrow--primary { color: var(--primary-ink); }
.discover-eyebrow--slate   { color: var(--slate); }
.discover-eyebrow--warn    { color: var(--warn); }
.discover-eyebrow--mixed   { color: color-mix(in srgb, var(--accent) 70%, var(--primary) 30%); }
.discover-summary {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.discover-summary strong { color: var(--ink); font-weight: 600; }
.discover-section { margin-top: 36px; }

.discover-peptide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.discover-peptide-mini {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--t-fast);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.discover-peptide-mini:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.discover-peptide-mini:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.discover-mini-rank {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
}
.discover-mini-name {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.2;
  padding-right: 32px;
}
.discover-mini-benefit {
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.45;
}

.discover-cross-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.discover-cross-chip {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  color: var(--ink-muted);
  padding: 6px 14px;
}
.discover-cross-chip:hover {
  border-color: var(--primary);
  color: var(--primary-ink);
  text-decoration: none;
}
.discover-cross-chip .chip-count {
  background: var(--rule-soft);
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
  color: var(--ink-soft);
}

@media (max-width: 768px) {
  .discover-grid { grid-template-columns: 1fr; }
  .discover-peptide-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   Compare view — head-to-head diff grid
   ========================================================== */
.compare-picker {
  position: relative;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.compare-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.compare-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  border: 1px dashed var(--rule);
  color: var(--ink-soft);
  background: transparent;
  min-width: 130px;
  justify-content: center;
}
.compare-slot--filled {
  background: var(--primary-soft);
  color: var(--primary-ink);
  border: 1px solid var(--primary);
  cursor: pointer;
  transition: all var(--t-fast);
}
.compare-slot--filled:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.compare-slot-x {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.compare-slot--input {
  padding: 0;
  cursor: text;
  min-width: 200px;
  flex: 1 1 200px;
  max-width: 320px;
  transition:
    border-color    200ms ease,
    border-style      0ms linear 200ms,
    background-color 200ms ease,
    box-shadow      200ms ease;
}
.compare-slot--input:hover {
  border-color: var(--ink-soft);
}
.compare-slot--input:focus-within {
  border-color: var(--primary);
  border-style: solid;
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-soft);
  transition:
    border-color    200ms ease,
    border-style      0ms linear,
    background-color 200ms ease,
    box-shadow      200ms ease;
}
.compare-slot-search {
  width: 100%;
  padding: 7px 14px;
  font: inherit;
  font-family: var(--sans);
  font-size: 13px;
  border: none;
  background: transparent;
  color: var(--ink);
  outline: none;
  border-radius: 999px;
  text-align: center;
}
.compare-slot--input:focus-within .compare-slot-search { text-align: left; }
.compare-slot-search::placeholder {
  color: var(--ink-soft);
  transition: color 160ms ease;
}
.compare-slot--input:focus-within .compare-slot-search::placeholder {
  color: color-mix(in srgb, var(--ink-soft) 60%, transparent);
}
.compare-suggest {
  background: var(--bg-card);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.compare-suggest:empty { display: none; }
.compare-suggest-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-bottom-width: 0;
  background: var(--bg-card);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background var(--t-fast);
}
.compare-suggest-row:first-child { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.compare-suggest-row:last-child {
  border-bottom-width: 1px;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}
.compare-suggest-row:hover { background: var(--rule-soft); }
.compare-suggest-name { font-weight: 500; color: var(--ink); }
.compare-suggest-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
}
.compare-suggest-empty {
  padding: 14px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
}

.compare-empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 20px;
}
.compare-empty-lede { margin-top: -10px; font-size: 14px; }

.compare-presets {
  margin-top: 28px;
}
.compare-presets-label {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.compare-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  max-width: 920px;
  margin: 0 auto;
  text-align: left;
}
.compare-preset {
  --cat: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--cat);
  border-radius: var(--radius);
  font: inherit;
  font-family: var(--sans);
  cursor: pointer;
  text-align: left;
  transition:
    transform     180ms cubic-bezier(.2,.8,.2,1),
    border-color  180ms ease,
    background    180ms ease,
    box-shadow    180ms ease;
}
.compare-preset:hover,
.compare-preset:focus-visible {
  border-color: color-mix(in srgb, var(--cat) 60%, var(--rule));
  border-left-color: var(--cat);
  background: color-mix(in srgb, var(--cat) 8%, var(--bg-card));
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  outline: none;
}
.compare-preset-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--cat);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat) 22%, transparent);
}
.compare-preset-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.compare-preset-cat {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.2;
}
.compare-preset-peptides {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compare-preset-rising {
  display: inline-block;
  margin-left: 3px;
  font-size: 8px;
  color: var(--primary);
  vertical-align: 2px;
  letter-spacing: 0;
}

.compare-grid {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  background: var(--bg-card);
}
.compare-row {
  display: grid;
  grid-template-columns: 140px repeat(var(--cols, 1), minmax(200px, 1fr));
  border-top: 1px solid var(--rule-soft);
  transition: background var(--t-fast);
}
.compare-row:first-child { border-top: none; }
.compare-row:hover { background: var(--rule-soft); }
.compare-row--header {
  background: var(--bg-elevated);
  border-bottom: 2px solid var(--rule);
}
.compare-row--header:hover { background: var(--bg-elevated); }
.compare-row--diff { border-left: 2px solid var(--primary); }
.compare-row--same { opacity: 0.78; border-left: 2px solid transparent; }
.compare-row-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 14px 16px;
  border-right: 1px solid var(--rule-soft);
  font-weight: 600;
}
.compare-cell {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.5;
  border-right: 1px solid var(--rule-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}
.compare-cell:last-child { border-right: none; }
.compare-cell--mono { font-family: var(--mono); font-size: 12.5px; }
.compare-cell--header { padding: 18px 16px; flex-direction: column; align-content: flex-start; gap: 8px; }
.compare-name {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink);
}
.compare-aliases {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-soft);
}
.compare-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.compare-cell-none { color: var(--ink-soft); font-style: italic; }

.compare-print-footer {
  display: none;
  margin-top: 24px;
  padding: 14px 18px;
  font-size: 12.5px;
  border: 1px solid var(--rule);
  background: var(--warn-soft);
}

@media print {
  .site-header, .disclaimer-banner, .affiliate-banner, .site-footer,
  .compare-picker, .matrix-controls, .matrix-wrap { display: none !important; }
  .view-root { padding: 0; }
  .view-header { border-bottom: 1px solid var(--ink-soft); margin-bottom: 12px; }
  .compare-grid { box-shadow: none; }
  .compare-print-footer { display: block; }
}

@media (max-width: 768px) {
  .compare-row {
    grid-template-columns: 1fr;
  }
  .compare-row-label {
    border-right: none;
    border-bottom: 1px solid var(--rule-soft);
    padding-bottom: 6px;
  }
  .compare-cell {
    border-right: none;
    border-bottom: 1px solid var(--rule-soft);
  }
  .compare-cell:last-child { border-bottom: none; }
  .compare-row--header { grid-template-columns: 1fr; }
}

/* ==========================================================
   Matrix view — 101×101 interaction heatmap
   ========================================================== */
.matrix-controls {
  --matrix-cell: 12px;
  --matrix-axis: 140px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}
.matrix-order {
  display: flex;
  align-items: center;
  gap: 8px;
}
.matrix-order-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.matrix-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.matrix-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  color: var(--ink-muted);
}
.matrix-legend-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}
.matrix-legend-pill--conflict::before    { background: var(--accent); }
.matrix-legend-pill--redundancy::before  { background: var(--warn); }
.matrix-legend-pill--synergy::before     { background: var(--primary); }
.matrix-legend-pill--neutral::before     { background: var(--rule); }

.matrix-wrap {
  --matrix-cell: 12px;
  --matrix-axis: 140px;
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-card);
  max-height: 80vh;
}
.matrix {
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 10px;
  table-layout: fixed;
}
.matrix th, .matrix td { padding: 0; }
.matrix .matrix-corner {
  width: var(--matrix-axis);
  min-width: var(--matrix-axis);
  height: var(--matrix-axis);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  left: 0;
  z-index: var(--z-matrix-corner);
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}
.matrix-axis {
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.matrix-axis--col {
  position: sticky;
  top: 0;
  z-index: var(--z-matrix-col);
  width: var(--matrix-cell);
  min-width: var(--matrix-cell);
  height: var(--matrix-axis);
  vertical-align: bottom;
  border-bottom: 1px solid var(--rule);
  text-align: center;
  padding-bottom: 4px;
}
.matrix-axis--col .coverage-head-vertical {
  font-size: 10px;
  font-family: var(--sans);
  color: var(--ink-muted);
  padding: 2px 0;
  letter-spacing: 0;
}
.matrix-axis--row {
  position: sticky;
  left: 0;
  z-index: var(--z-matrix-row);
  width: var(--matrix-axis);
  min-width: var(--matrix-axis);
  max-width: var(--matrix-axis);
  height: var(--matrix-cell);
  font-family: var(--sans);
  font-size: 11px;
  text-align: right;
  padding: 0 6px 0 8px;
  border-right: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
}
.matrix-row-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.matrix-tick {
  display: inline-block;
  width: 2px;
  height: 14px;
  border-radius: 1px;
}
.matrix-axis--col .matrix-tick {
  display: block;
  margin: 0 auto 2px;
  width: 6px;
  height: 2px;
}
.matrix-axis:hover {
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.matrix-cell {
  width: var(--matrix-cell);
  height: var(--matrix-cell);
  min-width: var(--matrix-cell);
  border: 1px solid color-mix(in srgb, var(--rule) 50%, transparent);
  cursor: pointer;
  transition: filter var(--t-fast), transform var(--t-fast);
}
.matrix-cell--neutral    { background: var(--bg-card); }
.matrix-cell--conflict   { background: color-mix(in srgb, var(--accent) 90%, transparent); }
.matrix-cell--redundancy { background: var(--warn); }
.matrix-cell--synergy    { background: var(--primary); }
.matrix-cell--self {
  background: var(--rule);
  cursor: default;
}

/* Dark-mode contrast lifts — light cells were washing out on dark bg */
[data-theme="dark"] .matrix-cell--conflict   { background: color-mix(in srgb, var(--accent)  78%, white 8%); }
[data-theme="dark"] .matrix-cell--redundancy { background: color-mix(in srgb, var(--warn)    82%, white 6%); }
[data-theme="dark"] .matrix-cell--synergy    { background: color-mix(in srgb, var(--primary) 82%, white 6%); }
[data-theme="dark"] .matrix-cell--neutral    { background: var(--bg-elevated); }
[data-theme="dark"] .matrix-cell {
  border-color: color-mix(in srgb, var(--rule) 40%, transparent);
}
.matrix-cell:not(.matrix-cell--self):hover {
  filter: brightness(1.22);
  position: relative;
  z-index: var(--z-matrix-hover);
  box-shadow:
    inset 0 0 0 1px var(--ink),
    0 0 0 1px var(--bg-elevated);
}

/* Category-boundary separators — only when ordered by category */
.matrix-boundary--col { border-left: 2px solid var(--ink-soft); }
.matrix-boundary--row > * { border-top: 2px solid var(--ink-soft); }

/* Row + col highlight on axis hover */
.matrix tbody tr:hover .matrix-axis--row {
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.matrix tbody tr:hover td:not(.matrix-cell--self) {
  filter: brightness(1.05);
}

/* Detail panel below matrix */
.matrix-detail {
  margin-top: 18px;
  min-height: 80px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--bg-card);
  padding: 16px 18px;
}
.matrix-detail-empty {
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}
.matrix-detail-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 4px solid var(--ink-soft);
  padding-left: 14px;
}
.matrix-detail-card--alert { border-left-color: var(--accent); }
.matrix-detail-card--ok    { border-left-color: var(--primary); }
.matrix-detail-card--warn  { border-left-color: var(--warn); }
.matrix-detail-card--locked { box-shadow: inset 0 0 0 1px var(--rule); padding: 10px 14px; border-radius: var(--radius); }

.matrix-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.matrix-detail-head h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--ink);
}
.matrix-detail-kind {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 2px;
}
.matrix-detail-kind--alert { background: var(--accent-soft); color: var(--accent); }
.matrix-detail-kind--ok    { background: var(--primary-soft); color: var(--primary-ink); }
.matrix-detail-kind--warn  { background: var(--warn-soft); color: var(--warn); }
.matrix-detail-evidence {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.matrix-detail-unlock {
  margin-left: auto;
  padding: 4px 10px;
  font: inherit;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--bg-elevated);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all var(--t-fast);
}
.matrix-detail-unlock:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.matrix-detail-text {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.55;
}
.matrix-detail-meta {
  font-size: 12.5px;
  color: var(--ink-soft);
}
.matrix-detail-cites {
  margin: 4px 0 0;
  padding-left: 22px;
  font-size: 12px;
  color: var(--ink-muted);
}
.matrix-detail-cites li { margin-bottom: 2px; }

@media (max-width: 900px) {
  .matrix-wrap,
  .matrix-controls {
    --matrix-cell: 22px;
    --matrix-axis: 120px;
  }
}
@media (max-width: 768px) {
  .matrix-controls { flex-direction: column; align-items: flex-start; }
  .matrix-wrap { max-height: 70vh; }
}

/* ==========================================================
   Motion + polish layer
   ========================================================== */
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes reveal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modal-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes verdict-glow {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.06); opacity: 1; }
}
@keyframes chip-rebound {
  0%   { transform: scale(1); }
  50%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

/* View-root entrance — every navigation cascades content in */
.view-root > * {
  animation: reveal-up 380ms cubic-bezier(.2,.8,.2,1) both;
}
.view-root > *:nth-child(1) { animation-delay:   0ms; }
.view-root > *:nth-child(2) { animation-delay:  50ms; }
.view-root > *:nth-child(3) { animation-delay: 100ms; }
.view-root > *:nth-child(4) { animation-delay: 150ms; }
.view-root > *:nth-child(5) { animation-delay: 200ms; }
.view-root > *:nth-child(n+6) { animation-delay: 240ms; }

/* Card grids — staggered reveal of children for the first ~16 items */
.card-grid > .card,
.discover-grid > .discover-card,
.discover-peptide-grid > .discover-peptide-mini,
.eval-results > .eval-flat-entry,
.nearmiss-row > .nearmiss-card,
.compare-grid > .compare-row {
  animation: reveal-up 420ms cubic-bezier(.2,.8,.2,1) both;
}
.card-grid > .card:nth-child(1),
.discover-grid > .discover-card:nth-child(1),
.discover-peptide-grid > .discover-peptide-mini:nth-child(1),
.eval-results > .eval-flat-entry:nth-child(1),
.nearmiss-row > .nearmiss-card:nth-child(1),
.compare-grid > .compare-row:nth-child(1)  { animation-delay:  20ms; }
.card-grid > .card:nth-child(2),
.discover-grid > .discover-card:nth-child(2),
.discover-peptide-grid > .discover-peptide-mini:nth-child(2),
.eval-results > .eval-flat-entry:nth-child(2),
.nearmiss-row > .nearmiss-card:nth-child(2),
.compare-grid > .compare-row:nth-child(2)  { animation-delay:  55ms; }
.card-grid > .card:nth-child(3),
.discover-grid > .discover-card:nth-child(3),
.discover-peptide-grid > .discover-peptide-mini:nth-child(3),
.eval-results > .eval-flat-entry:nth-child(3),
.nearmiss-row > .nearmiss-card:nth-child(3),
.compare-grid > .compare-row:nth-child(3)  { animation-delay:  90ms; }
.card-grid > .card:nth-child(4),
.discover-grid > .discover-card:nth-child(4),
.discover-peptide-grid > .discover-peptide-mini:nth-child(4),
.eval-results > .eval-flat-entry:nth-child(4),
.nearmiss-row > .nearmiss-card:nth-child(4),
.compare-grid > .compare-row:nth-child(4)  { animation-delay: 125ms; }
.card-grid > .card:nth-child(5),
.discover-grid > .discover-card:nth-child(5),
.discover-peptide-grid > .discover-peptide-mini:nth-child(5),
.eval-results > .eval-flat-entry:nth-child(5),
.nearmiss-row > .nearmiss-card:nth-child(5),
.compare-grid > .compare-row:nth-child(5)  { animation-delay: 160ms; }
.card-grid > .card:nth-child(n+6),
.discover-grid > .discover-card:nth-child(n+6),
.discover-peptide-grid > .discover-peptide-mini:nth-child(n+6),
.eval-results > .eval-flat-entry:nth-child(n+6),
.nearmiss-row > .nearmiss-card:nth-child(n+6),
.compare-grid > .compare-row:nth-child(n+6) {
  animation-delay: 180ms;
}

/* Modal — pop the dialog and fade the backdrop */
.modal-backdrop.open                 { animation: modal-fade-in 220ms ease both; }
.modal-backdrop.open .modal          { animation: modal-pop      300ms cubic-bezier(.2,.8,.2,1) both; }

/* Theme switch — body adds .theme-switching for ~340ms; transitions ease the swap */
body.theme-switching,
body.theme-switching *:not(.matrix-cell):not(.molecule-divider) {
  transition:
    background-color 320ms ease,
    color            320ms ease,
    border-color     320ms ease,
    fill             320ms ease,
    stroke           320ms ease,
    box-shadow       320ms ease !important;
}

/* Brand mark — slow rotation + breath on hover, sun/moon glyph rotation on toggle */
.brand-mark {
  transition: transform 520ms cubic-bezier(.2,.8,.2,1);
}
.brand:hover .brand-mark {
  transform: rotate(45deg);
}
.theme-toggle .theme-icon-sun,
.theme-toggle .theme-icon-moon {
  display: inline-block;
  transition: transform 360ms cubic-bezier(.2,.8,.2,1), opacity 240ms ease;
}
.theme-toggle:hover .theme-icon-sun,
.theme-toggle:hover .theme-icon-moon {
  transform: rotate(60deg);
}
[data-theme="dark"] .theme-toggle .theme-icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .theme-icon-moon { display: inline-block; }

/* Verdict glyph — gentle breath loop on the alert/warn states */
.eval-verdict--alert .eval-verdict-icon,
.eval-verdict--warn  .eval-verdict-icon {
  animation: verdict-glow 2.6s ease-in-out infinite;
  transform-origin: center;
}

/* Tactile chip click */
.chip:active,
.calc-chip:active,
.matrix-order .chip:active {
  animation: chip-rebound 200ms cubic-bezier(.2,.8,.2,1);
}

/* Discover card hover — refined easing + wider strip travel */
.discover-card {
  transition:
    transform   260ms cubic-bezier(.2,.8,.2,1),
    box-shadow  260ms cubic-bezier(.2,.8,.2,1),
    border-color 260ms ease;
}
.discover-card-strip {
  transition: width 320ms cubic-bezier(.2,.8,.2,1);
}
.discover-card:hover,
.discover-card:focus { transform: translateY(-3px); }
.discover-card:hover .discover-card-strip,
.discover-card:focus .discover-card-strip { width: 8px; }

/* Discover mini-cards — match the lift */
.discover-peptide-mini {
  transition:
    transform   220ms cubic-bezier(.2,.8,.2,1),
    box-shadow  220ms cubic-bezier(.2,.8,.2,1),
    border-color 220ms ease;
}
.discover-peptide-mini:hover,
.discover-peptide-mini:focus { transform: translateY(-2px); }

/* Browse cards — soft lift on hover (subtle, the cards already have transition: all) */
.card { transition: transform 220ms cubic-bezier(.2,.8,.2,1), box-shadow 220ms ease, border-color 220ms ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--ink-soft) 25%, transparent); }

/* Tab indicator — the active pill grows in slightly */
.tab {
  transition:
    color            var(--t-fast),
    background-color var(--t-fast),
    border-color     var(--t-fast),
    transform        var(--t-fast);
}
.tab.active { transform: translateY(-1px); }

/* Matrix axis hover — slim accent on the head ticks when row/col is hot */
.matrix-axis { transition: background-color 160ms ease, color 160ms ease; }
.matrix tbody tr:hover .matrix-axis--row .matrix-tick,
.matrix-axis--col:hover .matrix-tick {
  filter: brightness(1.25) saturate(1.1);
}

/* Compare slot remove — fade chip on hover */
.compare-slot--filled { transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 160ms ease; }
.compare-slot--filled:hover { transform: translateY(-1px); }

/* Calculator pill value — fade on swap (helps the syringe-reading number feel live) */
.calc-pill-val,
.calc-result-num { transition: opacity 200ms ease, color 200ms ease; }

/* Scroll behavior — smooth in-page anchors (verdict ribbon → section jumps) */
html { scroll-behavior: smooth; }

/* Share-URL fallback — shown when the Clipboard API is unavailable */
.share-url-fallback {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--warn);
  background: var(--warn-soft);
  color: var(--ink);
  border-radius: var(--radius);
}

/* ==========================================================
   Essential Guides view
   ========================================================== */
.info-section {
  margin-bottom: 12px;
}
.info-section .eval-slug {
  margin-top: 44px;
}
.info-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}
.info-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.info-card-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.005em;
  margin: 0 0 10px;
  color: var(--ink);
}
.info-subhead {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 28px 0 10px;
}
.info-list {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.6;
}
.info-list li { margin-bottom: 6px; }
.info-factor-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.info-factor-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--rule);
}
.info-factor-list li:last-child { border-bottom: 0; }
.info-factor-name {
  display: block;
  font-weight: 600;
  color: var(--ink);
  font-size: 13.5px;
  margin-bottom: 2px;
}
.info-factor-detail {
  display: block;
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.55;
}
.info-duration {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--primary-ink);
  background: var(--primary-soft);
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius);
  margin: 0 0 12px;
}
.info-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  font-size: 13.5px;
}
.info-dl dt {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-top: 2px;
  white-space: nowrap;
}
.info-dl dd {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.5;
}

.info-callout {
  margin-top: 16px;
  padding: 14px 18px;
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
}
.info-callout p { margin: 0; }
.info-callout p + p { margin-top: 6px; }
.info-callout-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

/* Syringe reference card grid */
.info-syringe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.info-syringe-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.info-syringe-name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.info-syringe-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
  line-height: 1.45;
}
.info-syringe-row span:first-child {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.info-syringe-row span:last-child { text-align: right; }
.info-syringe-note {
  margin-top: 4px;
  font-size: 12px;
  color: var(--accent);
  line-height: 1.45;
}

/* Ordered step lists (reconstitution, injection) */
.info-steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}
.info-steps li {
  counter-increment: step;
  position: relative;
  padding: 10px 0 10px 44px;
  border-bottom: 1px dashed var(--rule);
  font-size: 14px;
  color: var(--ink-muted);
  line-height: 1.55;
}
.info-steps li:last-child { border-bottom: 0; }
.info-steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-ink);
  background: var(--primary-soft);
  padding: 3px 8px;
  border-radius: var(--radius);
  letter-spacing: 0.06em;
}
.info-steps--compact li {
  padding: 8px 0 8px 40px;
  font-size: 13px;
}
.info-steps--compact li::before {
  top: 8px;
  padding: 2px 6px;
  font-size: 10.5px;
}
.info-inj-card .info-card-title {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 4px;
}

@media (max-width: 820px) {
  .info-grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  /* Two side-by-side SQ/IM procedure blocks wrap awkwardly at tablet widths — collapse earlier */
  #info-injection .info-grid-2 { grid-template-columns: 1fr; }
}

/* --- Shared empty / error / inline layout classes (replaces ad-hoc inline styles) --- */
.empty-message {
  padding: 40px;
  text-align: center;
  color: var(--ink-soft);
}
.empty-message--compact {
  padding: 20px;
  font-size: 13px;
}
.error-banner {
  padding: 40px;
  text-align: center;
  color: var(--accent);
}
.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.class-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.stack-mention-name { font-weight: 600; }

/* Loading state — shown while JSON data is fetching */
.loading-state {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 120px 20px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.loading-state .molecule-divider { margin: 0; animation: loading-pulse 1.6s ease-in-out infinite; }
@keyframes loading-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* Narrow-viewport sticky offset override so .picker-panel clears wrapped header+banner */
@media (max-width: 960px) {
  :root { --header-offset: 112px; }
}
@media (max-width: 768px) {
  :root { --header-offset: 128px; }
}

/* Tab overflow — fade cue on both edges; the left side is only masked once the user has scrolled off the start. */
@media (max-width: 768px) {
  .nav-tabs {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent);
            mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent);
  }
  .nav-tabs.at-start {
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent);
            mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 24px), transparent);
  }
  .nav-tabs.at-end {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 100%);
  }
  /* Raise touch targets to approximate WCAG AA 44 px minimum on small screens. */
  .tab {
    padding: 12px 18px;
    font-size: 13.5px;
    line-height: 1.2;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }
}

/* Honor the user's motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .eval-verdict--alert .eval-verdict-icon,
  .eval-verdict--warn  .eval-verdict-icon { animation: none; }
}

/* ==========================================================
   Mobile polish layer (additive — desktop unchanged)
   Adds:
     · iOS-zoom prevention on text inputs (>= 16px)
     · WCAG 2.5.5 touch targets (>= 44 x 44)
     · WCAG 2.5.8 spacing between adjacent tappables
     · Long-word overflow safety in dense text views
     · Tighter gutters / smaller hero on very narrow screens
     · Cleaner step-down for multi-column metric rows
     · Scroll-snap for the horizontal tab nav
   No design changes; no token edits; no JS changes.
   ========================================================== */

/* --- 1. Inputs >= 16px on mobile to prevent iOS auto-zoom on focus --- */
@media (max-width: 768px) {
  .search-input,
  .picker-search,
  input[type="text"],
  input[type="search"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  textarea,
  select {
    font-size: 16px;
  }
}

/* --- 2. Touch targets — WCAG 2.5.5 minimum 44 x 44 on mobile --- */
@media (max-width: 768px) {
  .theme-toggle {
    width: 44px;
    height: 44px;
  }
  .chip {
    padding: 9px 14px;
    font-size: 13px;
    min-height: 36px;
  }
  .filter-trigger {
    padding: 11px 16px;
    min-height: 44px;
    font-size: 13.5px;
  }
  .compare-slot {
    padding: 11px 16px;
    min-height: 44px;
    font-size: 13.5px;
  }
  .compare-slot--input {
    min-width: 100%;
    flex: 1 1 100%;
    max-width: 100%;
  }
  .btn-clear,
  .btn-share {
    padding: 12px 14px;
    font-size: 13px;
    min-height: 44px;
  }
  .filter-clear {
    padding: 10px 14px;
    min-height: 40px;
  }
  .toggle-label {
    padding: 12px 0;
    min-height: 44px;
  }
  .modal-close {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* --- 3. WCAG 2.5.8 — adjacent-tappable spacing inside filter rows --- */
@media (max-width: 768px) {
  .filter-row { gap: 10px; }
  .filter-bar { gap: 12px; }
}

/* --- 4. Long-word overflow safety in modal + comparison + vendor blocks --- */
@media (max-width: 768px) {
  .modal,
  .modal h2,
  .modal .field-value,
  .modal .aliases-line,
  .vendor-list .vendor-name,
  .vendor-list .vendor-link,
  .compare-name,
  .compare-aliases {
    overflow-wrap: anywhere;
    word-wrap: break-word;
  }
}

/* --- 5. Modal backdrop reclaim on tiny screens --- */
@media (max-width: 520px) {
  .modal-backdrop { padding: 16px 8px; }
  .modal { padding: 24px 18px; max-width: 100%; }
  .modal h2 { font-size: 26px; }
}

/* --- 6. Calculator hero scale — avoid overflow on 320 px iPhone-5 widths --- */
@media (max-width: 480px) {
  .calc-result-num { font-size: 36px; }
}

/* --- 7. Eval metrics: cleaner 2-up at small widths --- */
@media (max-width: 480px) {
  .eval-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .eval-metric-value { font-size: 22px; }
}

/* --- 8. Tab nav scroll-snap polish (mask fade + snap = clean) --- */
@media (max-width: 768px) {
  .nav-tabs {
    scroll-snap-type: x proximity;
    scroll-padding: 0 24px;
  }
  .tab { scroll-snap-align: center; }
}

/* --- 9. Browse card-grid 1-column safety net at very narrow widths --- */
@media (max-width: 380px) {
  .card-grid { grid-template-columns: 1fr; }
}

/* --- 10. View-header: stack title and count below 480 px --- */
@media (max-width: 480px) {
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .view-header h1 { font-size: 24px; }
}

/* --- Tighten outer gutters on the smallest viewports (<= 380 px) --- */
@media (max-width: 380px) {
  .view-root { padding: 20px 14px; }
  .disclaimer-banner { padding: 7px 14px; font-size: 11px; }
  .affiliate-banner { padding: 7px 14px; font-size: 11px; }
  .site-footer { padding: 12px 14px; }
}
