/* ============= MUD\WTR Design System v3 ============= */

:root {
  --bg: #FAFAF8;
  --bg-2: #F4F4F0;
  --surface: #FFFFFF;
  --surface-2: #F8F8F5;
  --text: #0A0A0A;
  --text-2: #525252;
  --text-3: #A3A3A3;
  --text-4: #D4D4D4;
  --border: #EAEAE5;
  --border-2: #D4D4CD;
  --accent: #5B5BD6;
  --accent-soft: #EEEEFF;
  --green: #16A34A;
  --green-soft: #ECFDF3;
  --amber: #D97706;
  --amber-soft: #FEF3C7;
  --red: #DC2626;
  --red-soft: #FEE7E7;
  --purple: #7C3AED;
  --purple-soft: #F3EFFE;
  --blue: #2563EB;
  --blue-soft: #EAF1FE;
  --pink: #DB2777;
  --pink-soft: #FCE9F1;
  --orange: #EA580C;
  --orange-soft: #FEEDD8;
  --brown: #92400E;
  --brown-soft: #F5EBD8;
  --teal: #0F766E;
  --teal-soft: #DCFCE7;
  --indigo: #4338CA;
  --indigo-soft: #EAEAFE;
  --shadow: 0 1px 2px rgba(20,20,20,0.04), 0 4px 14px rgba(20,20,20,0.05);
  --shadow-lg: 0 4px 12px rgba(20,20,20,0.06), 0 24px 48px rgba(20,20,20,0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --max-width: 1320px;

  --ff-serif: 'Fraunces', 'Times New Roman', serif;
  --ff-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --ff-mono: 'Space Mono', 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg: #0A0A0A;
  --bg-2: #131313;
  --surface: #161616;
  --surface-2: #1C1C1C;
  --text: #F5F5F5;
  --text-2: #A8A8A8;
  --text-3: #707070;
  --text-4: #404040;
  --border: #232323;
  --border-2: #353535;
  --accent: #818CF8;
  --accent-soft: #1E1B4B;
  --green-soft: #052E16;
  --amber-soft: #1C1917;
  --red-soft: #1F0808;
  --purple-soft: #1E1B4B;
  --blue-soft: #0C1F3A;
  --pink-soft: #2D0A1F;
  --orange-soft: #2C1108;
  --brown-soft: #2A1B05;
  --teal-soft: #032F2D;
  --indigo-soft: #1E1B4B;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ff-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
  font-feature-settings: "ss01", "cv05";
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* ============= AUTH ============= */
.auth-locked .app { display: none; }
.auth-gate {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg); z-index: 9999;
  background-image: radial-gradient(ellipse at top, rgba(91,91,214,0.04), transparent 60%);
}
.auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 56px 44px; max-width: 440px; width: 90%; text-align: center;
  box-shadow: var(--shadow-lg);
}
.auth-logo { width: 56px; height: 56px; margin: 0 auto 28px; display: block; opacity: 0.9; }
.auth-eyebrow {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em;
  color: var(--text-3); margin-bottom: 14px; text-transform: uppercase;
}
.auth-title {
  font-family: var(--ff-serif); font-size: 32px; font-weight: 400;
  letter-spacing: -0.025em; margin-bottom: 10px; line-height: 1.05;
}
.auth-sub { font-size: 14px; color: var(--text-2); margin-bottom: 28px; line-height: 1.55; }
.auth-card input {
  width: 100%; padding: 13px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; background: var(--surface-2); color: var(--text);
  margin-bottom: 12px; transition: border-color 0.15s;
}
.auth-card input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.auth-card button {
  width: 100%; padding: 13px; background: var(--text); color: var(--surface);
  border: none; border-radius: var(--radius-sm); font-family: var(--ff-mono);
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; cursor: pointer;
  text-transform: uppercase; transition: opacity 0.15s, transform 0.15s;
}
.auth-card button:hover { opacity: 0.88; }
.auth-error { color: var(--red); font-size: 13px; margin-top: 8px; min-height: 1em; }

/* ============= NAV ============= */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; gap: 28px;
}
.nav-brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; text-decoration: none; color: inherit; }
.nav-logo { width: 30px; height: 30px; opacity: 0.92; }
.nav-title { display: flex; flex-direction: column; }
.nav-eyebrow {
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.18em;
  color: var(--text-3); text-transform: uppercase;
}
.nav-name { font-family: var(--ff-mono); font-size: 13px; font-weight: 700; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.nav-link {
  font-family: var(--ff-mono); font-size: 12px; font-weight: 700;
  color: var(--text-2); text-decoration: none; padding: 8px 12px; border-radius: 7px;
  transition: all 0.15s; text-transform: uppercase; letter-spacing: 0.05em;
}
.nav-link:hover { color: var(--text); background: var(--surface); }
.nav-link.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.nav-link.nav-cta { background: var(--text); color: var(--surface) !important; margin-left: 4px; }
.nav-link.nav-cta:hover { background: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.theme-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; color: var(--text); font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block;
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.status-text { font-family: var(--ff-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; color: var(--green); }

/* ============= LAYOUT ============= */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 28px; }
.view {
  display: none; padding: 64px 0 96px; min-height: calc(100vh - 70px);
  animation: fadein 0.4s ease-out;
}
.view.active { display: block; }
@keyframes fadein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Page header */
.page-header { margin-bottom: 56px; max-width: 760px; }
.page-eyebrow {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.2em;
  color: var(--text-3); text-transform: uppercase; margin-bottom: 16px;
}
.page-title {
  font-family: var(--ff-serif); font-weight: 400;
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: -0.03em; line-height: 1.02; margin-bottom: 20px;
}
.page-title em { font-style: italic; color: var(--text-2); }
.page-sub { font-size: 17px; color: var(--text-2); line-height: 1.6; max-width: 640px; }
.page-sub a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.page-sub a:hover { color: var(--text); }

/* Section */
.section-block { margin-top: 72px; }
.section-head { margin-bottom: 28px; max-width: 720px; }
.section-head--row {
  display: flex; justify-content: space-between; align-items: flex-end;
  max-width: none; gap: 24px; flex-wrap: wrap;
}
.section-head--row > div { max-width: 720px; }
.section-eyebrow {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em;
  color: var(--text-3); text-transform: uppercase; display: block; margin-bottom: 10px;
}
.section-title {
  font-family: var(--ff-serif); font-weight: 400; font-size: 32px;
  letter-spacing: -0.02em; margin-bottom: 8px; line-height: 1.1;
}
.section-sub { font-size: 14px; color: var(--text-2); max-width: 640px; line-height: 1.55; }
.section-action {
  font-family: var(--ff-mono); font-size: 12px; font-weight: 700;
  color: var(--accent); text-decoration: none; padding: 10px 14px;
  background: var(--accent-soft); border-radius: 8px;
  letter-spacing: 0.04em; transition: all 0.15s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.section-action:hover { background: var(--accent); color: var(--surface); transform: translateX(2px); }

/* Hero banner */
.hero-banner {
  background: linear-gradient(135deg, rgba(91,91,214,0.05), rgba(91,91,214,0.01));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px 36px; margin-bottom: 56px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center;
  text-decoration: none; color: inherit; transition: transform 0.15s;
}
.hero-banner:hover { transform: translateY(-1px); }
.hero-banner-icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; font-size: 32px; }
.hero-banner-content h3 { font-family: var(--ff-serif); font-weight: 400; font-size: 24px; letter-spacing: -0.015em; line-height: 1.2; margin-bottom: 4px; }
.hero-banner-content p { font-size: 14px; color: var(--text-2); }
.hero-banner-cta {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px;
  background: var(--text); color: var(--surface); border-radius: 8px; text-decoration: none;
  font-family: var(--ff-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  transition: opacity 0.15s, transform 0.15s;
}
.hero-banner-cta:hover { opacity: 0.88; transform: translateX(2px); }

/* ============= INVESTIGATION PIPELINE ============= */
.pipeline-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px;
}
.pipeline-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 22px; cursor: pointer; transition: all 0.18s; position: relative;
  text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
}
.pipeline-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--cat-color, var(--text-3));
  transition: width 0.18s;
}
.pipeline-card:hover {
  border-color: var(--text-2); transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.pipeline-card:hover::before { width: 5px; }
.pipeline-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pipeline-priority {
  font-family: var(--ff-mono); font-size: 9px; padding: 4px 8px; border-radius: 4px;
  letter-spacing: 0.1em; font-weight: 700;
}
.pipeline-priority--high { background: var(--green-soft); color: var(--green); }
.pipeline-priority--med { background: var(--blue-soft); color: var(--blue); }
.pipeline-priority--low { background: var(--surface-2); color: var(--text-3); }
.pipeline-card-name {
  font-family: var(--ff-serif); font-size: 28px; font-weight: 400;
  letter-spacing: -0.025em; line-height: 1.05;
}
.pipeline-card-latin { font-size: 12px; color: var(--text-3); font-style: italic; }
.pipeline-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pipeline-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border);
}
.pipeline-card-cta {
  font-family: var(--ff-mono); font-size: 11px; color: var(--accent);
  font-weight: 700; letter-spacing: 0.04em; transition: transform 0.15s;
}
.pipeline-card:hover .pipeline-card-cta { transform: translateX(3px); }

/* ============= ACTION ITEMS ============= */
.action-items {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px;
}
.action-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 22px; text-align: left; cursor: pointer; transition: all 0.18s;
  font-family: var(--ff-sans); position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
}
.action-item::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.action-item--red::before { background: var(--red); }
.action-item--amber::before { background: var(--amber); }
.action-item--green::before { background: var(--green); }
.action-item:not(.is-disabled):hover {
  border-color: var(--text-2); transform: translateY(-2px); box-shadow: var(--shadow-lg);
}
.action-item.is-disabled { cursor: default; opacity: 0.65; }
.action-item-head { display: flex; align-items: baseline; gap: 12px; }
.action-item-count {
  font-family: var(--ff-serif); font-size: 36px; font-weight: 400;
  font-variant-numeric: tabular-nums; line-height: 1; letter-spacing: -0.025em;
}
.action-item--red .action-item-count { color: var(--red); }
.action-item--amber .action-item-count { color: var(--amber); }
.action-item--green .action-item-count { color: var(--green); }
.action-item-title {
  font-family: var(--ff-serif); font-size: 18px; font-weight: 400;
  line-height: 1.25; letter-spacing: -0.015em; flex: 1;
}
.action-item-body { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.action-item-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.action-item-pill {
  font-family: var(--ff-mono); font-size: 10px; padding: 4px 8px;
  background: var(--bg-2); border-radius: 4px; color: var(--text-2);
  letter-spacing: 0.04em; font-weight: 700;
}
.action-item-cta {
  font-family: var(--ff-mono); font-size: 11px; color: var(--accent);
  font-weight: 700; letter-spacing: 0.04em; margin-top: 4px;
  display: inline-flex; align-items: center; gap: 4px;
  transition: transform 0.15s;
}
.action-item:hover .action-item-cta { transform: translateX(3px); }

/* ============= STATS ============= */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.stat {
  background: var(--surface); padding: 28px 24px; display: flex; flex-direction: column; gap: 4px;
  transition: background 0.15s; border: none; text-align: left; font-family: var(--ff-sans);
  color: inherit; cursor: default;
}
.stat.is-clickable { cursor: pointer; }
.stat:hover { background: var(--surface-2); }
.stat.is-clickable:hover .stat-arrow { transform: translateX(3px); opacity: 1; }
.stat-label {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-3);
  display: flex; align-items: center; gap: 6px; justify-content: space-between;
}
.stat-arrow {
  font-family: var(--ff-mono); font-size: 12px; color: var(--text-3);
  opacity: 0; transition: all 0.18s;
}
.stat-value {
  font-family: var(--ff-serif); font-size: 48px; font-weight: 400; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.stat-detail { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* Evidence */
.evidence-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.evidence-cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 22px;
  position: relative; overflow: hidden;
  text-align: left; font-family: var(--ff-sans); color: inherit;
  cursor: default; transition: all 0.18s;
}
.evidence-cell.is-clickable { cursor: pointer; }
.evidence-cell.is-clickable:hover {
  border-color: var(--text-2); transform: translateY(-2px); box-shadow: var(--shadow);
}
.evidence-cell.is-clickable:hover .stat-arrow { opacity: 1; transform: translateX(2px); }
.evidence-cell::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.evidence-cell--strong::before { background: var(--green); }
.evidence-cell--moderate::before { background: var(--blue); }
.evidence-cell--preliminary::before { background: var(--amber); }
.evidence-cell--anecdotal::before { background: var(--orange); }
.evidence-cell--insufficient::before { background: var(--red); }
.evidence-label {
  font-family: var(--ff-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-3); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center;
}
.evidence-count { font-family: var(--ff-serif); font-size: 36px; font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: -0.025em; line-height: 1; }
.evidence-dots { margin-top: 8px; font-size: 13px; letter-spacing: 1px; line-height: 1; }
.evidence-cell-cta {
  font-family: var(--ff-mono); font-size: 10px; color: var(--text-3);
  margin-top: 10px; letter-spacing: 0.06em; font-weight: 700;
}

/* Benefit grid */
.benefit-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.benefit-cell {
  background: var(--surface); padding: 20px 22px; cursor: pointer; transition: background 0.15s;
  display: flex; flex-direction: column; gap: 6px;
  border: none; text-align: left; font-family: var(--ff-sans); color: inherit;
}
.benefit-cell:hover { background: var(--surface-2); }
.benefit-cell:hover .stat-arrow { opacity: 1; transform: translateX(2px); }
.benefit-cell-name {
  font-family: var(--ff-mono); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: space-between;
}
.benefit-cell-count { font-family: var(--ff-serif); font-size: 28px; font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: -0.025em; line-height: 1; margin-top: 2px; }
.benefit-cell-detail { font-family: var(--ff-mono); font-size: 10px; color: var(--text-3); letter-spacing: 0.04em; }

/* Opportunity */
.opportunity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.opp-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 22px; cursor: pointer; transition: all 0.18s; position: relative;
  text-decoration: none; color: inherit; display: block;
}
.opp-card:hover { border-color: var(--text-2); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.opp-card-priority {
  position: absolute; top: 14px; right: 14px; font-family: var(--ff-mono);
  font-size: 9px; letter-spacing: 0.12em; padding: 4px 8px; border-radius: 4px; font-weight: 700;
}
.opp-card-priority--high { background: var(--red-soft); color: var(--red); }
.opp-card-priority--med { background: var(--amber-soft); color: var(--amber); }
.opp-card-name { font-family: var(--ff-serif); font-size: 24px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 4px; }
.opp-card-latin { font-size: 12px; color: var(--text-3); font-style: italic; margin-bottom: 14px; }
.opp-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.opp-card-summary { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.opp-card-summary strong { color: var(--text); font-weight: 600; }

/* Supply overview */
.supply-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.supply-cell {
  background: var(--surface); padding: 22px; position: relative; overflow: hidden;
  text-align: left; font-family: var(--ff-sans); color: inherit;
  cursor: default; transition: background 0.18s;
  display: flex; flex-direction: column; gap: 6px;
}
.supply-cell.is-clickable { cursor: pointer; }
.supply-cell.is-clickable:hover { background: var(--surface-2); }
.supply-cell.is-clickable:hover .stat-arrow { opacity: 1; transform: translateX(2px); }
.supply-cell::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.supply-cell--critical::before { background: var(--red); }
.supply-cell--high::before { background: var(--orange); }
.supply-cell--moderate::before { background: var(--amber); }
.supply-cell--low::before { background: var(--green); }
.supply-cell-label {
  font-family: var(--ff-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-3); display: flex; justify-content: space-between; align-items: center;
}
.supply-cell-value { font-family: var(--ff-serif); font-size: 32px; font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: -0.025em; line-height: 1; }
.supply-cell-detail { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.supply-cell-list {
  font-family: var(--ff-mono); font-size: 11px; color: var(--text-2);
  padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--border);
  line-height: 1.5; letter-spacing: 0.02em;
}

/* ============= FILTER BAR (redesigned) ============= */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; align-items: center;
}
.search-wrap {
  position: relative; flex: 1; min-width: 280px;
}
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-family: var(--ff-mono); font-size: 16px; pointer-events: none;
}
.search-input {
  width: 100%; padding: 12px 16px 12px 38px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
  font-family: inherit; font-size: 14px; transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
  outline: none; border-color: var(--text);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.filter-segmented {
  display: inline-flex; gap: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px;
}
.seg-btn {
  font-family: var(--ff-mono); font-size: 11px; padding: 8px 14px;
  border: none; background: transparent; border-radius: 7px;
  cursor: pointer; transition: all 0.15s; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; white-space: nowrap;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--text); color: var(--surface); }

.filter-trigger-wrap { position: relative; }
.filter-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ff-mono); font-size: 12px; padding: 10px 14px;
  border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  transition: border-color 0.15s;
}
.filter-trigger:hover { border-color: var(--text-2); }
.filter-trigger-arrow { font-size: 9px; color: var(--text-3); }
.filter-panel {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; min-width: 280px; box-shadow: var(--shadow-lg);
  display: none;
}
.filter-panel.open { display: block; animation: dropin 0.18s ease-out; }
@keyframes dropin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.filter-section { margin-bottom: 18px; }
.filter-section:last-child { margin-bottom: 0; }
.filter-section-label {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--text-3); text-transform: uppercase; margin-bottom: 10px; font-weight: 700;
}
.filter-check {
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
  font-size: 13px; cursor: pointer; transition: color 0.12s;
  color: var(--text-2);
}
.filter-check:hover { color: var(--text); }
.filter-check input { accent-color: var(--text); }
.filter-check-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.sort-wrap { display: inline-flex; align-items: center; gap: 8px; }
.sort-label { font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.sort-select {
  font-family: var(--ff-mono); font-size: 12px; padding: 9px 30px 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path fill='%23A3A3A3' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
}
.sort-select:focus { outline: none; border-color: var(--text); }

.active-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; min-height: 0; }
.active-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--ff-mono); font-size: 11px; padding: 5px 10px;
  background: var(--accent-soft); color: var(--accent); border: none; border-radius: 6px;
  cursor: pointer; font-weight: 700; letter-spacing: 0.04em;
}
.active-chip:hover { background: var(--accent); color: var(--surface); }
.active-chip-x { font-size: 14px; line-height: 1; }
.active-chip-clear {
  font-family: var(--ff-mono); font-size: 11px; padding: 5px 10px; border: none; background: transparent;
  color: var(--text-3); cursor: pointer; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
}
.active-chip-clear:hover { color: var(--text); }

.results-meta {
  font-family: var(--ff-mono); font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; font-weight: 700;
}

/* ============= INGREDIENT ROWS ============= */
.ingredient-rows {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.ing-row {
  display: grid;
  grid-template-columns: 6px 1.6fr 0.9fr 1.5fr 0.7fr 0.9fr 1.1fr 24px;
  gap: 16px; align-items: center; padding: 14px 20px;
  cursor: pointer; transition: background 0.12s;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
}
.ing-row:last-child { border-bottom: none; }
.ing-row:hover { background: var(--surface-2); }
.ing-row-accent {
  width: 6px; height: 36px; border-radius: 3px; align-self: center;
}
.ing-row-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ing-row-name-main {
  font-family: var(--ff-mono); font-weight: 700; font-size: 14px;
  letter-spacing: -0.01em; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.ing-row-name-latin {
  font-size: 11px; color: var(--text-3); font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ing-row-cell { font-size: 13px; color: var(--text-2); min-width: 0; }
.ing-row-cell-mono { font-family: var(--ff-mono); font-size: 11px; color: var(--text-2); letter-spacing: 0.02em; }
.ing-row-cell--ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ing-row-tags { display: flex; flex-wrap: wrap; gap: 3px; }
.ing-row-evidence { font-family: var(--ff-mono); font-size: 12px; letter-spacing: 1px; display: flex; align-items: center; gap: 3px; }
.ing-row-arrow {
  color: var(--text-3); font-family: var(--ff-mono); font-size: 14px;
  transition: transform 0.15s, color 0.15s;
}
.ing-row:hover .ing-row-arrow { color: var(--text); transform: translateX(3px); }
.ing-rows-header {
  display: grid;
  grid-template-columns: 6px 1.6fr 0.9fr 1.5fr 0.7fr 0.9fr 1.1fr 24px;
  gap: 16px; padding: 12px 20px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3); font-weight: 700;
}

/* Tags */
.tag {
  font-family: var(--ff-mono); font-size: 9px; padding: 3px 7px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.4; font-weight: 700; white-space: nowrap;
}
.tag-energy { background: var(--orange-soft); color: var(--orange); }
.tag-focus { background: var(--blue-soft); color: var(--blue); }
.tag-sleep, .tag-rest { background: var(--purple-soft); color: var(--purple); }
.tag-gut, .tag-digestion { background: var(--green-soft); color: var(--green); }
.tag-immunity { background: var(--amber-soft); color: var(--amber); }
.tag-mood, .tag-calm { background: var(--pink-soft); color: var(--pink); }
.tag-recovery, .tag-performance { background: var(--red-soft); color: var(--red); }
.tag-heart { background: var(--red-soft); color: var(--red); }
.tag-anti-inflammatory { background: var(--amber-soft); color: var(--amber); }
.tag-metabolic { background: var(--orange-soft); color: var(--orange); }
.tag-hormone { background: var(--purple-soft); color: var(--purple); }
.tag-detox { background: var(--green-soft); color: var(--green); }
.tag-beauty { background: var(--pink-soft); color: var(--pink); }
.tag-hydration { background: var(--blue-soft); color: var(--blue); }
.tag-default { background: var(--surface-2); color: var(--text-2); }

/* Status pills */
.ing-card-status {
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.1em;
  padding: 4px 8px; border-radius: 4px; text-transform: uppercase; font-weight: 700;
  display: inline-block;
}
.status--in { background: var(--green-soft); color: var(--green); }
.status--investigating { background: var(--amber-soft); color: var(--amber); }
.status--watching { background: var(--purple-soft); color: var(--purple); }
.status--approved { background: var(--blue-soft); color: var(--blue); }
.status--hold { background: var(--surface-2); color: var(--text-2); }
.status--rejected { background: var(--red-soft); color: var(--red); }

/* Category pill */
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.06em; font-weight: 700;
  text-transform: uppercase;
}
.cat-pill::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--cat-color, var(--text-3));
}

/* Evidence dots */
.evd { display: inline-flex; gap: 2px; align-items: center; }
.evd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); }
.evd-strong .evd-dot:nth-child(-n+5) { background: var(--green); }
.evd-moderate .evd-dot:nth-child(-n+4) { background: var(--blue); }
.evd-preliminary .evd-dot:nth-child(-n+3) { background: var(--amber); }
.evd-anecdotal .evd-dot:nth-child(-n+2) { background: var(--orange); }
.evd-insufficient .evd-dot:nth-child(-n+1) { background: var(--red); }

/* ============= BENEFIT CLUSTERS ============= */
.benefit-clusters { display: flex; flex-direction: column; gap: 18px; }
.benefit-cluster {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.benefit-cluster-head {
  padding: 22px 26px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.benefit-cluster-name { font-family: var(--ff-serif); font-size: 24px; font-weight: 400; letter-spacing: -0.02em; }
.benefit-cluster-count {
  font-family: var(--ff-mono); font-size: 11px; padding: 4px 10px; border-radius: 5px;
  background: var(--bg-2); color: var(--text-2); letter-spacing: 0.12em; font-weight: 700;
}
.benefit-cluster-body { padding: 18px 22px; display: flex; flex-wrap: wrap; gap: 6px; }
.cluster-chip {
  font-family: var(--ff-mono); font-size: 12px; padding: 7px 12px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 7px; cursor: pointer;
  transition: all 0.15s; font-weight: 700; text-decoration: none; color: var(--text);
}
.cluster-chip:hover { border-color: var(--text); background: var(--surface); transform: translateY(-1px); }
.cluster-chip.candidate { background: var(--amber-soft); border-color: transparent; color: var(--amber); }

/* ============= FORMULATIONS ============= */
.sku-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.formulation-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
  transition: border-color 0.15s;
}
.formulation-card:hover { border-color: var(--text-2); }
.formulation-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 12px; }
.formulation-card-name { font-family: var(--ff-serif); font-size: 32px; font-weight: 400; letter-spacing: -0.025em; line-height: 1; }
.formulation-card-count { font-family: var(--ff-mono); font-size: 11px; padding: 4px 10px; border-radius: 5px; background: var(--bg-2); color: var(--text-2); letter-spacing: 0.12em; font-weight: 700; }
.formulation-card-desc { font-size: 14px; color: var(--text-2); margin-bottom: 14px; line-height: 1.5; }
.formulation-card-forms {
  font-family: var(--ff-mono); font-size: 11px; color: var(--text-3); margin-bottom: 18px;
  letter-spacing: 0.04em; padding: 10px 12px; background: var(--bg-2); border-radius: 6px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.formulation-card-forms-label { color: var(--text-2); font-weight: 700; letter-spacing: 0.12em; }
.formulation-card-list { display: flex; flex-wrap: wrap; gap: 6px; }
.sku-ing-pill {
  font-family: var(--ff-mono); font-size: 11px; padding: 5px 10px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; transition: all 0.15s; font-weight: 700; text-decoration: none; color: var(--text);
}
.sku-ing-pill:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

/* ============= MAP (real world map with positioned dots) ============= */
.map-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 20px 28px; margin-bottom: 32px; position: relative;
}
.map-legend {
  display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px;
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--text-2);
}
.map-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.map-legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-legend-dot--in { background: var(--accent); }
.map-legend-dot--candidate { background: var(--amber); }
.map-legend-dot--risk { background: var(--text); border: 2px solid var(--red); width: 14px; height: 14px; }

.map-canvas {
  position: relative; width: 100%; aspect-ratio: 950/620; overflow: hidden;
  border-radius: var(--radius-sm); background: var(--bg-2);
}
.map-bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  filter: invert(0%) brightness(1) contrast(1) opacity(0.65);
  pointer-events: none; user-select: none;
}
[data-theme="dark"] .map-bg {
  filter: invert(85%) brightness(0.4) contrast(1.2) opacity(0.7);
}
.map-dots {
  position: absolute; inset: 0; pointer-events: none;
}
.map-dot {
  position: absolute; transform: translate(-50%, -50%);
  border: none; cursor: pointer;
  border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono); font-weight: 700; font-size: 14px;
  color: white; pointer-events: auto;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--accent);
  box-shadow: 0 4px 14px rgba(91,91,214,0.35), 0 0 0 3px rgba(255,255,255,0.6);
  z-index: 2;
}
.map-dot:hover, .map-dot:focus {
  transform: translate(-50%, -50%) scale(1.18); z-index: 10; outline: none;
  box-shadow: 0 8px 24px rgba(91,91,214,0.5), 0 0 0 3px rgba(255,255,255,0.8);
}
.map-dot--in { background: var(--accent); }
.map-dot--candidate { background: var(--amber); box-shadow: 0 4px 14px rgba(217,119,6,0.4), 0 0 0 3px rgba(255,255,255,0.6); }
.map-dot--candidate:hover, .map-dot--candidate:focus { box-shadow: 0 8px 24px rgba(217,119,6,0.5), 0 0 0 3px rgba(255,255,255,0.8); }
.map-dot--risk { background: var(--text); border: 2px solid var(--red); box-shadow: 0 4px 14px rgba(220,38,38,0.4), 0 0 0 3px rgba(255,255,255,0.6); }
.map-dot--risk:hover, .map-dot--risk:focus { box-shadow: 0 8px 24px rgba(220,38,38,0.55), 0 0 0 3px rgba(255,255,255,0.8); }
.map-dot-pulse {
  position: absolute; inset: -8px; border-radius: 50%;
  background: currentColor; opacity: 0.15; pointer-events: none;
  animation: map-pulse 2.6s ease-in-out infinite;
}
.map-dot--in .map-dot-pulse { background: var(--accent); }
.map-dot--candidate .map-dot-pulse { background: var(--amber); }
.map-dot--risk .map-dot-pulse { background: var(--red); }
@keyframes map-pulse {
  0%, 100% { transform: scale(1); opacity: 0.18; }
  50% { transform: scale(1.25); opacity: 0; }
}
.map-dot-count { position: relative; z-index: 1; }
.map-dot-tooltip {
  position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--surface); padding: 10px 14px;
  border-radius: 8px; min-width: 220px; max-width: 280px;
  font-family: var(--ff-sans); font-weight: 400; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity 0.18s;
  box-shadow: var(--shadow-lg); z-index: 100;
}
.map-dot:hover .map-dot-tooltip, .map-dot:focus .map-dot-tooltip { opacity: 1; }
.map-dot-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--text);
}
.map-dot-tooltip-name {
  display: block; font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; opacity: 0.7; margin-bottom: 4px;
}
.map-dot-tooltip-list { display: block; font-size: 12px; line-height: 1.45; }

/* Region cards */
.map-regions {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.map-region-card { background: var(--surface); padding: 20px; transition: background 0.18s; }
.map-region-card.highlight { background: var(--accent-soft); }
.map-region-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 8px; }
.map-region-name { font-family: var(--ff-serif); font-size: 18px; font-weight: 400; letter-spacing: -0.015em; }
.map-region-count {
  font-family: var(--ff-mono); font-size: 10px; color: var(--text-3);
  letter-spacing: 0.12em; font-weight: 700; flex-shrink: 0;
}
.map-region-list { display: flex; flex-wrap: wrap; gap: 5px; }
.map-region-pill {
  font-family: var(--ff-mono); font-size: 11px; padding: 4px 9px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 5px;
  text-decoration: none; color: var(--text); font-weight: 700; transition: all 0.15s;
}
.map-region-pill:hover { border-color: var(--accent); color: var(--accent); }

/* ============= SUPPLY ============= */
.risk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.risk-card { background: var(--surface); padding: 22px; position: relative; }
.risk-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.risk-card.risk-low::before { background: var(--green); }
.risk-card.risk-moderate::before { background: var(--amber); }
.risk-card.risk-high::before { background: var(--orange); }
.risk-card.risk-critical::before { background: var(--red); }
.risk-label { font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }
.risk-count { font-family: var(--ff-serif); font-size: 32px; font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: -0.025em; line-height: 1; }
.risk-list { font-size: 12px; color: var(--text-2); margin-top: 12px; line-height: 1.6; }
.supplier-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.supplier-card { background: var(--surface); padding: 18px 22px; display: flex; flex-direction: column; gap: 4px; }
.supplier-name { font-family: var(--ff-mono); font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }
.supplier-loc { font-size: 12px; color: var(--text-2); font-style: italic; }
.supplier-count { font-family: var(--ff-mono); font-size: 11px; color: var(--text-3); letter-spacing: 0.06em; }
.supplier-link {
  font-family: var(--ff-mono); font-size: 11px; color: var(--accent);
  text-decoration: none; margin-top: 4px; letter-spacing: 0.04em;
}
.supplier-link:hover { text-decoration: underline; }

/* ============= ADD VIEW ============= */
.researcher-wrap { max-width: 760px; }
.researcher-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; overflow: hidden; }
.researcher-header {
  background: linear-gradient(135deg, rgba(91,91,214,0.06), rgba(91,91,214,0.01));
  padding: 32px 32px 24px; border-bottom: 1px solid var(--border);
}
.researcher-header-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em; color: var(--accent);
  text-transform: uppercase; font-weight: 700; margin-bottom: 10px;
}
.researcher-header-eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2.4s ease-in-out infinite; }
.researcher-header h3 { font-family: var(--ff-serif); font-size: 28px; font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 8px; }
.researcher-header p { font-size: 14px; color: var(--text-2); line-height: 1.55; }
.researcher-body { padding: 28px 32px; }
.researcher-prompt {
  font-family: var(--ff-mono); font-size: 11px; color: var(--text-3);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 12px;
}
.researcher-input {
  width: 100%; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--text); font-family: inherit; font-size: 16px;
  margin-bottom: 16px; transition: all 0.15s;
}
.researcher-input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.researcher-textarea {
  width: 100%; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-2); color: var(--text); font-family: inherit; font-size: 14px;
  resize: vertical; min-height: 80px; line-height: 1.55; transition: all 0.15s;
}
.researcher-textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.researcher-footer { display: flex; gap: 12px; align-items: center; justify-content: flex-end; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border); }
.researcher-meta { flex: 1; font-family: var(--ff-mono); font-size: 11px; color: var(--text-3); letter-spacing: 0.04em; }
.researcher-btn {
  background: var(--text); color: var(--surface); padding: 12px 20px; border: none;
  border-radius: 8px; font-family: var(--ff-mono); font-size: 12px;
  font-weight: 700; letter-spacing: 0.06em; cursor: pointer; text-transform: uppercase;
  transition: opacity 0.15s, transform 0.1s; display: inline-flex; align-items: center; gap: 6px;
}
.researcher-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.researcher-btn:not(:disabled):hover { opacity: 0.88; }
.researcher-btn:not(:disabled):active { transform: scale(0.98); }
.researcher-status {
  margin-top: 24px; padding: 16px 20px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 13px; line-height: 1.55; color: var(--text-2);
}
.researcher-status strong { color: var(--text); }
.researcher-status a { color: var(--accent); border-bottom: 1px solid currentColor; text-decoration: none; padding-bottom: 1px; }

.add-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-top: 32px; }
.add-feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 24px; }
.add-feature h4 { font-family: var(--ff-mono); font-size: 11px; font-weight: 700; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-3); }
.add-feature ul { list-style: none; padding: 0; }
.add-feature li { font-size: 13px; color: var(--text-2); padding: 8px 0; border-bottom: 1px dashed var(--border); }
.add-feature li:last-child { border-bottom: none; }

/* ============= DOSSIER PAGE ============= */
.dossier-page { max-width: 1100px; margin: 0 auto; }
.dossier-bar {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px;
  font-family: var(--ff-mono); font-size: 12px;
}
.dossier-back, .dossier-notion {
  text-decoration: none; color: var(--text-2); padding: 8px 12px; border-radius: 6px;
  transition: all 0.15s; font-weight: 700; letter-spacing: 0.04em;
}
.dossier-back:hover { background: var(--surface); color: var(--text); }
.dossier-notion { color: var(--accent); }
.dossier-notion:hover { background: var(--accent-soft); }

.dossier-hero {
  padding: 56px 0 32px; border-bottom: 1px solid var(--border); margin-bottom: 32px;
  position: relative;
}
.dossier-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ff-mono); font-size: 12px; letter-spacing: 0.18em;
  color: var(--cat-color, var(--text-3)); text-transform: uppercase; font-weight: 700;
  margin-bottom: 18px;
}
.dossier-cat-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--cat-color, var(--text-3));
}
.dossier-name {
  font-family: var(--ff-serif); font-weight: 400;
  font-size: clamp(56px, 9vw, 96px);
  letter-spacing: -0.04em; line-height: 0.98; margin-bottom: 8px;
}
.dossier-latin { font-size: 18px; color: var(--text-3); font-style: italic; margin-bottom: 24px; }
.dossier-status-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Snapshot grid (key facts) */
.dossier-snapshot {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 32px;
}
.dossier-snapshot-item { background: var(--surface); padding: 20px 22px; }
.dossier-snapshot-label {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; font-weight: 700;
}
.dossier-snapshot-value {
  font-family: var(--ff-serif); font-size: 22px; font-weight: 400;
  letter-spacing: -0.02em; line-height: 1.15;
  display: flex; align-items: center; gap: 8px;
}
.dossier-snapshot-value.risk-critical { color: var(--red); }
.dossier-snapshot-value.risk-high { color: var(--orange); }
.dossier-snapshot-value.risk-moderate { color: var(--amber); }
.dossier-snapshot-value.risk-low { color: var(--green); }
.dossier-snapshot-text { font-family: var(--ff-mono); font-size: 13px; font-weight: 700; }

/* Quick facts band */
.dossier-quickfacts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; padding: 24px; background: var(--bg-2); border-radius: var(--radius);
  margin-bottom: 56px;
}
.dossier-quickfact-label {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; font-weight: 700;
}
.dossier-quickfact-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* Body with TOC sidebar */
.dossier-body {
  display: grid; grid-template-columns: 220px 1fr; gap: 56px;
  align-items: start;
}
.dossier-toc {
  position: sticky; top: 100px;
  display: flex; flex-direction: column; gap: 2px;
}
.dossier-toc-label {
  font-family: var(--ff-mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 12px; font-weight: 700;
  padding-left: 12px;
}
.dossier-toc-item {
  font-size: 13px; padding: 8px 12px; border-left: 2px solid transparent;
  text-decoration: none; color: var(--text-3); transition: all 0.15s;
  line-height: 1.4;
}
.dossier-toc-item:hover { color: var(--text); border-left-color: var(--text-3); }
.dossier-toc-item.active { color: var(--text); border-left-color: var(--cat-color, var(--text)); font-weight: 600; }

.dossier-content { max-width: 720px; min-width: 0; }
.dossier-section { margin-bottom: 56px; scroll-margin-top: 100px; }
.dossier-section-title {
  font-family: var(--ff-serif); font-size: 32px; font-weight: 400;
  letter-spacing: -0.025em; line-height: 1.1; margin-bottom: 20px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.dossier-section-body {
  font-size: 16px; line-height: 1.7; color: var(--text);
}
.dossier-section-body p { margin: 0 0 16px; }
.dossier-section-body strong { color: var(--text); font-weight: 600; }
.dossier-section-body em { font-style: italic; color: var(--text-2); }
.dossier-section-body code {
  font-family: var(--ff-mono); font-size: 13px; padding: 2px 6px;
  background: var(--bg-2); border-radius: 4px;
}
.dossier-section-body a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
.dossier-section-body a:hover {
  color: var(--text); border-color: var(--text);
}
.dossier-section-body a:visited { color: var(--purple); }
[data-theme="dark"] .dossier-section-body a:visited { color: #B197FC; }
.dossier-section-body h3 {
  font-family: var(--ff-serif); font-size: 22px; font-weight: 400;
  letter-spacing: -0.015em; margin: 32px 0 14px; line-height: 1.2;
}
.dossier-section-body ul, .dossier-section-body ol { margin: 12px 0 20px; padding-left: 24px; }
.dossier-section-body li { margin-bottom: 8px; line-height: 1.65; }
.dossier-section-body li strong { color: var(--text); font-weight: 600; }

.dossier-meta-table {
  width: 100%; border-collapse: collapse; margin-top: 16px;
  font-size: 14px;
}
.dossier-meta-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.dossier-meta-table tr:last-child td { border-bottom: none; }
.dossier-meta-table td:first-child {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3); width: 200px; font-weight: 700;
}
.dossier-meta-table td:last-child { color: var(--text); }

.dossier-footer {
  margin-top: 80px; padding-top: 32px; border-top: 1px solid var(--border);
}
.dossier-cta-large {
  display: block; padding: 32px; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: inherit;
  transition: all 0.18s;
}
.dossier-cta-large:hover {
  background: var(--surface); border-color: var(--accent); transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.dossier-cta-large-eyebrow {
  display: block; font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em;
  color: var(--text-3); text-transform: uppercase; font-weight: 700; margin-bottom: 8px;
}
.dossier-cta-large-title {
  display: block; font-family: var(--ff-serif); font-size: 28px; font-weight: 400;
  letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 6px;
}
.dossier-cta-large-sub { display: block; font-size: 13px; color: var(--text-2); }

/* ============= DOSSIER SUPPLIER CARDS ============= */
.dossier-suppliers {
  margin-bottom: 56px; padding: 32px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.dossier-suppliers-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap;
}
.dossier-section-eyebrow {
  font-family: var(--ff-mono); font-size: 11px; letter-spacing: 0.18em;
  color: var(--text-3); text-transform: uppercase; font-weight: 700; margin-bottom: 8px;
}
.dossier-suppliers-title {
  font-family: var(--ff-serif); font-size: 28px; font-weight: 400;
  letter-spacing: -0.02em; line-height: 1.15;
}
.dossier-suppliers-link {
  font-family: var(--ff-mono); font-size: 11px; color: var(--accent);
  text-decoration: none; padding: 8px 12px; border-radius: 6px;
  background: var(--accent-soft); font-weight: 700; letter-spacing: 0.04em;
  white-space: nowrap; transition: all 0.15s;
}
.dossier-suppliers-link:hover { background: var(--accent); color: var(--surface); }

.dossier-supplier-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}
.supplier-detail-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 20px; position: relative; transition: all 0.18s;
  display: flex; flex-direction: column; gap: 10px;
}
.supplier-detail-card:hover {
  border-color: var(--text-2); transform: translateY(-1px); box-shadow: var(--shadow);
}
.supplier-detail-card.is-current { border-color: var(--green); background: var(--surface); }
.supplier-detail-badge {
  position: absolute; top: 14px; right: 14px;
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.12em;
  padding: 3px 8px; border-radius: 4px;
  background: var(--green); color: var(--surface); font-weight: 700;
}
.supplier-detail-name {
  font-family: var(--ff-serif); font-size: 20px; font-weight: 400;
  letter-spacing: -0.015em; line-height: 1.2; padding-right: 110px;
}
.supplier-detail-card:not(.is-current) .supplier-detail-name { padding-right: 0; }
.supplier-detail-loc {
  font-family: var(--ff-mono); font-size: 11px; color: var(--text-2);
  letter-spacing: 0.04em;
}
.supplier-detail-specialty {
  font-size: 13px; color: var(--text); line-height: 1.5;
}
.supplier-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.supplier-detail-grid > div { display: flex; flex-direction: column; gap: 2px; }
.supplier-detail-label {
  font-family: var(--ff-mono); font-size: 9px; letter-spacing: 0.12em;
  color: var(--text-3); text-transform: uppercase; font-weight: 700;
}
.supplier-detail-value {
  font-family: var(--ff-mono); font-size: 12px; font-weight: 700; color: var(--text);
}
.supplier-detail-certs {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.supplier-detail-cert {
  font-family: var(--ff-mono); font-size: 9px; padding: 3px 7px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); font-weight: 700;
}
.supplier-detail-card.is-current .supplier-detail-cert { background: var(--bg-2); }
.supplier-detail-notes {
  font-size: 12px; color: var(--text-2); line-height: 1.5; font-style: italic;
}
.supplier-detail-link {
  font-family: var(--ff-mono); font-size: 12px; color: var(--accent);
  text-decoration: none; margin-top: auto; padding-top: 4px;
  letter-spacing: 0.04em; font-weight: 700;
}
.supplier-detail-link:hover { text-decoration: underline; }

/* ============= FOOTER ============= */
.footer { border-top: 1px solid var(--border); padding: 36px 0; margin-top: 80px; background: var(--surface); }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
  font-family: var(--ff-mono); font-size: 12px; color: var(--text-2); letter-spacing: 0.04em;
}
.footer-inner a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 1px; transition: border-color 0.15s; }
.footer-inner a:hover { border-color: var(--accent); color: var(--accent); }

/* ============= RESPONSIVE ============= */
@media (max-width: 900px) {
  .nav-inner { padding: 12px 16px; gap: 12px; }
  .nav-links { order: 3; width: 100%; padding-top: 8px; border-top: 1px solid var(--border); }
  .nav-link { padding: 6px 10px; font-size: 11px; }
  .container { padding: 0 18px; }
  .ing-row {
    grid-template-columns: 4px 1fr auto;
    grid-template-areas:
      "accent name status"
      "accent meta meta";
    padding: 14px 16px;
  }
  .ing-row-accent { grid-area: accent; }
  .ing-row-name { grid-area: name; }
  .ing-row > .ing-row-cell:nth-of-type(2),
  .ing-row > .ing-row-cell:nth-of-type(3),
  .ing-row > .ing-row-cell:nth-of-type(4),
  .ing-row > .ing-row-cell:nth-of-type(5),
  .ing-row > .ing-row-arrow { display: none; }
  .ing-row .ing-row-evidence { grid-area: status; justify-self: end; }
  .ing-rows-header { display: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .evidence-bar { grid-template-columns: repeat(2, 1fr); }
  .filter-bar > * { width: 100%; }
  .filter-segmented { width: 100%; justify-content: space-between; }
  .filter-trigger, .sort-wrap { width: 100%; justify-content: space-between; }
  .researcher-header { padding: 24px; }
  .researcher-body { padding: 24px; }
  .hero-banner { grid-template-columns: 1fr; padding: 24px; }
  .hero-banner-cta { justify-self: start; }
  .page-title { font-size: 36px; }
  .dossier-body { grid-template-columns: 1fr; gap: 32px; }
  .dossier-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .dossier-toc-label { width: 100%; padding-left: 0; }
  .dossier-toc-item { border-left: none; border: 1px solid var(--border); border-radius: 6px; padding: 6px 12px; font-size: 12px; }
  .dossier-toc-item.active { border-color: var(--cat-color, var(--text)); }
  .dossier-section-title { font-size: 24px; }
  .dossier-name { font-size: clamp(40px, 12vw, 64px); }
}
