:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #d9dee7;
  --text: #111827;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --good: #047857;
  --bad: #b91c1c;
  --warn: #b45309;
  --panel: var(--surface);
  --border: var(--line);
  --shadow: 0 14px 35px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  font-weight: 800;
  letter-spacing: 0;
  font-size: 20px;
}

nav {
  display: flex;
  flex: 1;
  gap: 8px;
  justify-content: flex-end;
  margin-left: 18px;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}

nav a,
.tabs a {
  padding: 8px 10px;
  color: var(--muted);
  border-radius: 7px;
  font-size: 14px;
}

nav a.active,
.tabs a.active {
  color: var(--text);
  background: #e8edf7;
}

main {
  width: min(1480px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.workspace-head,
.plugin-head {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-end;
  padding: 22px 0 26px;
}

.page-head {
  display: grid;
  gap: 12px;
  align-items: start;
  padding: 22px 0 26px;
}

.page-head.inline {
  display: flex;
  align-items: center;
}

.workspace-head h1,
.page-head h1,
.plugin-head h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.96;
  letter-spacing: 0;
}

.plugin-head p {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.page-head > p:not(.eyebrow) {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.searchbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 170px auto;
  gap: 8px;
  width: min(720px, 100%);
  padding-bottom: 4px;
}

.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

input,
select,
button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

button {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-bottom: 22px;
}

.metrics div {
  padding: 18px;
  background: var(--surface);
}

.metrics span {
  display: block;
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
}

.metrics label,
td small,
.section-title span,
.signal small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.insight-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-bottom: 22px;
}

.insight-strip div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px;
  background: var(--surface);
}

.insight-strip strong {
  overflow-wrap: anywhere;
  color: var(--accent);
  font-size: 24px;
  line-height: 1.05;
}

.insight-strip span {
  color: var(--muted);
  font-size: 12px;
}

.workspace-command {
  margin-bottom: 22px;
}

.action-list,
.brief-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.action-list {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  border-bottom: 1px solid var(--line);
}

.brief-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.action-card,
.brief-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
}

.action-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.action-card p,
.brief-column p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.queue-list {
  display: grid;
  gap: 8px;
}

.panel-list {
  padding: 16px;
}

.queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.queue-row span,
.queue-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.queue-row span {
  font-weight: 700;
}

.queue-row strong {
  color: var(--accent);
}

.queue-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.grid.two {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 22px;
  margin-bottom: 22px;
}

.cards {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
}

.cards.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cards.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lens-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.lens-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lens-card.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.lens-card p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.opportunity-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.opportunity-card h2,
.opportunity-card h3 {
  margin: 0;
}

.opportunity-card h2 {
  font-size: 22px;
  line-height: 1.15;
}

.opportunity-card h3 {
  font-size: 16px;
}

.opportunity-card p,
.prose p,
.opportunity-card li,
.prose li {
  margin: 0;
  color: #334155;
  line-height: 1.55;
}

.thesis-line {
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f8fafc;
}

.thesis-line strong {
  color: var(--text);
}

.mini-brief {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  background: #f8fafc;
}

.mini-brief strong,
.mini-brief a {
  color: var(--text);
}

.evidence-context-box {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-left: 3px solid #64748b;
  border-radius: 7px;
  background: #f8fafc;
}

.evidence-context-box strong {
  color: #334155;
}

.evidence-context-box p {
  margin: 0;
  color: #475569;
  line-height: 1.45;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-topline strong {
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
}

.score-pills,
.mini-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.score-pills span,
.score-pills a,
.mini-list a,
.mini-list span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
}

.score-pills .trend-growing,
.score-pills .trend-new {
  background: #dcfce7;
  color: var(--good);
}

.source-evidence-list {
  align-items: flex-start;
}

.source-evidence-list a {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-health-panel {
  display: grid;
  gap: 16px;
}

.source-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.source-health-grid > div {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: var(--surface);
}

.source-health-grid strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.source-health-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.source-health-grid p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.source-health-grid .supported span {
  color: var(--good);
}

.source-health-grid .needs-detail span {
  color: var(--warn);
}

.source-health-examples {
  display: grid;
  gap: 8px;
}

.source-health-examples > strong {
  color: var(--text);
}

.score-pills .trend-cooling {
  background: #fef3c7;
  color: var(--warn);
}

.score-pills .trend-steady {
  background: #e8edf7;
  color: var(--muted);
}

.score-pills .evidence-strong {
  background: #dcfce7;
  color: var(--good);
}

.score-pills .evidence-supported {
  background: #e8edf7;
  color: var(--muted);
}

.score-pills .evidence-isolated,
.score-pills .evidence-unknown {
  background: #fef3c7;
  color: var(--warn);
}

.score-pills .context-linked_opportunity {
  background: #dcfce7;
  color: var(--good);
}

.score-pills .context-evidence_only,
.score-pills .context-unmapped_evidence {
  background: #e2e8f0;
  color: #334155;
}

.score-pills .review-verified,
.review-pill.review-verified {
  background: #dcfce7;
  color: var(--good);
}

.score-pills .review-partial,
.review-pill.review-partial {
  background: #fef3c7;
  color: var(--warn);
}

.score-pills .review-needs_evidence,
.review-pill.review-needs_evidence,
.score-pills .review-unreviewed,
.review-pill.review-unreviewed {
  background: #fee2e2;
  color: var(--bad);
}

.score-pills .readiness-build_candidate {
  background: #dcfce7;
  color: var(--good);
}

.role-pill.readiness-build_candidate {
  background: #dcfce7;
  color: var(--good);
}

.score-pills .readiness-watch {
  background: #e8edf7;
  color: var(--muted);
}

.role-pill.readiness-watch {
  background: #e8edf7;
  color: var(--muted);
}

.score-pills .readiness-research_first {
  background: #fef3c7;
  color: var(--warn);
}

.role-pill.readiness-research_first {
  background: #fef3c7;
  color: var(--warn);
}

.score-pills .readiness-ready_for_buyer_validation,
.role-pill.readiness-ready_for_buyer_validation {
  background: #dcfce7;
  color: var(--good);
}

.score-pills .readiness-needs_external_proof,
.score-pills .readiness-needs_thesis_detail,
.score-pills .readiness-needs_thesis_sharpening,
.role-pill.readiness-needs_external_proof,
.role-pill.readiness-needs_thesis_detail,
.role-pill.readiness-needs_thesis_sharpening {
  background: #fef3c7;
  color: var(--warn);
}

.score-pills .readiness-hold,
.role-pill.readiness-hold {
  background: #fee2e2;
  color: var(--bad);
}

.readiness-pills {
  align-items: flex-start;
}

.readiness-box {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.readiness-diagnostics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin: 0 0 22px;
}

.workspace-command .readiness-diagnostics,
.decision-board .readiness-diagnostics {
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.readiness-diagnostics-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--surface);
}

.readiness-diagnostics-card p,
.readiness-diagnostics-card small {
  margin: 0;
  color: #334155;
  line-height: 1.4;
}

.readiness-mini-list span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.readiness-action-list {
  display: grid;
  gap: 8px;
}

.readiness-action-list a {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.readiness-action-list strong,
.readiness-action-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.readiness-action-list strong {
  color: var(--text);
  font-size: 13px;
}

.readiness-action-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.role-pill,
.score-pills [class^="role-"] {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8edf7;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.role-rising_challenger,
.role-rising_with_strain {
  background: #dcfce7;
  color: var(--good);
}

.role-weak_incumbent {
  background: #fee2e2;
  color: var(--bad);
}

.role-praise_owner {
  background: #dbeafe;
  color: var(--accent-dark);
}

.role-major_incumbent {
  background: #fef3c7;
  color: var(--warn);
}

.score-pills .agent-high_priority,
.score-pills .agent-build_candidate,
.score-pills .agent-growing {
  background: #dcfce7;
  color: var(--good);
}

.score-pills .agent-watch,
.score-pills .agent-steady {
  background: #e8edf7;
  color: var(--muted);
}

.score-pills .agent-monitor,
.score-pills .agent-cooling,
.score-pills .agent-research_first {
  background: #fef3c7;
  color: var(--warn);
}

.score-pills .agent-needs_evidence {
  background: #fee2e2;
  color: var(--bad);
}

.score-pills .proof-validated {
  background: #dcfce7;
  color: var(--good);
}

.score-pills .proof-partial,
.score-pills .proof-planned {
  background: #fef3c7;
  color: var(--warn);
}

.score-pills .proof-not_collected,
.score-pills .proof-missing_credentials,
.score-pills .proof-unknown,
.score-pills .proof-error {
  background: #fee2e2;
  color: var(--bad);
}

.proof-callout,
.proof-list {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.proof-callout {
  border-left: 3px solid var(--warn);
}

.proof-callout strong,
.proof-list strong {
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.proof-callout span,
.proof-list span {
  color: #334155;
  font-size: 13px;
  line-height: 1.35;
}

.proof-list span {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow-wrap: anywhere;
}

.score-grid,
.score-strip {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.score-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.score-strip {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  margin-bottom: 22px;
}

.score-grid span,
.score-strip div {
  display: grid;
  gap: 5px;
  padding: 14px;
  background: var(--surface);
}

.score-grid strong,
.score-strip span {
  font-size: 24px;
  line-height: 1;
  color: var(--accent);
}

.score-grid label,
.score-strip label {
  color: var(--muted);
  font-size: 12px;
}

.validation-grid {
  border-width: 0 0 1px;
  border-radius: 0;
}

.validation-copy {
  display: grid;
  gap: 8px;
  padding: 16px 18px 0;
}

.validation-copy p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.thesis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 18px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.thesis-grid div {
  display: grid;
  gap: 7px;
  padding: 14px;
  background: #f8fafc;
}

.thesis-grid strong {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.thesis-grid p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.challenge-strip {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin: 18px 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.challenge-strip div {
  display: grid;
  gap: 4px;
  min-width: 128px;
}

.challenge-strip strong {
  color: var(--accent);
  font-size: 22px;
  line-height: 1;
  text-transform: capitalize;
}

.challenge-strip span,
.challenge-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challenge-strip p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.challenge-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 18px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.challenge-card {
  display: grid;
  gap: 7px;
  padding: 14px;
  background: var(--surface);
}

.challenge-card strong {
  color: var(--text);
}

.challenge-card p,
.challenge-card small {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.challenge-card small {
  color: var(--muted);
}

.challenge-strong span {
  color: var(--good);
}

.challenge-watch span {
  color: var(--accent-dark);
}

.challenge-weak span {
  color: var(--warn);
}

.challenge-missing span {
  color: var(--bad);
}

.external-gate {
  display: grid;
  gap: 10px;
  margin: 18px 18px 0;
  padding: 14px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  background: #fffbeb;
}

.external-gate > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.external-gate strong {
  color: var(--warn);
  font-size: 20px;
  line-height: 1;
  text-transform: capitalize;
}

.external-gate span {
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.external-gate p,
.external-gate li {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.external-gate ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
  margin: 0;
  padding-left: 18px;
}

.external-synthesis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #fde68a;
  border-radius: 7px;
  background: #fde68a;
}

.external-synthesis span {
  display: grid;
  gap: 3px;
  padding: 10px;
  background: #fff;
  color: #334155;
  letter-spacing: 0;
  text-transform: none;
}

.external-synthesis strong {
  color: var(--warn);
  font-size: 18px;
  line-height: 1.1;
}

.external-synthesis label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.external-signal-list {
  border-top: 1px solid #fde68a;
  padding-top: 8px;
}

.external-records {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.external-records span {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid #fde68a;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
}

.external-records strong {
  color: var(--warn);
  font-size: 12px;
}

.external-records small {
  color: var(--muted);
}

.validation-table {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.prose {
  padding: 20px;
}

.prose h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.prose h2:not(:first-child) {
  margin-top: 20px;
}

.prose ul,
.opportunity-card ul {
  margin: 0;
  padding-left: 18px;
}

.review-summary {
  display: grid;
  gap: 8px;
}

.review-summary strong {
  color: var(--accent);
  font-size: 42px;
  line-height: 1;
}

.review-pill {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-intro {
  max-width: 920px;
  margin: 0;
  color: var(--muted);
}

.claim-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
  margin-top: 18px;
}

.claim-grid div {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: var(--surface);
}

.claim-grid strong {
  color: var(--text);
}

.claim-grid p,
.claim-grid small {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.claim-grid small {
  color: var(--muted);
}

.claim-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.claim-grid .supported span {
  color: var(--good);
}

.claim-grid .missing span {
  color: var(--bad);
}

.decision-buckets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.decision-bucket {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border-top: 3px solid var(--line);
  background: var(--surface);
}

.decision-bucket > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.decision-validate_now {
  border-top-color: var(--good);
}

.decision-proof_blocked,
.decision-investigate_pain {
  border-top-color: var(--warn);
}

.decision-hold {
  border-top-color: var(--bad);
}

.decision-list {
  display: grid;
  gap: 10px;
}

.decision-row {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.decision-row p,
.decision-row small {
  margin: 0;
  color: #334155;
  line-height: 1.4;
}

.decision-row small {
  color: var(--muted);
}

.decision-row.muted {
  background: #fff;
}

.validation-list {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
}

.validation-head {
  gap: 8px;
  padding: 16px 0 18px;
}

.validation-head h1 {
  max-width: 720px;
  font-size: 36px;
  line-height: 1.08;
}

.validation-head > p:not(.eyebrow) {
  margin-top: 0;
  font-size: 15px;
}

.validation-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.validation-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  align-items: start;
  gap: 16px;
  min-width: 0;
}

.validation-card-main,
.validation-card-side,
.validation-task-list,
.validation-section,
.validation-proof-box,
.source-link-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.validation-task-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.validation-task-list > div,
.validation-proof-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafc;
}

.competitor-gap-box {
  padding: 12px;
  border: 1px solid #bae6fd;
  border-radius: 7px;
  background: #f0f9ff;
}

.validation-task-list strong,
.validation-proof-box strong,
.validation-section h3 {
  color: var(--text);
}

.validation-task-list span,
.validation-proof-box span,
.validation-proof-box small,
.validation-section p,
.validation-section li,
.validation-api-panel p {
  color: #334155;
  line-height: 1.45;
}

.validation-section h3 {
  margin: 0;
  font-size: 14px;
}

.validation-details {
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.validation-details summary {
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.validation-details[open] {
  display: grid;
  gap: 9px;
}

.validation-section p,
.validation-section ul,
.validation-api-panel p {
  margin: 0;
}

.source-link-list a {
  min-width: 0;
  overflow: hidden;
  color: var(--accent);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-link-list span {
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.validation-family-brief,
.validation-api-panel {
  margin-bottom: 22px;
}

.thesis-review-head {
  margin-bottom: 18px;
}

.thesis-review-strip {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  overflow: visible;
  border: 0;
  background: transparent;
  margin-bottom: 22px;
}

.thesis-review-strip div {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.thesis-review-note {
  margin-bottom: 22px;
}

.thesis-review-note p {
  margin: 0;
  padding: 0 18px 18px;
  color: #334155;
  line-height: 1.5;
}

.thesis-review-list {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}

.thesis-review-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.thesis-review-card.status-needs_product_research {
  border-left-color: var(--warn);
}

.thesis-review-card.status-evidence_watchlist {
  border-left-color: #2563eb;
}

.thesis-review-card.status-known_playbook_refresh {
  border-left-color: var(--good);
}

.thesis-review-card.status-generic_category,
.thesis-review-card.status-keep_generic,
.thesis-review-card.status-directory_noise {
  border-left-color: #64748b;
}

.thesis-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.thesis-review-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.thesis-review-main p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.thesis-review-main ul {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.45;
}

.thesis-review-evidence {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.thesis-review-evidence summary {
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.thesis-review-evidence[open] {
  display: grid;
  gap: 9px;
}

.thesis-review-scores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.thesis-review-scores span {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid #edf0f4;
  border-radius: 7px;
  background: #f8fafc;
}

.thesis-review-scores strong {
  color: var(--text);
  font-size: 18px;
}

.thesis-review-scores label {
  color: var(--muted);
  font-size: 12px;
}

.thesis-review-pager {
  margin-bottom: 22px;
}

.thesis-family-briefs {
  margin-bottom: 22px;
}

.thesis-family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  padding: 0 18px 18px;
}

.thesis-family-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.thesis-family-card h3 {
  margin: 0;
  font-size: 18px;
}

.thesis-family-card p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.thesis-family-card ul {
  margin: 0;
  padding-left: 18px;
  color: #334155;
}

.coverage-gaps {
  margin-bottom: 22px;
}

.coverage-gaps ul {
  padding: 18px 36px 22px;
}

.coverage-health {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
  border-left: 4px solid var(--good);
}

.coverage-health.attention,
.coverage-health.slow {
  border-left-color: var(--warn);
}

.coverage-health p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.coverage-health > small {
  color: var(--muted);
  line-height: 1.45;
}

.coverage-health ul {
  margin: 0;
  padding-left: 20px;
  color: #7c2d12;
  line-height: 1.45;
}

.coverage-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.coverage-health-item {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border-top: 3px solid var(--warn);
  background: #f8fafc;
}

.coverage-health-item.good {
  border-top-color: var(--good);
}

.coverage-health-item.attention,
.coverage-health-item.thin {
  border-top-color: var(--bad);
}

.coverage-health-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.coverage-health-stats span {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.coverage-health-item small {
  color: var(--muted);
  line-height: 1.45;
}

.coverage-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.coverage-step {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
}

.coverage-step p,
.coverage-step small {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.coverage-step small {
  color: var(--muted);
  font-size: 12px;
}

.coverage-bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e8edf7;
}

.coverage-bar span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.coverage-step.good .coverage-bar span {
  background: var(--good);
}

.coverage-step.partial .coverage-bar span {
  background: var(--warn);
}

.coverage-step.thin .coverage-bar span {
  background: var(--bad);
}

.finding-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.finding-grid article {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 16px;
  background: var(--surface);
}

.finding-grid h3,
.finding-grid p {
  margin: 0;
}

.finding-grid h3 {
  font-size: 16px;
  line-height: 1.25;
}

.finding-grid p,
.finding-grid small {
  color: #334155;
  line-height: 1.45;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.panel.spaced {
  margin-top: 22px;
}

.opportunity-matrix {
  margin-bottom: 22px;
}

.opportunity-scroll {
  display: grid;
  gap: 22px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
}

.section-title a {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
}

.coverage-command {
  display: block;
  max-width: 380px;
  padding: 7px 8px;
  border: 1px solid #edf0f4;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.health-command {
  max-width: none;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.grid.two table {
  min-width: 620px;
}

.compact table {
  min-width: 0;
}

.competitor-list {
  display: grid;
}

.competitor-row {
  display: grid;
  gap: 10px;
  padding: 15px 16px;
  border-bottom: 1px solid #edf0f4;
}

.competitor-row-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.competitor-row a {
  font-weight: 800;
}

.competitor-row small,
.competitor-row p {
  color: var(--muted);
  line-height: 1.4;
}

.competitor-row small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.competitor-row p {
  margin: 0;
  font-size: 13px;
}

.competitor-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid #edf0f4;
  border-radius: 7px;
  background: #edf0f4;
}

.competitor-metrics span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px;
  background: #f8fafc;
}

.competitor-metrics strong {
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

td a {
  font-weight: 700;
}

td strong {
  color: var(--accent);
}

.warn {
  color: var(--warn);
}

.signal-list {
  display: grid;
}

.signal {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-bottom: 1px solid #edf0f4;
}

.signal:hover {
  background: #f8fafc;
}

.signal span,
.signal-row span {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8edf7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.signal.complaint span,
.signal-row.complaint span {
  background: #fee2e2;
  color: var(--bad);
}

.signal.praise span,
.signal-row.praise span {
  background: #dcfce7;
  color: var(--good);
}

.empty {
  padding: 20px;
  color: var(--muted);
}

.evidence-list {
  display: grid;
}

.evidence-main-grid {
  display: grid;
  gap: 22px;
}

.evidence-overview {
  margin-bottom: 22px;
}

.evidence-family-brief {
  margin-bottom: 18px;
}

.evidence-family-brief .mini-list {
  padding: 0 18px 16px;
}

.evidence-mini-list {
  padding: 16px;
}

.evidence-row {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-bottom: 1px solid #edf0f4;
}

.evidence-row:hover {
  background: #f8fafc;
}

.evidence-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.evidence-row-top > span {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8edf7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.evidence-row.complaint .evidence-row-top > span {
  background: #fee2e2;
  color: var(--bad);
}

.evidence-row.praise .evidence-row-top > span {
  background: #dcfce7;
  color: var(--good);
}

.evidence-row p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.evidence-snippet {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  background: #f8fafc;
}

.evidence-snippet span {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8edf7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.evidence-snippet.complaint span {
  background: #fee2e2;
  color: var(--bad);
}

.evidence-snippet.praise span {
  background: #dcfce7;
  color: var(--good);
}

.evidence-snippet p {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.evidence-snippet a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.evidence-row small {
  color: var(--muted);
  line-height: 1.45;
}

.source-page-head h1 {
  max-width: 980px;
}

.source-actions {
  align-items: flex-start;
}

.evidence-source-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
  gap: 22px;
  margin-bottom: 22px;
}

.source-main-panel,
.source-side {
  min-width: 0;
}

.source-side {
  display: grid;
  align-content: start;
  gap: 22px;
}

.source-body,
.source-analysis {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.source-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.source-meta span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.source-text {
  max-height: 720px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #334155;
  line-height: 1.55;
}

.source-analysis p,
.comment-row p {
  margin: 0;
  color: #334155;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.comment-list {
  display: grid;
}

.comment-row {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid #edf0f4;
}

.research-main-grid {
  display: grid;
  gap: 22px;
}

.research-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.research-mini-list {
  padding: 16px;
}

.research-family-brief {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
}

.research-family-brief p {
  margin: 0 16px;
  color: #334155;
  font-size: 13px;
  line-height: 1.4;
}

.research-family-brief .score-pills {
  padding: 0 16px;
}

.research-queue-list {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.research-queue-list > span {
  color: var(--muted);
  font-size: 13px;
}

.research-budget-alert {
  display: grid;
  gap: 4px;
  margin: 16px 16px 0;
  padding: 10px 11px;
  border: 1px solid #fed7aa;
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  background: #fff7ed;
}

.research-budget-alert strong {
  color: #9a3412;
  font-size: 13px;
}

.research-budget-alert span {
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.35;
}

.research-automation-status {
  display: grid;
  gap: 4px;
  margin: 12px 16px 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f8fafc;
}

.research-automation-status.status-waiting_for_daily_cap {
  border-left-color: var(--warn);
  background: #fff7ed;
}

.research-automation-status.status-ready,
.research-automation-status.status-complete {
  border-left-color: var(--good);
  background: #f0fdf4;
}

.research-automation-status.status-running,
.research-automation-status.status-waiting,
.research-automation-status.status-empty,
.research-automation-status.status-stale_run {
  border-left-color: var(--warn);
  background: #fff7ed;
}

.research-automation-status.status-disabled,
.research-automation-status.status-planning_only,
.research-automation-status.status-paid_disabled,
.research-automation-status.status-cycle_cap_zero,
.research-automation-status.status-not_api_backed,
.research-automation-status.status-missing_openai_key {
  border-left-color: var(--bad);
  background: #fff1f2;
}

.research-automation-status strong,
.research-automation-status span,
.research-automation-status small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.research-automation-status strong {
  color: var(--text);
  font-size: 13px;
}

.research-automation-status span {
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
}

.research-automation-status small {
  color: var(--muted);
  font-size: 12px;
}

.research-queue-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.research-queue-item:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.research-queue-item strong,
.research-queue-item span,
.research-queue-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-queue-item strong {
  color: var(--text);
  font-size: 14px;
}

.research-queue-item span {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.research-queue-item small {
  color: var(--muted);
  font-size: 12px;
}

.research-command {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding: 7px 8px;
  border: 1px solid #edf0f4;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.research-queue-item.status-not_collected {
  border-left: 4px solid var(--bad);
}

.research-queue-item.status-partial,
.research-queue-item.status-planned {
  border-left: 4px solid var(--warn);
}

.research-gap-list {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.research-gap-list > span {
  color: var(--muted);
  font-size: 13px;
}

.research-gap-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f8fafc;
}

.research-gap-item:hover {
  border-color: #cbd5e1;
  border-left-color: var(--accent-dark);
  background: #fff;
}

.research-gap-item > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.research-gap-item strong,
.research-gap-item span,
.research-gap-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-gap-item strong {
  color: var(--text);
  font-size: 14px;
}

.research-gap-item span,
.research-gap-item small {
  color: var(--muted);
  font-size: 12px;
}

.research-gap-counts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.research-gap-counts span {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: #475569;
  font-weight: 800;
}

.research-list {
  display: grid;
}

.research-row {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px 18px;
  border-bottom: 1px solid #edf0f4;
}

.research-row:hover {
  background: #f8fafc;
}

.research-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.research-row-top > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.research-market {
  width: fit-content;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.research-market:hover,
.research-source:hover {
  color: var(--accent);
}

.research-row small,
.research-source {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.research-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.research-status span {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e8edf7;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.research-status strong {
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.status-collected .research-status span {
  background: #dcfce7;
  color: var(--good);
}

.status-partial .research-status span,
.status-planned .research-status span,
.status-missing_credentials .research-status span,
.status-missing_source .research-status span {
  background: #fef3c7;
  color: var(--warn);
}

.status-error .research-status span,
.status-unsupported_provider .research-status span {
  background: #fee2e2;
  color: var(--bad);
}

.research-summary {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.research-query {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #edf0f4;
  border-radius: 7px;
  background: #f8fafc;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.research-row .score-pills span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.research-source {
  overflow-wrap: anywhere;
}

.research-error {
  color: var(--bad);
}

@media (min-width: 981px) {
  main.evidence-main {
    height: calc(100vh - 64px);
    padding: 18px 0;
    overflow: hidden;
  }

  .evidence-workspace {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
    height: 100%;
    min-height: 0;
  }

  .evidence-workspace .page-head {
    gap: 10px;
    padding: 0;
  }

  .evidence-workspace .eyebrow {
    margin-bottom: 2px;
  }

  .evidence-workspace .page-head h1 {
    max-width: none;
    font-size: 32px;
    line-height: 1.08;
  }

  .evidence-workspace .filters {
    display: grid;
    grid-template-columns: minmax(180px, 1.25fr) repeat(5, minmax(130px, 1fr)) auto;
    gap: 8px;
  }

  .evidence-workspace .filters input,
  .evidence-workspace .filters select,
  .evidence-workspace .filters button {
    width: 100%;
    min-width: 0;
  }

  .evidence-workspace .insight-strip,
  .evidence-overview {
    margin-bottom: 0;
  }

  .evidence-main-grid {
    grid-template-columns: minmax(310px, 0.52fr) minmax(0, 1fr);
    min-height: 0;
  }

  .evidence-overview.grid.two {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .evidence-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
  }

  .evidence-list {
    min-height: 0;
    overflow: auto;
  }

  .evidence-row {
    gap: 5px;
    padding: 13px 16px;
  }

  .evidence-row p,
  .evidence-row small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
  }

  .evidence-row p {
    -webkit-line-clamp: 2;
  }

  .evidence-row small {
    -webkit-line-clamp: 1;
  }
}

@media (min-width: 981px) {
  main.research-main {
    height: calc(100vh - 64px);
    padding: 18px 0;
    overflow: hidden;
  }

  .research-workspace {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
    height: 100%;
    min-height: 0;
  }

  .research-workspace .page-head {
    gap: 10px;
    padding: 0;
  }

  .research-workspace .eyebrow {
    margin-bottom: 2px;
  }

  .research-workspace .page-head h1 {
    max-width: none;
    font-size: 32px;
    line-height: 1.08;
  }

  .research-filters {
    display: grid;
    grid-template-columns: minmax(190px, 1.2fr) repeat(4, minmax(130px, 1fr)) auto;
    gap: 8px;
  }

  .research-filters select,
  .research-filters button {
    width: 100%;
    min-width: 0;
  }

  .research-workspace .insight-strip {
    margin-bottom: 0;
  }

  .research-main-grid {
    grid-template-columns: minmax(270px, 0.34fr) minmax(0, 1fr);
    min-height: 0;
    overflow: hidden;
  }

  .research-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow: auto;
    padding-right: 2px;
  }

  .research-side .research-panel {
    flex: 0 0 auto;
  }

  .research-family-brief {
    gap: 7px;
    padding-bottom: 10px;
  }

  .research-family-brief .section-title {
    gap: 10px;
    padding: 11px 16px;
  }

  .research-family-brief .section-title h2 {
    font-size: 16px;
    line-height: 1.15;
  }

  .research-family-brief p {
    display: -webkit-box;
    margin: 0 16px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }

  .research-family-brief .research-mini-list {
    max-height: 32px;
    padding: 0 16px;
    overflow: hidden;
  }

  .research-family-brief .score-pills {
    padding: 0 16px;
  }

  .research-side .research-queue-panel,
  .research-side .research-gap-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: clamp(150px, 22vh, 230px);
    min-height: 0;
  }

  .research-side .research-queue-panel {
    display: flex;
    flex-direction: column;
    height: clamp(250px, 34vh, 340px);
  }

  .research-side .research-queue-list {
    max-height: min(32vh, 250px);
    overflow: auto;
  }

  .research-side .research-gap-list {
    max-height: min(30vh, 235px);
    overflow: auto;
  }

  .research-side .research-mini-list {
    max-height: 128px;
    overflow: auto;
  }

  .research-side .research-family-brief .research-mini-list {
    max-height: 30px;
    padding: 0 16px;
    overflow: hidden;
    flex-wrap: nowrap;
  }

  .research-side .research-family-brief .research-mini-list a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .research-side .research-family-brief .score-pills {
    display: none;
  }

  .research-side .research-queue-panel .research-queue-list,
  .research-side .research-gap-panel .research-gap-list {
    max-height: none;
    min-height: 0;
  }

  .research-side .research-queue-panel .research-queue-list {
    flex: 1 1 auto;
  }

  .research-results-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
  }

  .research-list {
    min-height: 0;
    overflow: auto;
  }

  .research-row {
    gap: 6px;
    padding: 13px 16px;
  }

  .research-summary,
  .research-query,
  .research-source,
  .research-error {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
  }

  .research-summary {
    -webkit-line-clamp: 2;
  }

  .research-query,
  .research-source,
  .research-error {
    -webkit-line-clamp: 1;
  }
}

@media (min-width: 981px) {
  main.opportunities-main {
    height: calc(100vh - 64px);
    padding: 18px 0;
    overflow: hidden;
  }

  .opportunities-workspace {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 14px;
    height: 100%;
    min-height: 0;
  }

  .opportunities-workspace .page-head {
    gap: 10px;
    padding: 0;
  }

  .opportunities-workspace .eyebrow {
    margin-bottom: 2px;
  }

  .opportunities-workspace .page-head h1 {
    max-width: none;
    font-size: 32px;
    line-height: 1.08;
  }

  .opportunities-workspace .filters {
    flex-wrap: nowrap;
  }

  .opportunities-workspace .filters select {
    min-width: 200px;
  }

  .opportunities-workspace .lens-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 0;
  }

  .opportunities-workspace .lens-card {
    gap: 8px;
    padding: 12px;
  }

  .opportunities-workspace .lens-card p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 13px;
    line-height: 1.35;
  }

  .opportunity-scroll {
    display: block;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
  }

  .opportunity-scroll > * + * {
    margin-top: 16px;
  }

  .opportunities-workspace .opportunity-matrix,
  .opportunities-workspace .cards {
    margin-bottom: 0;
  }

  main.opportunity-detail-main {
    height: calc(100vh - 64px);
    padding: 18px 0;
    overflow: auto;
  }

  main.opportunity-detail-main .page-head {
    gap: 10px;
    padding: 0;
  }

  main.opportunity-detail-main .page-head h1 {
    font-size: 34px;
    line-height: 1.08;
    max-width: none;
  }

  main.opportunity-detail-main .page-head p:last-child {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.signal-timeline {
  display: grid;
  gap: 12px;
}

.signal-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.signal-row h2 {
  margin: 10px 0 8px;
  font-size: 20px;
}

.signal-row p {
  margin: 0 0 10px;
  color: #334155;
  line-height: 1.55;
}

.tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag-row a {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

.scorebox {
  min-width: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.scorebox span {
  display: block;
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}

.scorebox label {
  display: block;
  color: var(--muted);
  margin: 8px 0 18px;
}

.scorebox a {
  color: var(--accent);
  font-weight: 700;
}

#downloadChart {
  width: 100%;
  height: 320px;
  padding: 16px;
}

@media (max-width: 980px) {
  main {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  .workspace-head,
  .page-head,
  .plugin-head,
  .page-head.inline {
    display: grid;
    align-items: start;
  }

  .searchbar {
    grid-template-columns: 1fr;
  }

  .metrics,
  .insight-strip,
  .readiness-diagnostics,
  .action-list,
  .brief-grid,
  .lens-grid,
  .grid.two,
  .validation-card-grid,
  .thesis-review-grid,
  .cards.two,
  .cards.three,
  .score-strip,
  .claim-grid,
  .source-health-grid,
  .decision-buckets,
  .challenge-grid,
  .finding-grid,
  .coverage-steps {
    grid-template-columns: 1fr;
  }

	  .coverage-health-grid {
	    grid-template-columns: 1fr;
	  }

  .validation-task-list {
    grid-template-columns: 1fr;
  }

	  .score-grid {
	    grid-template-columns: repeat(2, minmax(0, 1fr));
	  }

  .thesis-grid {
    grid-template-columns: 1fr;
  }

  .challenge-strip {
    grid-template-columns: 1fr;
  }

  .external-gate > div:first-child {
    display: grid;
  }

  .external-gate ul {
    grid-template-columns: 1fr;
  }

  .external-synthesis {
    grid-template-columns: 1fr;
  }

  .external-records {
    grid-template-columns: 1fr;
  }

  .evidence-source-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 14px;
    gap: 12px;
    overflow: hidden;
  }

  nav {
    flex: 1;
    min-width: 0;
    max-width: 100%;
  }

  .page-head,
  .page-head > *,
  .opportunities-workspace,
  .opportunity-scroll {
    min-width: 0;
    max-width: 100%;
  }

  .filters {
    width: 100%;
  }

  .filters select,
  .filters button,
  .source-evidence-list a {
    min-width: 0;
    max-width: 100%;
  }
}
