.paper-link {
  width: 100%;
  text-align: left;
}

/* Unified research-workbench system */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --ink: #1d2734;
  --muted: #657180;
  --line: #d8e0e6;
  --blue: #315f9d;
  --blue-soft: #edf3f8;
  --teal: #1f6b5f;
  --violet: #6d5b78;
  --orange: #b4762b;
  --red: #b5475a;
  --green: #2d795b;
  --shadow: 0 8px 24px rgba(24, 37, 51, .06);
}

* {
  letter-spacing: 0 !important;
}

body {
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}

.sidebar {
  padding: 20px 14px;
  background: #eef1f3;
  border-color: #d5dde3;
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: #215f55;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}

.brand strong { color: #17232d; font-size: 16px; }
.brand small { color: #76828d; font-size: 9px; }

#main-nav {
  margin-top: 34px;
  gap: 3px;
}

#main-nav button {
  min-height: 42px;
  padding: 10px 11px;
  color: #586674;
  border: 1px solid transparent;
  border-radius: 6px;
}

#main-nav button:hover {
  color: #24493f;
  background: rgba(255,255,255,.62);
  border-color: #d9e0e4;
}

#main-nav button.active {
  color: #164e45;
  background: #fff;
  border-color: #cbd8d5;
  box-shadow: inset 3px 0 #1f6b5f;
}

#main-nav button span {
  color: #788691;
  font-size: 10px;
}

#main-nav button b { font-size: 13px; }

.system-card {
  background: rgba(255,255,255,.72);
  border: 1px solid #d6dfe3;
  border-radius: 6px;
  box-shadow: none;
}

.sidebar-toggle {
  top: 20px;
  right: -14px;
  width: 28px;
  height: 28px;
  color: #1f6b5f;
  border-color: #cfd9dd;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(24, 37, 51, .10);
}

.topbar {
  min-height: 64px;
  padding: 0 28px;
  background: rgba(255,255,255,.96);
  border-color: #d8e0e6;
  box-shadow: 0 1px 0 rgba(24,37,51,.02);
}

body[data-active-view="graph"] .topbar,
body[data-active-view="discovery"] .topbar { height: 68px; }

.topbar h1,
body[data-active-view="graph"] .topbar h1,
body[data-active-view="discovery"] .topbar h1 {
  margin-top: 3px;
  font-size: 17px;
}

.topbar .eyebrow,
.top-context { color: #6d7985; font-size: 10px; }

.database-pill,
.quick-links button,
.lang-toggle,
.agent-button {
  min-height: 34px;
  border-radius: 6px;
}

.view {
  width: min(100%, 1680px);
  margin: 0 auto;
  padding: 28px 30px 64px;
}

.view[data-view-panel="graph"],
.view[data-view-panel="discovery"] {
  padding: 22px 28px 28px;
}

.page-intro { margin-bottom: 16px; }
.page-intro h2,
.view[data-view-panel="graph"] .page-intro h2,
.view[data-view-panel="discovery"] .page-intro h2 {
  margin: 4px 0;
  font-size: 24px;
}

.page-intro p,
.view[data-view-panel="graph"] .page-intro p,
.view[data-view-panel="discovery"] .page-intro p {
  max-width: 780px;
  color: #657180;
  font-size: 13px;
  line-height: 1.6;
}

.brand small,
.eyebrow,
.card-head span,
.page-intro > div > span,
.reasoning-head span,
.reasoning-title span {
  color: #657b77;
  font-size: 10px;
}

.card,
.hero,
.filter-card,
.graph-stage,
.evidence-panel,
.landscape-card,
.cluster-detail,
.gap-card,
.detail-card,
.empty,
.signal-score,
.domain-row {
  border-color: #d8e0e6;
  border-radius: 7px;
  box-shadow: var(--shadow);
}

button,
input,
select,
textarea { border-radius: 5px; }

input,
select,
textarea {
  color: #24313e;
  background: #fff;
  border-color: #cbd5dc;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #34796d;
  box-shadow: 0 0 0 3px rgba(31,107,95,.12);
}

.primary,
.analysis-form button,
.component-recommend-form button,
.chat-form button {
  color: #fff;
  background: #1f6b5f;
  border-color: #1f6b5f;
  box-shadow: none;
}

.primary:hover,
.analysis-form button:hover,
.component-recommend-form button:hover { background: #19594f; }

.secondary,
.graph-tools button,
.evidence-actions button {
  color: #315f71;
  background: #f7f9fa;
  border-color: #cfd9df;
}

.graph-search,
.analysis-form,
.filter-card {
  background: #fff;
  border-color: #d8e0e6;
  border-radius: 7px;
  box-shadow: none;
}

.graph-layout,
.landscape-grid { gap: 12px; }

.graph-stage,
.landscape-card {
  overflow: hidden;
  background: #fbfcfd;
}

.view[data-view-panel="graph"] .graph-toolbar,
.graph-toolbar {
  min-height: 48px;
  background: #fff;
  border-color: #d8e0e6;
}

.graph-tools button {
  min-width: 32px;
  height: 32px;
  border: 1px solid #d3dde2;
  border-radius: 5px;
}

.graph-tools button:hover,
.graph-tools button.active {
  color: #fff;
  background: #315f71;
  border-color: #315f71;
}

.graph-filterbar {
  background: #f7f9fa;
  border-color: #dde4e8;
}

.graph-type-filter button,
.graph-focus-control button {
  border-radius: 4px;
}

.view[data-view-panel="graph"] #graph-canvas,
#graph-canvas {
  background-color: #fbfcfd;
  background-image: radial-gradient(circle, #ccd6dd 1px, transparent 1px);
  background-size: 22px 22px;
}

.evidence-panel {
  background: #fff;
  box-shadow: none;
}

.node-detail-card,
.node-path-panel,
.graph-paper-link,
.relation-row {
  border-radius: 6px;
}

.landscape-plot-bg {
  fill: #fafbfc;
  stroke: #d7e0e5;
}

.established { background: #315f9d; }
.emerging { background: #1f7769; }
.unexplored { background: #6d5b78; }
.anomaly { background: #b5475a; }

.discovery-hypothesis {
  background: #f1f7f5;
  border-color: #2d795b;
}

.reasoning-workbench,
.directed-workbench {
  margin-top: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #d5dfe4;
  border-top: 3px solid #1f6b5f;
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.reasoning-head {
  min-height: 76px;
  padding: 16px 20px;
  align-items: center;
  background: #fff;
  border-color: #dce3e7;
}

.reasoning-head h3 { color: #1f2d38; font-size: 17px; }
.reasoning-head p { max-width: 780px; color: #66737e; font-size: 12px; line-height: 1.5; }

.reasoning-orchestration {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #f5f7f8;
  border-bottom: 1px solid #dce3e7;
}

.reasoning-orchestration > div {
  min-width: 0;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-right: 1px solid #dce3e7;
}

.reasoning-orchestration > div:last-child { border-right: 0; }
.reasoning-orchestration b { color: #2b7166; font: 700 10px ui-monospace, monospace; }
.reasoning-orchestration span,
.reasoning-orchestration strong,
.reasoning-orchestration small { min-width: 0; display: block; }
.reasoning-orchestration strong { color: #30413f; font-size: 11px; }
.reasoning-orchestration small { margin-top: 2px; overflow: hidden; color: #798580; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.reasoning-layout {
  grid-template-columns: minmax(250px, 28%) minmax(0, 1fr);
  min-height: 560px;
}

.reasoning-list {
  padding: 9px;
  background: #f5f7f8;
  border-color: #dce3e7;
}

.reasoning-candidate {
  position: relative;
  min-height: 94px;
  padding: 12px 11px;
  border-radius: 5px;
}

.reasoning-candidate:hover { border-color: #cfdade; box-shadow: none; }
.reasoning-candidate.active { border-color: #83aaa3; box-shadow: inset 3px 0 #1f6b5f; }
.reasoning-candidate span { color: #246b60; font-size: 9px; }
.reasoning-candidate strong { color: #24323d; font-size: 12px; line-height: 1.45; }
.reasoning-candidate small { padding-right: 0; color: #72808b; font-size: 9px; line-height: 1.45; }
.reasoning-candidate em { display: block; margin-top: 7px; font-style: normal; font-size: 9px; font-weight: 700; }

.confidence-high { color: #226b4d !important; }
.confidence-moderate { color: #9a651f !important; }
.confidence-low { color: #a34252 !important; }

.reasoning-detail { padding: 22px; }
.reasoning-title h3 { font-size: 20px; line-height: 1.35; }
.reasoning-rank { min-width: 82px; text-align: right; }
.reasoning-rank strong,
.reasoning-rank small { display: block; }
.reasoning-rank strong { color: #1f6b5f; font-size: 28px; }
.reasoning-rank small { margin-top: 2px; color: #76838e; font-size: 9px; }
.reason-hypothesis { margin: 10px 0 16px; color: #40515f; font-size: 13px; line-height: 1.65; }

.quality-band {
  display: grid;
  grid-template-columns: minmax(210px, 1.4fr) repeat(4, minmax(90px, .65fr));
  border: 1px solid #d8e1e5;
  border-radius: 6px;
  overflow: hidden;
}

.quality-band > div {
  min-width: 0;
  padding: 11px 12px;
  background: #f8fafb;
  border-right: 1px solid #dfe5e8;
}

.quality-band > div:last-child { border-right: 0; }
.quality-band span,
.quality-band strong,
.quality-band small { display: block; }
.quality-band span { color: #73808a; font-size: 9px; }
.quality-band strong { margin-top: 5px; color: #263740; font-size: 15px; }
.quality-band small { margin-top: 4px; color: #76838b; font-size: 9px; line-height: 1.35; }
.quality-band .quality-state { background: #f0f6f4; }
.quality-band .quality-state strong { font-size: 13px; }

.reason-scores {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 12px 0 18px;
  gap: 6px;
}

.reason-score {
  padding: 8px;
  background: #fff;
  border-color: #dfe5e8;
  border-radius: 5px;
}

.reason-score i { background: #e7ecef; border-radius: 2px; }
.reason-score i b { background: #2d795f; }

.causal-workbench {
  margin: 0 -22px;
  padding: 18px 22px;
  background: #f5f7f8;
  border-top: 1px solid #dce3e7;
  border-bottom: 1px solid #dce3e7;
}

.section-kicker { margin-bottom: 10px; color: #266b61; font-size: 10px; font-weight: 800; }

.causal-flow {
  display: grid;
  grid-template-columns: .8fr repeat(2, 1fr) 1.35fr 1.25fr;
  gap: 7px;
  align-items: stretch;
}

.causal-node {
  position: relative;
  min-width: 0;
  min-height: 92px;
  padding: 10px;
  background: #fff;
  border: 1px solid #d7e0e4;
  border-radius: 5px;
}

.causal-node:not(:last-child)::after {
  content: "›";
  position: absolute;
  top: 50%;
  right: -7px;
  z-index: 2;
  width: 13px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #71817f;
  background: #f5f7f8;
  transform: translateY(-50%);
}

.causal-node small { display: block; color: #718079; font-size: 9px; font-weight: 700; }
.causal-node strong { display: block; margin-top: 7px; color: #25343e; font-size: 11px; line-height: 1.4; }
.causal-node p { margin: 7px 0 0; color: #5f6e78; font-size: 10px; line-height: 1.45; }
.causal-node ul { margin: 7px 0 0; padding-left: 15px; color: #53636c; font-size: 9px; line-height: 1.45; }
.causal-node.problem { border-top: 3px solid #b4762b; }
.causal-node.intervention { border-top: 3px solid #315f9d; }
.causal-node.mechanism { border-top: 3px solid #1f6b5f; }
.causal-node.observable { border-top: 3px solid #6d5b78; }

.causal-tests {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.causal-tests > div,
.experiment-decision > div {
  padding: 11px 12px;
  background: #fff;
  border: 1px solid #d9e1e5;
  border-radius: 5px;
}

.causal-tests h4 { margin: 0 0 7px; color: #33434d; font-size: 11px; }
.causal-tests ol { margin: 0; padding-left: 18px; color: #586771; font-size: 10px; line-height: 1.55; }

.expert-panel {
  margin: 18px -22px 0;
  padding: 17px 22px;
  background: #f3f8f6;
  border-color: #d4e1dd;
}

.expert-opinion { border-color: #d5e0dc; border-radius: 5px; }
.constraint-strip span { border-radius: 4px; }

.reason-evidence,
.experiment-columns > div,
.experiment-flow li,
.success-criteria {
  border-radius: 4px;
}

.experiment-decision {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.experiment-decision span { color: #2b6e63; font-size: 10px; font-weight: 800; }
.experiment-decision p { margin: 6px 0 0; color: #53626d; font-size: 10px; line-height: 1.55; }

.assistant {
  background: #fff;
  border-color: #d5dde3;
  box-shadow: -16px 0 40px rgba(24,37,51,.12);
}

.assistant-head { min-height: 68px; background: #f7f9fa; border-color: #d8e0e6; }
.agent-symbol { background: #1f6b5f; border-radius: 6px; }
.agent-trace span,
.message.user .markdown,
.message.bot > .markdown { border-radius: 6px; }
.message.user .markdown { background: #315f71; }
.message.bot > .markdown { background: #f7f9fa; border-color: #dce3e7; }
.chat-form { background: #fff; border-color: #d8e0e6; }

@media (max-width: 1100px) {
  .quality-band { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quality-band .quality-state { grid-column: 1 / -1; }
  .causal-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .causal-node:not(:last-child)::after { display: none; }
  .causal-node.mechanism,
  .causal-node.observable { grid-column: 1 / -1; }
  .reason-scores { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .topbar { padding: 0 14px; }
  .view,
  .view[data-view-panel="graph"],
  .view[data-view-panel="discovery"] { padding: 20px 12px 50px; }
  .page-intro h2,
  .view[data-view-panel="graph"] .page-intro h2,
  .view[data-view-panel="discovery"] .page-intro h2 { font-size: 22px; }
  .reasoning-orchestration { grid-template-columns: 1fr 1fr; }
  .reasoning-orchestration > div:nth-child(2) { border-right: 0; }
  .reasoning-orchestration > div:nth-child(-n+2) { border-bottom: 1px solid #dce3e7; }
  .quality-band { grid-template-columns: 1fr 1fr; }
  .quality-band .quality-state { grid-column: 1 / -1; }
  .quality-band > div:nth-child(odd) { border-right: 0; }
  .causal-workbench,
  .expert-panel { margin-right: -14px; margin-left: -14px; padding-right: 14px; padding-left: 14px; }
  .causal-flow,
  .causal-tests,
  .experiment-decision { grid-template-columns: 1fr; }
  .causal-node.mechanism,
  .causal-node.observable { grid-column: auto; }
  .reason-scores { grid-template-columns: 1fr 1fr; }
  .experiment-flow { grid-template-columns: 1fr; }
}

.paper-actions {
  margin-top: 10px;
}

.paper-actions a {
  text-decoration: none;
}

body {
  font-size: 14px;
}

:root {
  --sidebar: 250px;
}

.sidebar {
  padding: 24px 20px;
}

.brand strong {
  font-size: 18px;
}

.brand small {
  font-size: 9px;
  letter-spacing: .13em;
}

#main-nav {
  margin-top: 46px;
  gap: 8px;
}

#main-nav button {
  min-height: 48px;
  padding: 13px 14px;
  gap: 13px;
}

#main-nav button span {
  width: 28px;
  font-size: 11px;
}

#main-nav button b {
  font-size: 15px;
  font-weight: 700;
}

.system-card strong {
  font-size: 12px;
}

.system-card small,
.sidebar-note {
  font-size: 11px;
}

.topbar {
  padding-inline: clamp(22px, 2.7vw, 42px);
}

.top-context {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

body,
.sidebar,
main,
.brand span:last-child,
#main-nav button b,
.system-card,
.sidebar-note {
  transition: .22s ease;
}

body[data-active-view="graph"] .topbar,
body[data-active-view="discovery"] .topbar {
  height: 78px;
}

body[data-active-view="graph"] .topbar h1,
body[data-active-view="discovery"] .topbar h1 {
  margin-top: 5px;
  font-size: 17px;
}

body[data-active-view="graph"] .topbar .eyebrow,
body[data-active-view="discovery"] .topbar .eyebrow {
  font-size: 10px;
}

.view[data-view-panel="graph"],
.view[data-view-panel="discovery"] {
  padding-top: 26px;
  padding-left: clamp(22px, 2.5vw, 36px);
  padding-right: clamp(22px, 2.5vw, 36px);
}

.view[data-view-panel="overview"] {
  padding-top: 26px;
}

.view[data-view-panel="overview"] .hero {
  min-height: 350px;
  padding-top: 42px;
  padding-bottom: 42px;
  padding-left: clamp(34px, 3.2vw, 48px);
  padding-right: clamp(34px, 3.2vw, 48px);
}

.view[data-view-panel="graph"] {
  padding-bottom: 12px;
}

.view[data-view-panel="graph"] .page-intro,
.view[data-view-panel="discovery"] .page-intro {
  margin-bottom: 10px;
  align-items: center;
}

.view[data-view-panel="graph"] .page-intro h2,
.view[data-view-panel="discovery"] .page-intro h2 {
  margin: 3px 0 2px;
  font-size: clamp(21px, 2vw, 26px);
}

.view[data-view-panel="graph"] .page-intro p,
.view[data-view-panel="discovery"] .page-intro p {
  max-width: 760px;
  font-size: 12px;
  line-height: 1.55;
}

.view[data-view-panel="graph"] .page-intro > div > span,
.view[data-view-panel="discovery"] .page-intro > div > span {
  font-size: 10px;
}

.view[data-view-panel="graph"] .graph-search,
.view[data-view-panel="discovery"] .analysis-form {
  padding: 9px 10px;
  gap: 8px;
}
.model-expert-toggle { min-width: 190px; height: 42px; display: flex !important; align-items: center; gap: 9px; padding: 0 10px; margin: 0 !important; border: 1px solid #d9e3e1; border-radius: 6px; background: #f7faf9; cursor: pointer; }
.model-expert-toggle input { width: 16px !important; height: 16px !important; margin: 0; accent-color: #176d61; }
.model-expert-toggle span,.model-expert-toggle strong,.model-expert-toggle small { display: block; }
.model-expert-toggle strong { color: #2f4e49; font-size: 9px; }
.model-expert-toggle small { margin-top: 2px; color: #74847f; font-size: 7px; }

.view[data-view-panel="graph"] .graph-search input,
.view[data-view-panel="graph"] .graph-search select,
.view[data-view-panel="graph"] .graph-search button,
.view[data-view-panel="discovery"] .analysis-form input,
.view[data-view-panel="discovery"] .analysis-form button {
  height: 36px;
}

.view[data-view-panel="graph"] .resolved-terms {
  min-height: 28px;
  padding: 6px 2px;
}

.view[data-view-panel="discovery"] .analysis-status {
  min-height: 30px;
  padding: 7px 3px;
  line-height: 1.35;
}

.view[data-view-panel="graph"] .graph-layout,
.view[data-view-panel="discovery"] .landscape-grid {
  gap: 10px;
  align-items: stretch;
}

.view[data-view-panel="graph"] .graph-layout {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 270px);
  height: clamp(620px, calc(100vh - 296px), 720px);
}

.page-intro > div > span:first-child { display: none; }
.graph-reading-guide { display: flex; align-items: center; gap: 8px; padding: 10px 15px; color: #667780; border-bottom: 1px solid #e1e7ea; font-size: 11px; }
.graph-reading-guide b { margin-right: 4px; color: #263b43; }
.graph-reading-guide span { padding: 4px 8px; color: #315a55; background: #eef6f4; border-radius: 999px; }
.graph-reading-guide i { color: #8a9aa2; font-style: normal; }
.view[data-view-panel="graph"] .graph-filterbar,
.view[data-view-panel="graph"] .graph-quality { display: none; }
#zoom-out-graph,#zoom-in-graph,#toggle-relations-graph,#fit-graph { display: none; }
.graph-canvas-wrap { overflow: auto; }
#graph-canvas[data-renderer="pathways"] { min-height: 520px; height: auto; padding: 18px; background: #f7f9fa; }
.pathway-focus { display: grid; justify-items: center; gap: 8px; padding: 4px 10px 18px; text-align: center; }
.pathway-focus > span { color: #718089; font-size: 10px; }
.pathway-focus > button { min-width: 220px; max-width: 520px; padding: 12px 18px; display: flex; align-items: center; justify-content: center; gap: 8px; color: #183f39; background: #eaf4f1; border: 1px solid #bfd7d1; border-radius: 8px; }
.pathway-focus > button i { width: 9px; height: 9px; border-radius: 50%; }
.pathway-focus > button small { color: #72827d; }
.pathway-focus > p { max-width: 620px; margin: 0; color: #667780; font-size: 11px; line-height: 1.5; }
.pathway-grid { display: grid; grid-template-columns: repeat(4,minmax(160px,1fr)); gap: 9px; align-items: start; }
.pathway-lane { min-width: 0; background: #fff; border: 1px solid #dfe6e9; border-radius: 8px; overflow: hidden; }
.pathway-lane > header { padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; color: #344a53; background: #f0f4f5; border-bottom: 1px solid #e2e8ea; font-size: 11px; }
.pathway-lane > header small { color: #718189; }
.pathway-lane > div { display: grid; gap: 6px; padding: 7px; }
.pathway-lane > div > p { margin: 10px 5px; color: #8a969c; font-size: 10px; line-height: 1.45; }
.pathway-card { min-width: 0; padding: 8px; display: grid; grid-template-columns: 7px minmax(0,1fr); gap: 3px 7px; color: #334750; background: #fff; border: 1px solid #e3e9eb; border-radius: 6px; text-align: left; }
.pathway-card:hover { border-color: var(--path-color); box-shadow: 0 3px 10px rgba(38,58,67,.08); }
.pathway-card i { grid-row: 1/3; width: 7px; height: 7px; margin-top: 3px; background: var(--path-color); border-radius: 50%; }
.pathway-card span { color: #7b888e; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pathway-card strong { font-size: 10px; line-height: 1.35; font-weight: 650; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .pathway-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .pathway-paper { grid-column: 1/-1; } }

.view[data-view-panel="discovery"] .landscape-grid {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 270px);
  height: clamp(560px, calc(100vh - 360px), 640px);
}

.view[data-view-panel="graph"] .graph-toolbar {
  height: 40px;
}

.view[data-view-panel="graph"] .graph-filterbar {
  min-height: 36px;
  padding: 6px 12px 7px;
}

.view[data-view-panel="graph"] #graph-canvas {
  height: 100%;
}

.view[data-view-panel="graph"] .graph-stage,
.view[data-view-panel="discovery"] .landscape-card {
  min-height: 0;
  height: 100%;
}

.view[data-view-panel="graph"] .graph-stage {
  display: flex;
  flex-direction: column;
}

.view[data-view-panel="graph"] .graph-canvas-wrap {
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.view[data-view-panel="discovery"] .landscape-card {
  display: flex;
  flex-direction: column;
}

.view[data-view-panel="discovery"] .scatter-wrap {
  min-height: 0;
  flex: 1;
  padding: 0;
  overflow: hidden;
}

.view[data-view-panel="graph"] .evidence-panel {
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view[data-view-panel="graph"] #graph-evidence {
  min-height: 0;
  flex: 1;
  max-height: none;
  overflow-y: auto;
  padding-right: 2px;
}

.view[data-view-panel="discovery"] .landscape-card,
.view[data-view-panel="discovery"] .cluster-detail {
  padding: 14px;
}

.view[data-view-panel="discovery"] .cluster-detail {
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view[data-view-panel="discovery"] #cluster-detail {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.view[data-view-panel="discovery"] #cluster-detail.empty-state {
  overflow: hidden;
}

.view[data-view-panel="discovery"] .cluster-paper-list {
  display: grid;
  gap: 6px;
  max-height: min(250px, 30vh);
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.view[data-view-panel="discovery"] .cluster-paper-list .paper-link {
  margin-top: 0;
  padding: 8px 9px;
  display: grid;
  gap: 3px;
  line-height: 1.35;
}

.view[data-view-panel="discovery"] .cluster-paper-list .paper-link strong {
  overflow: hidden;
  color: #334155;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view[data-view-panel="discovery"] .cluster-paper-list .paper-link small {
  overflow: hidden;
  color: #7a8798;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view[data-view-panel="discovery"] .scatter-wrap {
  margin-top: 8px;
  padding: 0;
}

.view[data-view-panel="discovery"] #gap-scatter {
  height: 100%;
}

.view[data-view-panel="discovery"] .axis-x,
.view[data-view-panel="discovery"] .axis-y {
  display: none;
}

.view[data-view-panel="graph"] .node-detail-card .evidence-actions,
.view[data-view-panel="discovery"] #cluster-detail .evidence-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,.72), #fff 32%);
}

.view[data-view-panel="discovery"] .analysis-lower {
  margin-top: 10px;
}

.reasoning-workbench {
  margin-top: 14px;
  border-top: 1px solid #dce5ee;
  border-bottom: 1px solid #dce5ee;
  background: #fff;
}
.directed-workbench { margin-top: 14px; border-top: 3px solid #176b5e; border-bottom: 1px solid #dce5ee; background: #fff; }
.component-recommend-form { display: grid; grid-template-columns: minmax(210px,.75fr) minmax(260px,1.3fr) auto; gap: 9px; align-items: end; padding: 12px 20px; border-bottom: 1px solid #e4eaf1; background: #f7faf9; }
.component-recommend-form label span { display: block; margin-bottom: 5px; color: #607084; font-size: 10px; font-weight: 700; }
.component-recommend-form select,.component-recommend-form input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #cdd9d6; border-radius: 4px; background: #fff; }
.component-recommend-form button { height: 38px; }
.prediction-band { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; margin: 15px 0; }
.prediction-band > div { padding: 10px; border: 1px solid #dfe8e5; background: #f6faf9; }
.prediction-band span,.prediction-band strong { display: block; }
.prediction-band span { color: #667873; font-size: 9px; }
.prediction-band strong { margin-top: 4px; color: #176b5e; font-size: 15px; }
.directed-evidence-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.directed-evidence { min-width: 0; padding: 9px; border: 1px solid #dce5ee; border-radius: 4px; background: #fff; text-align: left; }
.directed-evidence strong,.directed-evidence span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.directed-evidence strong { color: #31566d; font-size: 10px; }
.directed-evidence span { margin-top: 4px; color: #718095; font-size: 9px; }
.directed-groups { grid-template-columns: repeat(3,minmax(0,1fr)); }

.reasoning-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e4eaf1;
}

.reasoning-head span,
.reasoning-title span {
  color: #176b5e;
  font-size: 10px;
  font-weight: 800;
}

.reasoning-head h3,
.reasoning-title h3 { margin: 4px 0 0; }
.reasoning-head p { margin: 0; color: #607084; font-size: 12px; }
.reasoning-layout { display: grid; grid-template-columns: minmax(240px, 30%) minmax(0, 1fr); min-height: 480px; }
.reasoning-list { padding: 10px; border-right: 1px solid #e4eaf1; background: #f6f8fb; }

.reasoning-candidate {
  width: 100%;
  min-height: 82px;
  padding: 12px;
  text-align: left;
  color: #26384c;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
}

.reasoning-candidate + .reasoning-candidate { margin-top: 5px; }
.reasoning-candidate:hover { background: #fff; border-color: #d8e2ed; }
.reasoning-candidate.active { background: #fff; border-color: #63a99d; box-shadow: inset 3px 0 #168272; }
.reasoning-candidate span { display: block; color: #168272; font-size: 10px; font-weight: 800; }
.reasoning-candidate strong { display: block; margin: 5px 0; font-size: 13px; }
.reasoning-candidate small { display: block; color: #788698; }
.reasoning-detail { min-width: 0; padding: 20px; }
.reasoning-title { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
.reasoning-title > strong { color: #176b5e; font-size: 28px; }
.reason-hypothesis { max-width: 850px; color: #42546a; line-height: 1.7; }
.expert-panel { margin: 18px -20px 0; padding: 16px 20px; border-top: 1px solid #dce7e4; border-bottom: 1px solid #dce7e4; background: #f5f9f8; }
.expert-panel-head { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px; gap: 10px; align-items: center; }
.expert-panel-head span { color: #176b5e; font-size: 10px; font-weight: 800; }
.expert-panel-head h4 { margin: 4px 0 0; font-size: 15px; }
.expert-panel-head > div:not(:first-child) { padding-left: 12px; border-left: 1px solid #d4e3df; }
.expert-panel-head > div:not(:first-child) strong, .expert-panel-head > div:not(:first-child) small { display: block; }
.expert-panel-head > div:not(:first-child) strong { font-size: 20px; }
.expert-panel-head > div:not(:first-child) small { color: #6f7f7b; font-size: 9px; }
.constraint-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 13px 0; }
.constraint-strip span { padding: 5px 7px; border: 1px solid #cedbd8; border-radius: 4px; color: #53645f; background: #fff; font-size: 9px; }
.constraint-strip .pass { color: #137263; border-color: #b8d8d1; }
.constraint-strip .fail { color: #ad3544; border-color: #e7bbc1; background: #fff5f6; }
.expert-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.expert-opinion { min-width: 0; padding: 9px; border: 1px solid #dbe5e2; border-radius: 5px; background: #fff; }
.expert-opinion > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.expert-opinion strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.expert-opinion b { color: #176b5e; font-size: 14px; }
.expert-opinion.caution b { color: #a06819; }
.expert-opinion.reject b { color: #b83e4c; }
.expert-opinion p { margin: 7px 0 4px; color: #4d605b; font-size: 10px; line-height: 1.5; }
.expert-opinion small { display: block; color: #8a6940; font-size: 9px; line-height: 1.45; }
.expert-policy { margin: 10px 0 0; color: #667873; font-size: 9px; }
.model-expert-section { margin-top: 11px; padding-top: 10px; border-top: 1px dashed #cbd9d6; }
.model-expert-title { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.model-expert-title strong { color: #294e48; font-size: 10px; }
.model-expert-title span { color: #7b8986; font: 8px monospace; }
.expert-opinion.model { border-style: dashed; }
.reason-scores { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.reason-score { padding: 9px; border: 1px solid #e2e8ef; border-radius: 4px; }
.reason-score span { display: block; color: #647489; font-size: 10px; }
.reason-score i { display: block; height: 4px; margin: 8px 0 5px; overflow: hidden; background: #e8edf2; }
.reason-score i b { display: block; height: 100%; background: #178878; }
.reason-score strong { font-size: 12px; }
.reason-section { margin-top: 19px; }
.reason-section h4, .experiment-columns h4 { margin: 0 0 9px; font-size: 12px; }
.reason-evidence-grid, .experiment-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.reason-evidence { min-width: 0; padding: 10px; border-left: 3px solid #80b8af; background: #f4f8f7; }
.reason-evidence > strong, .reason-evidence > span { display: inline-block; margin-right: 8px; font-size: 11px; }
.reason-evidence button { display: block; width: 100%; min-width: 0; max-width: 100%; padding: 4px 0; overflow: hidden; color: #386a86; background: transparent; border: 0; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.uncertainty { margin: 8px 0 0; color: #8a632c; font-size: 11px; }
.experiment-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.experiment-groups span { min-height: 52px; padding: 9px; border: 1px solid #dce5ee; border-radius: 4px; font-size: 11px; }
.experiment-groups b { display: block; margin-bottom: 3px; color: #178878; }
.experiment-columns { margin-top: 18px; }
.experiment-columns > div { padding: 12px; background: #f7f9fb; }
.experiment-columns ul, .reason-section ul { margin: 0; padding-left: 18px; color: #536378; font-size: 11px; line-height: 1.65; }
.experiment-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; padding: 0; list-style-position: inside; }
.experiment-flow li { min-height: 42px; padding: 9px; background: #edf5f3; color: #36584f; font-size: 11px; }
.success-criteria { padding: 10px; border-left: 3px solid #168272; background: #f2f8f6; color: #3f564f; font-size: 11px; }
.success-criteria b { display: block; margin-bottom: 3px; }
.reason-section details { color: #78633f; font-size: 11px; }
.reason-section summary { cursor: pointer; font-weight: 700; }
.reasoning-feedback { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 20px; padding-top: 12px; border-top: 1px solid #e0e7ed; }
.reasoning-feedback span { margin-right: auto; color: #68788b; font-size: 10px; }
.reasoning-feedback select,.reasoning-feedback input { height: 31px; padding: 0 8px; border: 1px solid #ccd8d6; border-radius: 4px; background: #fff; font-size: 8px; }
.reasoning-feedback input { width: min(230px, 28vw); }
.reasoning-feedback button { padding: 7px 9px; color: #3d5d57; background: #f3f8f7; border: 1px solid #cadbd7; border-radius: 4px; font-size: 9px; }
.reasoning-feedback button:last-child { color: #9d3542; background: #fff5f6; border-color: #e7c3c8; }

@media (max-width: 900px) {
  .reasoning-layout { grid-template-columns: 1fr; }
  .reasoning-list { display: flex; gap: 7px; overflow-x: auto; border-right: 0; border-bottom: 1px solid #e4eaf1; }
  .reasoning-candidate { min-width: 220px; }
  .reason-scores { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .expert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .experiment-groups, .experiment-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .component-recommend-form { grid-template-columns: 1fr 1fr; }
  .component-recommend-form button { grid-column: 1 / -1; }
}

@media (max-width: 580px) {
  .reasoning-head { display: block; }
  .reasoning-head p { margin-top: 8px; }
  .reasoning-detail { padding: 14px; }
  .expert-panel { margin-right: -14px; margin-left: -14px; padding: 14px; }
  .expert-panel-head { grid-template-columns: minmax(0, 1fr) 76px 76px; }
  .expert-grid { grid-template-columns: 1fr; }
  .reasoning-feedback { align-items: stretch; flex-wrap: wrap; }
  .reasoning-feedback span { width: 100%; margin: 0 0 3px; }
  .reasoning-feedback select,.reasoning-feedback input { width: 100%; }
  .reasoning-feedback button { flex: 1; }
  .reason-scores, .reason-evidence-grid, .experiment-columns { grid-template-columns: 1fr; }
  .component-recommend-form,.prediction-band,.directed-evidence-list,.directed-groups { grid-template-columns: 1fr; }
  .component-recommend-form button { grid-column: auto; }
}

.sidebar-toggle {
  position: absolute;
  top: 18px;
  right: -15px;
  width: 30px;
  height: 30px;
  z-index: 30;
  display: grid;
  place-items: center;
  color: #2563eb;
  background: #fff;
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(35, 57, 91, .12);
  font-size: 20px;
  line-height: 1;
}

.sidebar-toggle:hover {
  background: #edf4ff;
}

body.sidebar-collapsed {
  --sidebar: 74px;
}

body.sidebar-collapsed .sidebar {
  padding-left: 13px;
  padding-right: 13px;
  align-items: center;
}

body.sidebar-collapsed .brand {
  justify-content: center;
}

body.sidebar-collapsed .brand span:last-child,
body.sidebar-collapsed #main-nav button b,
body.sidebar-collapsed .system-card small,
body.sidebar-collapsed .system-card strong,
body.sidebar-collapsed .sidebar-note {
  opacity: 0;
  width: 0;
  max-width: 0;
  overflow: hidden;
  pointer-events: none;
}

body.sidebar-collapsed #main-nav {
  width: 100%;
  margin-top: 42px;
}

body.sidebar-collapsed #main-nav button {
  justify-content: center;
  gap: 0;
  padding: 13px 0;
}

body.sidebar-collapsed #main-nav button span {
  width: auto;
  font-size: 11px;
}

body.sidebar-collapsed .system-card {
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
}

body.sidebar-collapsed .system-card > div {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

body.sidebar-collapsed .system-card i {
  width: 9px;
  height: 9px;
}

body.sidebar-collapsed .system-card small,
body.sidebar-collapsed .system-card strong {
  display: none;
}

.brand small,
.eyebrow,
.card-head span,
.page-intro > div > span {
  color: #7c8aa0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

nav button b,
.hero p,
.stat-grid span,
.page-intro p,
.filter-card label span,
.analysis-form label,
.result-toolbar,
.analysis-status {
  font-size: 13px;
}

.filter-card {
  grid-template-columns: minmax(220px, 1.8fr) repeat(2, minmax(115px, .8fr)) repeat(3, minmax(100px, .6fr)) minmax(125px, .75fr) auto;
}

@media (max-width: 1280px) {
  .filter-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .filter-card .wide {
    grid-column: span 2;
  }
}

@media (max-width: 720px) {
  .filter-card,
  .filter-card .wide {
    grid-template-columns: 1fr;
    grid-column: auto;
  }
}

.system-card strong,
.system-card small,
.sidebar-note,
.database-pill,
.quick-links button,
.card-head small,
.card-head button,
.secondary {
  font-size: 12px;
}

.hero .eyebrow.accent {
  color: #1f63dc;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .13em;
}

.stat-grid small {
  color: #7f8da3;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
}

.card-head h3,
.evidence-card h3 {
  font-size: 18px;
}

.record h3,
.gap-card h3,
.review-item h4,
.paper-row h4,
.year-paper h4 {
  font-size: 14px;
}

.record-meta,
.metric span,
.metric small,
.property-list div,
.paper-link,
.gap-card p,
.insight-list div,
.detail-section p,
.performance-table,
.review-item p,
.paper-row p {
  font-size: 12px;
}

.publication-placeholder { display: grid; gap: 8px; padding: 22px 0 6px; color: #607080; }
.publication-placeholder strong { color: #263746; font-size: 15px; }
.publication-placeholder p { margin: 0; font-size: 12px; }
.publication-placeholder code { width: fit-content; padding: 6px 9px; background: #f2f5f7; border: 1px solid #dde5e9; border-radius: 5px; }
.record-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.review-tag { color: #7b4d12; background: #fff4db; border-color: #efd69c; }
.record-summary { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 9px; color: #657681; font-size: 11px; }
.record-summary span { max-width: 260px; }
.record-summary b { display: block; margin-bottom: 2px; color: #344754; font-size: 10px; }
.record-detail-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.record-detail-fields h4 { grid-column: 1/-1; }
.record-detail-fields > div { padding: 10px; background: #f7f9fa; border: 1px solid #e1e7ea; border-radius: 6px; }
.record-detail-fields p { margin: 4px 0 0; }

.metric strong,
.coverage-row,
.graph-toolbar,
.resolved-terms span,
.evidence-actions button,
.cluster-metrics span,
.status-chip {
  font-size: 11px;
}

.coverage-button {
  width: 100%;
  padding: 11px 0;
  display: grid;
  grid-template-columns: minmax(70px, 1fr) auto;
  gap: 7px 12px;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.coverage-button:hover {
  color: #1f63dc;
}

.coverage-button strong {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 2px;
  font-size: 13px;
  white-space: nowrap;
}

.coverage-button strong small {
  color: var(--muted);
  font-size: 10px;
}

.coverage-button .track {
  grid-column: 1 / -1;
}

.coverage-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coverage-card .coverage-list {
  gap: 17px;
}

.coverage-card .card-head {
  align-items: flex-start;
}

.hero-visual .core small {
  font-family: inherit;
  font-size: 12px;
  letter-spacing: .08em;
}

.hero-visual .orbit-node {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

.overview-grid {
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, .75fr);
  align-items: stretch;
  gap: 18px;
}

.overview-grid .card {
  min-width: 0;
}

.trend-card,
.coverage-card {
  min-height: 318px;
}

.trend-card {
  overflow: visible;
}

.year-chart {
  height: 190px;
  gap: 4px;
  padding-top: 22px;
  margin-top: 3px;
  overflow: visible;
}

.year-chart .bar {
  min-width: 0;
  padding: 0;
  border: 0;
  flex: 1 1 0;
  box-shadow: inset 0 0 0 1px rgba(30, 50, 78, .22);
}

.year-chart .bucket-bar {
  opacity: .46;
  background: linear-gradient(to top, #9ab3db, #d3ddeb);
}

.year-chart .bar:hover,
.year-chart .bar.selected {
  transform: translateY(-2px);
}

.year-chart .bar span {
  z-index: 6;
  pointer-events: none;
}

.year-chart .bar:first-child span {
  left: 0;
  transform: none;
}

.year-chart .bar:last-child span {
  left: auto;
  right: 0;
  transform: none;
}

.coverage-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.coverage-card .coverage-list {
  flex: 1;
  align-content: center;
}

.insight-card {
  padding: 22px 24px;
  background: #fff;
}

.insight-card .card-head {
  align-items: center;
}

.signal-score {
  min-height: 86px;
  padding: 16px 18px;
  gap: 16px;
  background: linear-gradient(90deg, #f7fbff 0%, #fff 72%);
  border: 1px solid #dfe8f5;
  border-radius: 14px;
}

.signal-score > strong {
  min-width: 64px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #2563eb;
  background: #eef5ff;
  border: 1px solid #d6e5fb;
  border-radius: 13px;
  font-size: 24px;
}

.signal-score h4 {
  font-size: 16px;
}

.signal-score p {
  max-width: 780px;
  font-size: 12px;
}

.category-detail-card {
  max-width: 860px;
}

.category-summary {
  color: var(--muted);
}

.domain-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.domain-row {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px auto;
  gap: 14px;
  align-items: center;
  background: #f8fbff;
  border: 1px solid #dfe8f5;
  border-radius: 12px;
}

.domain-row h4 {
  margin: 0;
  font-size: 15px;
}

.domain-row p {
  margin: 5px 0;
  color: #52627a;
  font-size: 12px;
}

.domain-row ul {
  margin: 7px 0 0 18px;
  padding: 0;
  color: #6b7890;
  font-size: 11px;
  line-height: 1.5;
}

.domain-meter {
  height: 8px;
  overflow: hidden;
  background: #e6edf7;
  border-radius: 999px;
}

.domain-meter div {
  height: 100%;
  background: linear-gradient(90deg, #6da2ff, #2563eb);
}

.graph-node text,
.gap-point text,
.quadrant-label,
.axis-x,
.axis-y,
.legend {
  font-size: 10px;
}

.landscape-plot-bg {
  fill: rgba(248,251,255,.52);
  stroke: #dce7f4;
  stroke-width: 1;
}

.axis-label {
  fill: #50627a;
  font: 700 10px Inter, "PingFang SC", sans-serif;
  letter-spacing: .02em;
}

.view[data-view-panel="discovery"] .quadrant-label {
  font-size: 11px;
}

.view[data-view-panel="discovery"] .gap-point text {
  font-size: 11px;
  font-weight: 600;
}

.view[data-view-panel="discovery"] .axis-label {
  font-size: 12px;
}

@media (max-width: 1100px) {
  .view[data-view-panel="discovery"] .landscape-grid {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    align-items: start;
  }

  .view[data-view-panel="discovery"] .landscape-card,
  .view[data-view-panel="discovery"] .cluster-detail {
    height: auto;
  }

  .view[data-view-panel="discovery"] .landscape-card {
    min-height: 0;
  }

  .view[data-view-panel="discovery"] .scatter-wrap {
    flex: none;
    width: 100%;
    aspect-ratio: 760 / 470;
    min-height: 360px;
    max-height: 500px;
  }

  .view[data-view-panel="discovery"] #gap-scatter {
    width: 100%;
    height: 100%;
  }

  .view[data-view-panel="discovery"] .cluster-detail {
    max-height: min(460px, 58vh);
  }
}

.assistant {
  width: min(620px, 100vw);
  min-width: 380px;
}

.assistant-resizer {
  position: absolute;
  inset: 0 auto 0 -5px;
  width: 10px;
  z-index: 3;
  cursor: col-resize;
  touch-action: none;
}

.assistant-resizer::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  transition: background .18s;
}

.assistant-resizer:hover::after,
.assistant-resizer:focus::after,
.resizing-agent .assistant-resizer::after {
  background: #2563eb;
}

.resizing-agent {
  cursor: col-resize;
  user-select: none;
}

.assistant-head strong {
  font-size: 15px;
}

.assistant-head small,
.agent-context {
  font-size: 11px;
}

.assistant-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.assistant-actions button {
  width: 34px;
  height: 34px;
  border-radius: 7px;
}

.agent-trace {
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
}

.agent-trace.empty {
  display: none;
}

.agent-trace span {
  font-size: 10px;
}

.markdown {
  font-size: 14px;
  line-height: 1.75;
}

.markdown h2 {
  font-size: 19px;
}

.markdown h3 {
  font-size: 16px;
}

.markdown table,
.source-list a,
.suggestions button {
  font-size: 12px;
}

.markdown code {
  font-size: 12px;
}

.chat-form textarea {
  min-height: 58px;
  font-size: 14px;
  line-height: 1.5;
}

.dropzone.dragging {
  border-color: #2563eb;
  background: #eef5ff;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .12);
}

.upload-queue {
  margin-top: 12px;
  display: grid;
  gap: 7px;
}

.upload-queue > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  background: #f7f9fc;
  border-radius: 7px;
  font-size: 12px;
}

.upload-queue b.done { color: #16845b; }
.upload-queue b.error { color: #cf3f51; }
.upload-queue b.running { color: #2563eb; }
.upload-queue b.duplicate { color: #8a6a12; }

.review-translation {
  margin-top: 8px;
  padding: 10px;
  color: #43546d;
  background: #eef5ff;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.65;
}

.review-actions {
  flex-wrap: wrap;
}

.review-actions button {
  min-width: 72px;
}

.paper-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.paper-inline-actions button {
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 11px;
}

.ai-extract-option {
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #5f6f85;
  font-size: 12px;
  line-height: 1.5;
}

.local-parser-note {
  margin-top: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
  color: #30445f;
  background: #f3f7fd;
  border: 1px solid #dce6f4;
  border-radius: 8px;
}

.local-parser-note span {
  color: var(--muted);
  font-size: 12px;
}

.ai-extract-option input {
  margin-top: 2px;
}

.workflow-guide {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.workflow-guide > div {
  padding: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.workflow-guide b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #2563eb;
  background: #eaf2ff;
  border-radius: 50%;
}

.workflow-guide strong,
.workflow-guide small {
  display: block;
}

.workflow-guide small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.parser-options {
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 0;
}

.parser-options legend {
  width: 100%;
  margin-bottom: 7px;
  color: #53627a;
  font-size: 12px;
  font-weight: 700;
}

.parser-options label {
  min-height: 78px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: start;
  background: #f8faff;
  border: 1px solid #dfe7f4;
  border-radius: 9px;
  cursor: pointer;
}

.parser-options label:has(input:checked) {
  border-color: #6d9bea;
  box-shadow: inset 0 0 0 1px #6d9bea;
  background: #f2f7ff;
}

.parser-options label.disabled {
  opacity: .62;
  cursor: not-allowed;
}

.parser-options strong,
.parser-options small {
  display: block;
}

.parser-options small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.parser-state {
  padding: 4px 6px;
  color: #7d8798;
  background: #edf1f6;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
}

.parser-state.ready {
  color: #137453;
  background: #e6f7ef;
}

.parser-state.offline {
  color: #a05f15;
  background: #fff3df;
}

.ai-extract-option {
  padding: 11px;
  background: #fbfcfe;
  border: 1px solid #e5eaf1;
  border-radius: 8px;
}

.ai-extract-option strong,
.ai-extract-option small {
  display: block;
}

.ai-extract-option small {
  margin-top: 3px;
  color: var(--muted);
}

.parser-explainer {
  margin-top: 16px;
  padding: 13px;
  background: #eef5ff;
  border-radius: 8px;
}

.parser-explainer p {
  margin: 6px 0 0;
  color: #53627a;
  font-size: 12px;
  line-height: 1.65;
}

.review-tabs {
  margin-top: 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.review-tabs button {
  padding: 8px 12px;
  color: #5f6d82;
  background: #f5f7fa;
  border: 1px solid #e0e5ed;
  border-radius: 7px;
  font-size: 12px;
}

.review-tabs button.active {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.review-item {
  grid-template-columns: minmax(280px, 1fr) 190px 240px;
}

.anomaly-item {
  background: #fffaf8;
  border-color: #f0cec6;
}

.anomaly-reasons {
  margin-top: 8px;
  padding: 9px 11px;
  color: #9c3f32;
  background: #fff0ec;
  border-radius: 7px;
  font-size: 11px;
}

.anomaly-reasons ul {
  margin: 5px 0 0 17px;
  padding: 0;
}

.fact-value {
  margin-top: 7px;
  display: block;
  font-size: 14px;
}

.review-item blockquote {
  margin: 8px 0 0;
  padding: 8px 10px;
  color: #5a687d;
  background: #fff;
  border-left: 3px solid #b9cae7;
  font-size: 11px;
  line-height: 1.5;
}

.history-item {
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 180px 110px;
  gap: 10px;
  align-items: center;
  background: #f8f9fc;
  border: 1px solid #edf0f5;
  border-radius: 7px;
}

.history-item h4 {
  margin: 0;
  font-size: 13px;
}

.history-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.undo {
  padding: 8px;
  color: #a05f15;
  background: #fff4e3;
  border: 1px solid #f1d7ad;
  border-radius: 6px;
}

.duplicate-row {
  background: #fffbf2;
  border-color: #f1dfb9;
}

.duplicate-detail {
  padding: 13px;
  background: #fffbf2;
  border: 1px solid #f1dfb9;
  border-radius: 8px;
}

.parse-output {
  margin-top: 7px;
  padding: 10px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 5px 10px;
  background: #f7f9fc;
  border-radius: 7px;
  font-size: 11px;
}

.parse-output small {
  grid-column: 1 / -1;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.registry-toolbar {
  margin: 14px 0;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 8px;
}

.registry-toolbar input,
.registry-toolbar select,
.fact-edit-form input,
.fact-edit-form textarea,
#match-note {
  width: 100%;
  padding: 10px 11px;
  color: #24344c;
  background: #fff;
  border: 1px solid #dce3ed;
  border-radius: 7px;
  font: inherit;
}

.paper-statuses {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.page-jump {
  margin-left: 8px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #52627a;
  font-size: 12px;
}

.page-jump input {
  width: 76px;
  height: 38px;
  padding: 0 9px;
  color: #1e2d44;
  background: #fff;
  border: 1px solid #d7e0ec;
  border-radius: 8px;
  font: inherit;
}

.page-jump button {
  height: 38px;
  padding: 0 12px;
}

.match-legend {
  margin: 10px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: #586981;
  font-size: 11px;
}

.match-legend span {
  padding: 5px 8px;
  background: #fff;
  border: 1px solid #e3e8ef;
  border-radius: 5px;
}

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

.match-table {
  min-width: 720px;
}

.comparison-conflict {
  background: #fff4f1;
}

.comparison-new {
  background: #eff9f5;
}

.comparison-chip {
  font-size: 11px;
  font-weight: 700;
}

#match-note {
  margin: 10px 0;
  resize: vertical;
}

.fact-edit-card {
  max-width: 760px;
}

.fact-edit-form {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.fact-edit-form label span {
  margin-bottom: 5px;
  display: block;
  color: #53627a;
  font-size: 12px;
  font-weight: 700;
}

.fact-edit-form .wide {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.graph-search {
  grid-template-columns: minmax(240px, 1fr) 150px 96px auto;
}

.graph-stage {
  min-height: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,255,.96)),
    radial-gradient(circle at 18% 12%, rgba(37,99,235,.10), transparent 28%),
    radial-gradient(circle at 82% 22%, rgba(15,159,143,.08), transparent 25%);
}

.graph-toolbar {
  min-height: 56px;
  height: auto;
  padding-block: 10px;
  font-size: 12px;
}

.graph-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.graph-tools button {
  min-width: 32px;
  height: 31px;
  padding: 0 10px;
  border: 1px solid #dbe5f2;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(31,51,81,.05);
}

.graph-tools button.active {
  color: #fff;
  background: #2563eb;
  border-color: #2563eb;
}

.graph-filterbar {
  min-height: 44px;
  padding: 8px 15px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e6edf7;
  background: rgba(255,255,255,.62);
}

.graph-quality {
  min-height: 38px;
  padding: 6px 15px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #e6edf7;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
}

.graph-quality span { display: inline-flex; align-items: baseline; gap: 5px; }
.graph-quality b { color: #172033; font-size: 13px; }

.graph-filterbar > span {
  color: #7b8798;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.graph-type-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.graph-type-filter button {
  height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #dbe5f2;
  border-radius: 999px;
  background: #fff;
  color: #42526b;
  font-size: 9px;
  font-weight: 700;
}

.graph-type-filter button i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.graph-type-filter button b {
  color: #94a3b8;
  font: 700 8px Inter, sans-serif;
}

.graph-type-filter button.active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.10);
}

.graph-focus-control {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding-left: 10px;
  border-left: 1px solid #dbe5f2;
}

.graph-focus-control > span {
  margin-right: 4px;
  color: #7b8798;
  font-size: 9px;
  font-weight: 700;
}

.graph-focus-control button {
  height: 26px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #64748b;
  background: transparent;
  font-size: 9px;
}

.graph-focus-control button.active {
  color: #fff;
  border-color: #2563eb;
  background: #2563eb;
}

body.graph-maximized {
  overflow: hidden;
}

body.graph-maximized .graph-layout {
  position: fixed;
  inset: 80px 18px 18px calc(var(--sidebar) + 18px);
  z-index: 60;
  grid-template-columns: minmax(0, 1fr) 330px;
  background: #f6f8fc;
}

body.sidebar-collapsed.graph-maximized .graph-layout {
  left: 92px;
}

body.graph-maximized .graph-stage,
body.graph-maximized .evidence-panel {
  min-height: 0;
  height: 100%;
}

body.graph-maximized #graph-canvas {
  height: calc(100vh - 210px);
}

.graph-canvas-wrap {
  position: relative;
}

#graph-canvas {
  height: 100%;
  touch-action: none;
  cursor: grab;
  background-image:
    linear-gradient(rgba(226,234,246,.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226,234,246,.55) 1px, transparent 1px);
  background-size: 34px 34px;
}

#graph-canvas canvas { outline: none; }

.graph-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  color: #8793a5;
  font-size: 12px;
}

#graph-canvas:active {
  cursor: grabbing;
}

.graph-edge {
  stroke-linecap: round;
  fill: none;
  opacity: .36;
  transition: opacity .18s ease, stroke-width .18s ease;
  pointer-events: none;
}

.graph-edge-wrap {
  pointer-events: none;
}

.graph-edge-wrap.selected .graph-edge {
  opacity: .88;
  stroke-width: 1.7px;
  filter: none;
}

.graph-edge-wrap.on-path .graph-edge {
  opacity: 1;
  stroke-width: 2.2px;
}

.graph-node.on-path .graph-dot {
  stroke: #111827;
  stroke-width: 2px;
}

.graph-edge-label {
  fill: #6b7280;
  paint-order: stroke;
  stroke: rgba(255,255,255,.92);
  stroke-width: 2.4px;
  font: 600 6.5px Inter, sans-serif;
  letter-spacing: 0;
  opacity: .76;
  pointer-events: none;
}

.graph-edge-label.quiet {
  opacity: 0;
}

.graph-edge-wrap.selected .graph-edge-label.quiet {
  opacity: 0;
}

.graph-node circle {
  filter: none;
  transition: stroke-width .18s ease, filter .18s ease;
}

.graph-hit {
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
  filter: none !important;
}

.graph-node.selected circle {
  filter: drop-shadow(0 4px 9px rgba(37,99,235,.22));
}

.graph-node.selected .graph-hit {
  filter: none !important;
}

.graph-node.dragging circle:not(.graph-hit) {
  stroke-width: 3px;
  filter: drop-shadow(0 5px 12px rgba(37,99,235,.24));
}

.graph-node.dragging .graph-node-label,
.graph-node.dragging .graph-node-formula {
  font-weight: 800;
}

.graph-node-formula {
  font: 700 9px Inter, sans-serif;
  letter-spacing: 0;
  pointer-events: none;
}

.graph-node-label {
  fill: #334155;
  paint-order: stroke;
  stroke: rgba(255,255,255,.94);
  stroke-width: 2px;
  font: 700 6.8px Inter, sans-serif;
  letter-spacing: 0;
  cursor: pointer;
  pointer-events: visiblePainted;
}

.graph-node .graph-node-label {
  pointer-events: visiblePainted !important;
}

.graph-node-label.quiet {
  opacity: 0;
}

.graph-node {
  cursor: grab;
  pointer-events: visiblePainted;
  transform-box: fill-box;
  transform-origin: center;
}

.graph-node.dragging {
  cursor: grabbing;
}

.graph-dot {
  vector-effect: non-scaling-stroke;
}

.graph-hover-note {
  position: absolute;
  left: 16px;
  bottom: 16px;
  max-width: min(520px, calc(100% - 32px));
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  color: #172033;
  background: rgba(255,255,255,.94);
  border: 1px solid #dfe7f2;
  border-left: 4px solid var(--node, #2563eb);
  border-radius: 7px;
  box-shadow: 0 12px 30px rgba(15,23,42,.10);
  pointer-events: none;
}

.graph-canvas-wrap .graph-hover-note {
  pointer-events: none;
  z-index: 5;
}

.graph-hover-note span {
  color: var(--node, #2563eb);
  font-size: 10px;
  font-weight: 800;
}

.graph-hover-note strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-hover-note small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.45;
}

.structure-badge {
  margin: 12px 0;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background: #f8fbff;
}

.structure-badge strong {
  color: #1f63dc;
  font-size: 18px;
}

.structure-badge span {
  color: #738195;
  font-size: 11px;
}

.relation-list {
  margin: 12px 0;
  display: grid;
  gap: 7px;
}

.relation-list div {
  padding: 9px;
  display: grid;
  gap: 3px;
  background: #fff;
  border: 1px solid #e5ebf3;
  border-radius: 7px;
  font-size: 11px;
}

.relation-list b {
  color: #2563eb;
}

.relation-list span {
  color: #53627a;
}

.node-detail-card {
  display: grid;
  gap: 12px;
}

.node-detail-head h3 {
  margin: 9px 0 4px;
  font-size: 22px;
  line-height: 1.25;
}

.node-detail-head p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.node-fields {
  display: grid;
  gap: 0;
  border-top: 1px solid #e7edf5;
}

.node-field {
  padding: 12px 0;
  border-bottom: 1px solid #e7edf5;
}

.node-field span,
.node-field strong {
  display: block;
}

.node-field span {
  margin-bottom: 5px;
  color: #7a8798;
  font-size: 11px;
  font-weight: 700;
}

.node-field strong {
  color: #172033;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}

.relation-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.relation-chips span {
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--rel, #2563eb);
  background: color-mix(in srgb, var(--rel, #2563eb) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--rel, #2563eb) 25%, #e8eef7);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.relation-chips b {
  font-size: 10px;
}

.relation-list.compact {
  gap: 5px;
  max-height: min(360px, 42vh);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.relation-row {
  width: 100%;
  padding: 9px 10px 9px 12px;
  display: grid;
  grid-template-columns: 74px minmax(0,1fr);
  gap: 5px 10px;
  align-items: center;
  color: #435269;
  background: #fff;
  border: 1px solid #e5ebf3;
  border-left: 3px solid var(--rel, #94a3b8);
  border-radius: 7px;
  text-align: left;
  font-size: 11px;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.relation-row:hover {
  transform: translateX(2px);
  border-color: color-mix(in srgb, var(--rel, #94a3b8) 42%, #e5ebf3);
  box-shadow: 0 7px 16px rgba(15, 23, 42, .06);
}

.relation-row span {
  color: var(--rel, #1f63dc);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.relation-row strong {
  min-width: 0;
  overflow: hidden;
  color: #172033;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relation-row em {
  grid-column: 2;
  min-width: 0;
  overflow: hidden;
  color: #7a8798;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.graph-paper-link {
  padding: 10px 11px;
  display: grid;
  gap: 4px;
  color: #172033;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  text-align: left;
}

.graph-paper-link strong {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-paper-link small {
  color: #7a8798;
  font-size: 10px;
}

.discovery-confidence {
  margin: 12px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  color: #64748b;
  font-size: 9px;
}

.discovery-confidence strong { color: #172033; }
.discovery-confidence i {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: linear-gradient(90deg, #2563eb var(--confidence), #e8edf5 var(--confidence));
}

.discovery-hypothesis {
  margin: 13px 0;
  padding: 11px;
  border-left: 3px solid #16a34a;
  background: #f4faf7;
}

.discovery-hypothesis span { color: #16814b; font-size: 9px; font-weight: 800; }
.discovery-hypothesis p { margin: 7px 0 5px; color: #344155; }
.discovery-hypothesis small { color: #6d7b8f; line-height: 1.55; }

@media (max-width: 720px) {
  .view[data-view-panel="discovery"] .scatter-wrap {
    min-height: 220px;
    max-height: 300px;
  }

  .view[data-view-panel="discovery"] .cluster-detail {
    max-height: none;
  }

  .view[data-view-panel="discovery"] #cluster-detail {
    overflow: visible;
  }

  .workflow-guide,
  .parser-options,
  .registry-toolbar,
  .fact-edit-form,
  .domain-row {
    grid-template-columns: 1fr;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .assistant {
    width: 100vw !important;
    min-width: 0;
  }

  .assistant-resizer,
  #toggle-ai-width {
    display: none;
  }

  .graph-search {
    grid-template-columns: 1fr;
  }

  .graph-filterbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .graph-focus-control {
    width: 100%;
    margin-left: 0;
    padding: 5px 0 0;
    border-top: 1px solid #e6edf7;
    border-left: 0;
  }

  .view[data-view-panel="graph"] .graph-layout {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .view[data-view-panel="graph"] .graph-stage {
    width: 100%;
    height: auto;
    min-height: 560px;
  }

  .view[data-view-panel="graph"] .graph-canvas-wrap {
    height: 420px;
    min-height: 420px;
    flex: none;
  }

  .view[data-view-panel="graph"] #graph-canvas {
    height: 420px;
  }

  .view[data-view-panel="graph"] .evidence-panel {
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .view[data-view-panel="graph"] #graph-evidence {
    max-height: 620px;
  }

  .graph-quality {
    flex-wrap: wrap;
    gap: 7px 14px;
  }

  .view[data-view-panel="graph"] .graph-toolbar {
    height: auto;
    min-height: 48px;
    padding: 6px 10px;
    gap: 7px;
  }

  .view[data-view-panel="graph"] .graph-toolbar > span {
    min-width: 110px;
    flex: 1;
    line-height: 1.45;
  }

  .view[data-view-panel="graph"] .graph-tools {
    gap: 3px;
  }

  .view[data-view-panel="graph"] .graph-tools button {
    width: 27px;
    min-width: 27px;
    padding: 0;
    font-size: 0;
  }

  .view[data-view-panel="graph"] .graph-tools button::before {
    font-size: 14px;
  }

  #refresh-graph::before { content: "↻"; }
  #zoom-out-graph::before { content: "−"; }
  #zoom-in-graph::before { content: "+"; }
  #toggle-relations-graph::before { content: "⇄"; }
  #fit-graph::before { content: "⌖"; }
  #maximize-graph::before { content: "⛶"; }

body.graph-maximized .graph-layout {
    inset: 70px 10px 10px;
    grid-template-columns: 1fr;
    overflow: auto;
  }

}

/* Final cascade keeps legacy modules on the shared visual system. */
.sidebar { padding: 20px 14px; background: #eef1f3; border-color: #d5dde3; }
.brand-mark { width: 36px; height: 36px; background: #215f55; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.brand strong { color: #17232d; font-size: 16px; }
.brand small { color: #76828d; font-size: 9px; }
#main-nav { margin-top: 34px; gap: 3px; }
#main-nav button { min-height: 42px; padding: 10px 11px; color: #586674; border: 1px solid transparent; border-radius: 6px; }
#main-nav button:hover { color: #24493f; background: rgba(255,255,255,.62); border-color: #d9e0e4; }
#main-nav button.active { color: #164e45; background: #fff; border-color: #cbd8d5; box-shadow: inset 3px 0 #1f6b5f; }
#main-nav button span { color: #788691; font-size: 10px; }
#main-nav button b { font-size: 13px; }
.system-card { background: rgba(255,255,255,.72); border: 1px solid #d6dfe3; border-radius: 6px; box-shadow: none; }
.sidebar-toggle { top: 20px; right: -14px; width: 28px; height: 28px; color: #1f6b5f; border-color: #cfd9dd; border-radius: 50%; box-shadow: 0 4px 12px rgba(24,37,51,.10); }
.topbar { min-height: 64px; padding: 0 28px; background: rgba(255,255,255,.96); border-color: #d8e0e6; box-shadow: 0 1px 0 rgba(24,37,51,.02); }
body[data-active-view="graph"] .topbar,
body[data-active-view="discovery"] .topbar { height: 68px; }
.topbar h1,
body[data-active-view="graph"] .topbar h1,
body[data-active-view="discovery"] .topbar h1 { margin-top: 3px; font-size: 17px; }
.topbar .eyebrow,.top-context { color: #6d7985; font-size: 10px; }
.database-pill,.quick-links button,.lang-toggle,.agent-button { min-height: 34px; border-radius: 6px; }
.view { width: min(100%, 1680px); margin: 0 auto; padding: 28px 30px 64px; }
.view[data-view-panel="graph"],.view[data-view-panel="discovery"] { padding: 22px 28px 28px; }
.page-intro { margin-bottom: 16px; }
.page-intro h2,
.view[data-view-panel="graph"] .page-intro h2,
.view[data-view-panel="discovery"] .page-intro h2 { margin: 4px 0; font-size: 24px; }
.page-intro p,
.view[data-view-panel="graph"] .page-intro p,
.view[data-view-panel="discovery"] .page-intro p { max-width: 780px; color: #657180; font-size: 13px; line-height: 1.6; }
.brand small,.eyebrow,.card-head span,.page-intro > div > span,.reasoning-head span,.reasoning-title span { color: #657b77; font-size: 10px; }
.card,.hero,.filter-card,.graph-stage,.evidence-panel,.landscape-card,.cluster-detail,.gap-card,.detail-card,.empty,.signal-score,.domain-row { border-color: #d8e0e6; border-radius: 7px; box-shadow: var(--shadow); }
button,input,select,textarea { border-radius: 5px; }
input,select,textarea { color: #24313e; background: #fff; border-color: #cbd5dc; outline: none; }
input:focus,select:focus,textarea:focus { border-color: #34796d; box-shadow: 0 0 0 3px rgba(31,107,95,.12); }
.primary,.analysis-form button,.component-recommend-form button,.chat-form button { color: #fff; background: #1f6b5f; border-color: #1f6b5f; box-shadow: none; }
.secondary,.graph-tools button,.evidence-actions button { color: #315f71; background: #f7f9fa; border-color: #cfd9df; }
.graph-search,.analysis-form,.filter-card { background: #fff; border-color: #d8e0e6; border-radius: 7px; box-shadow: none; }
.graph-layout,.landscape-grid { gap: 12px; }
.graph-stage,.landscape-card { overflow: hidden; background: #fbfcfd; }
.view[data-view-panel="graph"] .graph-toolbar,.graph-toolbar { min-height: 48px; background: #fff; border-color: #d8e0e6; }
.graph-tools button { min-width: 32px; height: 32px; border: 1px solid #d3dde2; border-radius: 5px; }
.graph-tools button:hover,.graph-tools button.active { color: #fff; background: #315f71; border-color: #315f71; }
.graph-filterbar { background: #f7f9fa; border-color: #dde4e8; }
.graph-type-filter button,.graph-focus-control button { border-radius: 4px; }
.graph-focus-control button { min-width: 36px; white-space: nowrap; }
.view[data-view-panel="graph"] #graph-canvas,#graph-canvas { background-color: #fbfcfd; background-image: radial-gradient(circle,#ccd6dd 1px,transparent 1px); background-size: 22px 22px; }
.evidence-panel { background: #fff; box-shadow: none; }
.node-detail-card,.node-path-panel,.graph-paper-link,.relation-row { border-radius: 6px; }
.landscape-plot-bg { fill: #fafbfc; stroke: #d7e0e5; }
.discovery-hypothesis { background: #f1f7f5; border-color: #2d795b; }
.reasoning-workbench,.directed-workbench { margin-top: 18px; overflow: hidden; background: #fff; border: 1px solid #d5dfe4; border-top: 3px solid #1f6b5f; border-radius: 7px; box-shadow: var(--shadow); }
.reasoning-head { min-height: 76px; padding: 16px 20px; align-items: center; background: #fff; border-color: #dce3e7; }
.reasoning-head h3 { color: #1f2d38; font-size: 17px; }
.reasoning-head p { max-width: 780px; color: #66737e; font-size: 12px; line-height: 1.5; }
.reasoning-layout { grid-template-columns: minmax(250px,28%) minmax(0,1fr); min-height: 560px; }
.reasoning-list { padding: 9px; background: #f5f7f8; border-color: #dce3e7; }
.reasoning-candidate { position: relative; min-height: 94px; padding: 12px 11px; border-radius: 5px; }
.reasoning-candidate:hover { border-color: #cfdade; box-shadow: none; }
.reasoning-candidate.active { border-color: #83aaa3; box-shadow: inset 3px 0 #1f6b5f; }
.reasoning-candidate span { color: #246b60; font-size: 9px; }
.reasoning-candidate strong { color: #24323d; font-size: 12px; line-height: 1.45; }
.reasoning-candidate small { padding-right: 0; color: #72808b; font-size: 9px; line-height: 1.45; }
.reasoning-candidate em { display: block; margin-top: 7px; font-style: normal; font-size: 9px; font-weight: 700; }
.reasoning-detail { padding: 22px; }
.reasoning-title h3 { font-size: 20px; line-height: 1.35; }
.reason-hypothesis { margin: 10px 0 16px; color: #40515f; font-size: 13px; line-height: 1.65; }
.reason-scores { grid-template-columns: repeat(6,minmax(0,1fr)); margin: 12px 0 18px; gap: 6px; }
.reason-score { padding: 8px; background: #fff; border-color: #dfe5e8; border-radius: 5px; }
.reason-score i { background: #e7ecef; border-radius: 2px; }
.reason-score i b { background: #2d795f; }
.expert-panel { margin: 18px -22px 0; padding: 17px 22px; background: #f3f8f6; border-color: #d4e1dd; }
.expert-opinion { border-color: #d5e0dc; border-radius: 5px; }
.constraint-strip span { border-radius: 4px; }
.reason-evidence,.experiment-columns > div,.experiment-flow li,.success-criteria { border-radius: 4px; }
.assistant { background: #fff; border-color: #d5dde3; box-shadow: -16px 0 40px rgba(24,37,51,.12); }
.assistant-head { min-height: 68px; background: #f7f9fa; border-color: #d8e0e6; }
.agent-symbol { background: #1f6b5f; border-radius: 6px; }
.agent-trace span,.message.user .markdown,.message.bot > .markdown { border-radius: 6px; }
.message.user .markdown { background: #315f71; }
.message.bot > .markdown { background: #f7f9fa; border-color: #dce3e7; }
.hero h2 { font-size: 44px; line-height: 1.1; }
.signal-score,.domain-row,.detail-card,.dropzone,.record,.gap-card { border-radius: 7px; }

@media (max-width: 1100px) {
  .reasoning-layout { grid-template-columns: 1fr; }
  .reason-scores { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 900px) {
  :root { --sidebar: 0px; }
  .sidebar { display: none; }
  main { margin-left: 0; }
  .view[data-view-panel="graph"] .graph-layout { height: auto; grid-template-columns: minmax(0,1fr); }
  .view[data-view-panel="graph"] .graph-stage { width: 100%; min-width: 0; height: auto; min-height: 540px; }
  .view[data-view-panel="graph"] .graph-canvas-wrap,
  .view[data-view-panel="graph"] #graph-canvas { width: 100%; height: 430px; min-height: 430px; }
  .view[data-view-panel="graph"] .evidence-panel { width: 100%; height: auto; max-height: none; }
  .view[data-view-panel="graph"] #graph-evidence { max-height: 520px; }
}

@media (max-width: 720px) {
  .topbar { padding: 0 14px; }
  .view,.view[data-view-panel="graph"],.view[data-view-panel="discovery"] { padding: 20px 12px 50px; }
  .page-intro h2,.view[data-view-panel="graph"] .page-intro h2,.view[data-view-panel="discovery"] .page-intro h2 { font-size: 22px; }
  .reason-scores { grid-template-columns: 1fr 1fr; }
  .hero h2 { font-size: 34px; }
}

/* Prospective materials-discovery loop. */
.closed-loop-workbench { margin-top: 22px; overflow: hidden; color: #172a34; background: #f8faf9; border: 1px solid #cbd8d4; border-top: 4px solid #166b59; border-radius: 7px; }
.closed-loop-head { display: grid; grid-template-columns: minmax(320px,.9fr) minmax(360px,1.1fr); gap: 32px; align-items: end; padding: 24px 26px 20px; background: #fff; border-bottom: 1px solid #d9e2df; }
.closed-loop-head span,.closed-loop-section-title span,.closed-loop-hypothesis > span { color: #16705d; font-size: 9px; font-weight: 900; letter-spacing: 0; }
.closed-loop-head h3 { margin: 5px 0 0; color: #172b35; font-size: 24px; line-height: 1.25; }
.closed-loop-head p { margin: 0; color: #53666d; font-size: 12px; line-height: 1.7; }
.closed-loop-stages { display: grid; grid-template-columns: repeat(8,minmax(112px,1fr)); overflow-x: auto; background: #d9e2df; gap: 1px; border-bottom: 1px solid #d9e2df; }
.closed-loop-stage { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 8px; min-height: 74px; align-items: center; padding: 11px 12px; background: #fff; }
.closed-loop-stage::after { position: absolute; z-index: 2; right: -7px; top: 31px; width: 12px; height: 12px; content: ""; background: inherit; border-top: 1px solid #d9e2df; border-right: 1px solid #d9e2df; transform: rotate(45deg); }
.closed-loop-stage:last-child::after { display: none; }
.closed-loop-stage > b { color: #97a7a8; font-size: 10px; }
.closed-loop-stage span { min-width: 0; }
.closed-loop-stage strong,.closed-loop-stage small { display: block; }
.closed-loop-stage strong { color: #253942; font-size: 10px; line-height: 1.35; }
.closed-loop-stage small { margin-top: 5px; color: #7c898c; font-size: 8px; line-height: 1.3; }
.closed-loop-stage.foundation_available { box-shadow: inset 0 -3px #287764; }
.closed-loop-stage.specified_not_tested { box-shadow: inset 0 -3px #b9802f; }
.closed-loop-science { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(360px,.9fr); }
.closed-loop-hypothesis { padding: 28px 30px; color: #fff; background: #173b3b; }
.closed-loop-hypothesis > span { color: #95d5c0; }
.closed-loop-hypothesis h4 { margin: 8px 0 10px; color: #fff; font-size: 26px; line-height: 1.25; }
.closed-loop-hypothesis > p { max-width: 760px; margin: 0; color: #d6e6e0; font-size: 13px; line-height: 1.75; }
.closed-loop-falsifiers { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; margin-top: 22px; background: #41625e; border: 1px solid #41625e; }
.closed-loop-falsifiers > div { display: grid; grid-template-columns: 28px 1fr; gap: 9px; min-height: 64px; padding: 12px; background: #204946; }
.closed-loop-falsifiers b { color: #8fd1bb; font-size: 10px; }
.closed-loop-falsifiers span { color: #d7e5e0; font-size: 9px; line-height: 1.55; }
.closed-loop-readiness { padding: 27px 26px 24px; background: #f5f8f7; }
.closed-loop-section-title h4 { margin: 4px 0 12px; color: #263b43; font-size: 16px; }
.closed-loop-gates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: #d6dfdc; border: 1px solid #d6dfdc; }
.closed-loop-gates > div { display: grid; grid-template-columns: 24px 1fr; gap: 8px; min-height: 50px; align-items: center; padding: 8px 10px; background: #fff; }
.closed-loop-gates i { display: grid; width: 20px; height: 20px; place-items: center; color: #9b4c40; background: #faefec; border-radius: 50%; font-size: 10px; font-style: normal; }
.closed-loop-gates .pass i { color: #166b59; background: #e5f2ed; }
.closed-loop-gates b,.closed-loop-gates small { display: block; }
.closed-loop-gates b { color: #35484f; font-size: 9px; }
.closed-loop-gates small { margin-top: 3px; color: #899396; font-size: 8px; }
.closed-loop-lower { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(360px,.9fr); gap: 0; background: #fff; border-top: 1px solid #d9e2df; }
.closed-loop-lower > div { padding: 24px 26px; }
.closed-loop-lower > div + div { border-left: 1px solid #d9e2df; }
.closed-loop-descriptors { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 18px; }
.closed-loop-descriptors > div { display: grid; grid-template-columns: 24px 1fr; gap: 9px; padding-top: 10px; border-top: 2px solid #d4dedb; }
.closed-loop-descriptors > div > b { color: #16705d; font-size: 10px; }
.closed-loop-descriptors strong,.closed-loop-descriptors small { display: block; }
.closed-loop-descriptors strong { color: #30434a; font-size: 10px; }
.closed-loop-descriptors small { margin-top: 5px; color: #748185; font-size: 8px; line-height: 1.55; }
.closed-loop-funnel { display: grid; gap: 9px; }
.closed-loop-funnel > div { display: grid; grid-template-columns: minmax(132px,.65fr) minmax(120px,1fr); gap: 12px; align-items: center; }
.closed-loop-funnel span { display: flex; justify-content: space-between; gap: 8px; }
.closed-loop-funnel span b { color: #3c5057; font-size: 9px; }
.closed-loop-funnel span small { color: #839093; font-size: 8px; }
.closed-loop-funnel > div > i { height: 7px; overflow: hidden; background: #e6ecea; border-radius: 2px; }
.closed-loop-funnel > div > i > b { display: block; height: 100%; background: #6e9289; }
.closed-loop-boundary { margin: 0; padding: 11px 26px; color: #7b5d36; background: #fff7ea; border-top: 1px solid #eadbc2; font-size: 9px; line-height: 1.55; }

/* Temporal literature-discovery benchmark and prospective validation. */
.temporal-workbench { margin-top: 18px; overflow: hidden; background: #fff; border: 1px solid #d5dfe4; border-top: 3px solid #315f71; border-radius: 7px; box-shadow: var(--shadow); }
.temporal-metrics { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); background: #f5f7f8; border-bottom: 1px solid #dce3e7; }
.temporal-metric { min-height: 76px; padding: 14px 15px; border-right: 1px solid #dce3e7; }
.temporal-metric:last-child { border-right: 0; }
.temporal-metric span { display: block; min-height: 28px; color: #6d7985; font-size: 10px; line-height: 1.35; }
.temporal-metric strong { display: block; color: #24323d; font-size: 20px; }
.temporal-metric.evidence strong,.temporal-metric.pass strong { color: #1f6b5f; }
.temporal-metric.graph strong { color: #315f71; }
.temporal-metric.risk strong { color: #a26326; }
.publication-evidence-band { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(300px,.85fr); border-bottom: 1px solid #dce3e7; }
.publication-evidence-band > div { min-width: 0; padding: 14px 16px 15px; }
.publication-evidence-band > div + div { background: #f7f9fa; border-left: 1px solid #dce3e7; }
.publication-evidence-band .eyebrow { display: block; margin-bottom: 9px; color: #65757f; font-size: 9px; font-weight: 800; }
.temporal-role-slices { display: grid; gap: 1px; overflow: hidden; background: #dce3e7; border: 1px solid #dce3e7; border-radius: 5px; }
.temporal-role-row { display: grid; grid-template-columns: 58px 92px minmax(130px,1.2fr) 70px minmax(175px,1fr) 92px; gap: 8px; align-items: center; min-height: 38px; padding: 7px 9px; background: #fff; }
.temporal-role-row b { color: #263744; font-size: 10px; }
.temporal-role-row span,.temporal-role-row small,.temporal-role-row em { color: #6a7882; font-size: 8px; font-style: normal; line-height: 1.35; }
.temporal-role-row strong { color: #1f6b5f; font-size: 10px; white-space: nowrap; }
.temporal-role-row em { color: #1f6b5f; font-weight: 800; text-align: right; }
.temporal-role-row.low-resource { background: #fffaf3; }
.temporal-role-row.low-resource em { color: #9a6127; }
.publication-claim-gates { display: grid; gap: 5px; }
.publication-claim { display: grid; grid-template-columns: 8px minmax(0,1fr) auto; gap: 8px; align-items: center; min-height: 35px; padding: 5px 0; border-bottom: 1px solid #e1e6e9; }
.publication-claim:last-child { border-bottom: 0; }
.publication-claim > i { width: 7px; height: 7px; background: #a26326; border-radius: 50%; }
.publication-claim.supported > i { background: #1f7769; }
.publication-claim.exploratory > i { background: #315f9d; }
.publication-claim span b,.publication-claim span small { display: block; }
.publication-claim span b { color: #33434f; font-size: 9px; line-height: 1.35; }
.publication-claim span small { margin-top: 2px; color: #78848d; font-size: 8px; line-height: 1.3; }
.publication-claim > em { color: #8a5c2c; font-size: 8px; font-style: normal; font-weight: 800; white-space: nowrap; }
.publication-claim.supported > em { color: #1f6b5f; }
.publication-claim.exploratory > em { color: #315f9d; }
.temporal-model-comparison { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(250px,.8fr); background: #fff; border-bottom: 1px solid #dce3e7; }
.temporal-model-bars { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 18px; padding: 14px 16px; border-right: 1px solid #dce3e7; }
.temporal-model-row { display: grid; grid-template-columns: minmax(130px,1fr) minmax(72px,.8fr) auto auto; gap: 8px; align-items: center; min-height: 26px; color: #5d6b75; }
.temporal-model-row span { overflow: hidden; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.temporal-model-row span em { color: #1f6b5f; font-size: 8px; font-style: normal; }
.temporal-model-row i { display: block; height: 5px; overflow: hidden; background: #e7ecef; border-radius: 2px; }
.temporal-model-row i b { display: block; height: 100%; background: #728995; }
.temporal-model-row.selected i b { background: #1f7769; }
.temporal-model-row strong,.temporal-model-row small { font-size: 9px; white-space: nowrap; }
.temporal-model-row strong { color: #283946; }
.temporal-model-row small { color: #788590; }
.temporal-audit-notes { display: grid; align-content: center; gap: 6px; padding: 13px 16px; background: #f7f9fa; }
.temporal-audit-notes p { margin: 0; color: #586771; font-size: 9px; line-height: 1.45; }
.temporal-audit-notes b { display: inline-block; min-width: 86px; color: #283946; }
.temporal-audit-notes .risk b { color: #a26326; }
.temporal-layout { display: grid; grid-template-columns: minmax(270px,28%) minmax(0,1fr); min-height: 650px; }
.temporal-candidate-list { padding: 9px; overflow: auto; background: #f5f7f8; border-right: 1px solid #dce3e7; }
.temporal-candidate { display: block; width: 100%; min-height: 96px; padding: 12px 11px; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 5px; }
.temporal-candidate:hover { background: #fff; border-color: #d3dde2; }
.temporal-candidate.active { background: #fff; border-color: #8ba9b4; box-shadow: inset 3px 0 #315f71; }
.temporal-candidate span,.temporal-candidate em { display: block; color: #315f71; font-size: 9px; font-style: normal; font-weight: 700; }
.temporal-candidate strong { display: block; margin: 5px 0; color: #24323d; font-size: 12px; line-height: 1.45; }
.temporal-candidate small { display: block; color: #72808b; font-size: 9px; line-height: 1.5; }
.temporal-candidate em { margin-top: 6px; color: #9a6127; }
.temporal-candidate.blocked { opacity: .78; }
.temporal-candidate.blocked em { color: #a13f4c; }
.temporal-candidate.blocked.active { border-color: #c9959c; box-shadow: inset 3px 0 #a13f4c; }
.temporal-candidate-detail { min-width: 0; padding: 22px; }
.temporal-title { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.temporal-title span,.temporal-experiment > div:first-child span { color: #657b77; font-size: 10px; font-weight: 800; }
.temporal-title h3 { margin: 5px 0 0; color: #1f2d38; font-size: 21px; line-height: 1.35; }
.temporal-title > strong { color: #315f71; font-size: 36px; line-height: 1; }
.temporal-state { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.temporal-state span { padding: 5px 7px; color: #7a5a35; background: #fff8ed; border: 1px solid #ead7bb; border-radius: 4px; font-size: 9px; font-weight: 800; }
.temporal-state span.pass { color: #1f6b5f; background: #eff7f4; border-color: #c9ded7; }
.novelty-warning { margin: 12px 0; padding: 11px 12px; background: #fff3f4; border: 1px solid #e5c6cb; border-left: 3px solid #a13f4c; border-radius: 5px; }
.novelty-warning.pending { background: #fff8ed; border-color: #ead7bb; border-left-color: #a26326; }
.novelty-warning > b { color: #8d3441; font-size: 10px; }
.novelty-warning.pending > b { color: #81562d; }
.novelty-warning p { margin: 5px 0; color: #65515a; font-size: 11px; line-height: 1.5; }
.novelty-warning button { display: block; width: 100%; margin-top: 5px; padding: 7px 8px; text-align: left; background: rgba(255,255,255,.72); border: 1px solid #e2cdd1; border-radius: 4px; }
.novelty-warning button small { display: block; margin-top: 3px; color: #7d6c72; font-size: 8px; }
.temporal-hypothesis { margin: 12px 0 18px; color: #40515f; font-size: 13px; line-height: 1.65; }
.temporal-feature-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.temporal-feature-grid > div { padding: 9px; border: 1px solid #dce3e7; border-radius: 5px; }
.temporal-feature-grid span { display: block; min-height: 26px; color: #66737e; font-size: 9px; }
.temporal-feature-grid i { display: block; height: 4px; overflow: hidden; background: #e7ecef; border-radius: 2px; }
.temporal-feature-grid i b { display: block; height: 100%; background: #315f71; }
.temporal-feature-grid strong { display: block; margin-top: 5px; color: #24313e; font-size: 12px; }
.temporal-boundary { margin: 16px -22px 0; padding: 14px 22px; background: #fffaf2; border-top: 1px solid #eadfcf; border-bottom: 1px solid #eadfcf; }
.temporal-boundary b { color: #81562d; font-size: 10px; }
.temporal-boundary p { margin: 3px 0 10px; color: #65594e; font-size: 11px; line-height: 1.55; }
.temporal-boundary p:last-child { margin-bottom: 0; }
.temporal-evidence-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.temporal-evidence-grid h5 { margin: 0 0 7px; color: #24313e; font-size: 12px; }
.temporal-evidence-grid button { display: block; width: 100%; min-height: 62px; margin-bottom: 6px; padding: 9px; text-align: left; background: #f8fafb; border: 1px solid #dce3e7; border-radius: 5px; }
.temporal-evidence-grid button:hover { background: #fff; border-color: #8ba9b4; }
.temporal-evidence-grid strong,.temporal-evidence-grid small { display: block; }
.temporal-evidence-grid strong { color: #30414e; font-size: 10px; line-height: 1.45; }
.temporal-evidence-grid small { margin-top: 4px; color: #71808a; font-size: 8px; line-height: 1.45; }
.temporal-experiment { margin: 18px -22px -22px; padding: 18px 22px 22px; background: #f3f8f6; border-top: 1px solid #d4e1dd; }
.temporal-experiment h4 { margin: 4px 0 10px; color: #24313e; font-size: 13px; }
.temporal-experiment .experiment-groups { margin: 10px 0 14px; }
.temporal-experiment .experiment-columns { margin-top: 0; }
.temporal-experiment .evidence-actions { margin-top: 14px; }
.source-bridge { margin: 10px 0 14px; padding: 10px 12px; background: #fff; border: 1px solid #d4e1dd; border-left: 3px solid #315f71; border-radius: 5px; }
.source-bridge b { color: #315f71; font-size: 10px; }
.source-bridge p { margin: 5px 0; color: #30414e; font-size: 11px; line-height: 1.45; }
.source-bridge small { display: block; color: #6b7984; font-size: 9px; line-height: 1.5; }
.experiment-readiness { margin: 10px 0 0; color: #65594e; font-size: 10px; line-height: 1.55; }
.experiment-readiness b { margin-right: 7px; color: #81562d; }
.temporal-experiment button:disabled { cursor: not-allowed; opacity: .58; }

@media (max-width: 1100px) {
  .temporal-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .temporal-metric:nth-child(3) { border-right: 0; }
  .temporal-metric:nth-child(-n+3) { border-bottom: 1px solid #dce3e7; }
  .temporal-layout { grid-template-columns: 1fr; }
  .temporal-model-comparison { grid-template-columns: 1fr; }
  .publication-evidence-band { grid-template-columns: 1fr; }
  .publication-evidence-band > div + div { border-top: 1px solid #dce3e7; border-left: 0; }
  .temporal-role-row { grid-template-columns: 56px 88px minmax(120px,1fr) 70px; }
  .temporal-role-row small,.temporal-role-row em { display: none; }
  .temporal-model-bars { border-right: 0; border-bottom: 1px solid #dce3e7; }
  .temporal-candidate-list { display: flex; gap: 7px; overflow-x: auto; border-right: 0; border-bottom: 1px solid #dce3e7; }
  .temporal-candidate { flex: 0 0 250px; }
}

@media (max-width: 720px) {
  .closed-loop-head,.closed-loop-science,.closed-loop-lower { grid-template-columns: 1fr; }
  .closed-loop-head { gap: 12px; padding: 20px 18px; }
  .closed-loop-stages { grid-template-columns: repeat(8,150px); }
  .closed-loop-hypothesis,.closed-loop-readiness,.closed-loop-lower > div { padding: 20px 18px; }
  .closed-loop-hypothesis h4 { font-size: 22px; }
  .closed-loop-falsifiers,.closed-loop-gates,.closed-loop-descriptors { grid-template-columns: 1fr; }
  .closed-loop-lower > div + div { border-top: 1px solid #d9e2df; border-left: 0; }
  .closed-loop-funnel > div { grid-template-columns: 1fr; gap: 5px; }
  .temporal-metrics { grid-template-columns: 1fr 1fr; }
  .temporal-metric,.temporal-metric:nth-child(3) { border-right: 1px solid #dce3e7; border-bottom: 1px solid #dce3e7; }
  .temporal-metric:nth-child(even) { border-right: 0; }
  .temporal-feature-grid,.temporal-evidence-grid { grid-template-columns: 1fr; }
  .temporal-model-bars { grid-template-columns: 1fr; }
  .temporal-role-row { grid-template-columns: 52px 1fr auto; }
  .temporal-role-row span:nth-of-type(2),.temporal-role-row small,.temporal-role-row em { display: none; }
  .temporal-model-row { grid-template-columns: minmax(110px,1fr) minmax(60px,.7fr) auto; }
  .temporal-model-row small { display: none; }
  .temporal-candidate-detail { padding: 17px; }
  .temporal-boundary { margin-right: -17px; margin-left: -17px; padding-right: 17px; padding-left: 17px; }
  .temporal-experiment { margin-right: -17px; margin-bottom: -17px; margin-left: -17px; padding-right: 17px; padding-left: 17px; }
  .temporal-title > strong { font-size: 28px; }
}

/* ---- Mobile bottom navigation (restores module switching below 900px) ---- */
.mobile-nav { display: none; }

@media (max-width: 900px) {
  .mobile-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid #d5dde3;
    box-shadow: 0 -4px 16px rgba(24, 37, 51, .08);
    backdrop-filter: blur(12px);
  }
  .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 46px;
    padding: 5px 2px;
    color: #6b7984;
    background: transparent;
    border: 0;
    border-radius: 8px;
  }
  .mobile-nav button span { font: 700 8px/1 ui-monospace, monospace; letter-spacing: .06em; opacity: .65; }
  .mobile-nav button b { font-size: 10px; font-weight: 700; }
  .mobile-nav button.active { color: #1f6b5f; background: #e8f2ef; }
  .mobile-nav button.active span { opacity: 1; }
  .mobile-nav button:focus-visible { outline: 2px solid #1f6b5f; outline-offset: 1px; }
  /* keep page content clear of the fixed bar */
  main { padding-bottom: 62px; }
  .assistant-panel { bottom: 62px; }
}

/* ---- Auth controls and readable login form ---- */
.auth-toggle { height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #3f4d61; font-weight: 700; font-size: 11px; }
.auth-user { display: inline-flex; align-items: center; gap: 6px; max-width: 190px; padding: 0 10px; height: 38px; color: #3f4d61; border: 1px solid #d9e1ed; border-radius: 8px; background: #f5f8fc; font-size: 10px; font-weight: 700; }
.auth-user small { color: #75839a; font-weight: 600; }
.auth-modal form { display: grid; gap: 12px; margin-top: 16px; }
.auth-modal label { display: grid; gap: 6px; color: #48586f; font-size: 10px; font-weight: 700; }
.auth-modal input { height: 40px; padding: 0 12px; border: 1px solid #d9e1ed; border-radius: 8px; }
.auth-note { margin: 0; color: #6b7984; font-size: 9px; line-height: 1.6; }
.auth-error { margin: 0; color: #b42318; font-size: 9px; font-weight: 700; }

/* ---- Stable hero labels: prevent translation/overlap ---- */
.hero-visual { width: 340px; min-width: 340px; height: 320px; }
.hero-visual .core { inset: 100px 112px; }
.hero-visual .orbit-a { inset: 45px; }
.hero-visual .orbit-b { inset: 8px; }
.hero-visual .orbit-node { min-width: 42px; text-align: center; white-space: nowrap; line-height: 1.35; }
.hero-visual .n1 { top: 16px; left: 124px; }
.hero-visual .n2 { top: 145px; right: 2px; }
.hero-visual .n3 { bottom: 10px; left: 116px; }
.hero-visual .n4 { top: 145px; left: 2px; }
.hero-visual-list { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; opacity: 0; }
@media (max-width: 1100px) {
  .hero-visual { display: none; }
  .hero-visual-list { position: static; display: grid; align-content: start; gap: 7px; margin-top: 14px; opacity: 1; pointer-events: auto; }
  .hero-visual-list li { display: inline-flex; width: fit-content; padding: 6px 10px; color: var(--blue); background: #fff; border: 1px solid #d9e4f5; border-radius: 20px; box-shadow: var(--shadow); font-size: 10px; font-weight: 700; }
}

/* ---- Stat definitions disclosure ---- */
.stat-definitions-toggle { margin: 10px 0 0; color: var(--blue); background: transparent; border: 0; font-size: 10px; font-weight: 700; text-decoration: underline; }
.stat-definitions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.stat-definitions[hidden] { display: none; }
.stat-definitions article { padding: 13px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 9px; }
.stat-definitions b { display: block; color: #334155; font-size: 10px; }
.stat-definitions p { margin: 5px 0 0; color: #68788d; font-size: 9px; line-height: 1.6; }
@media (max-width: 900px) { .stat-definitions { grid-template-columns: 1fr; } }

/* ---- Chart list fallback ---- */
.chart-list-view summary { color: var(--blue); cursor: pointer; font-size: 10px; font-weight: 700; }
.chart-list { display: grid; gap: 6px; margin-top: 9px; }
.chart-list div { display: grid; grid-template-columns: 72px 1fr auto; gap: 8px; align-items: center; padding: 7px 9px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 7px; font-size: 9px; }
.chart-list span { color: #6b7984; }
.chart-list strong { color: #334155; }

/* ---- Structured cell-performance tables ---- */
.performance-table { table-layout: fixed; }
.performance-table th, .performance-table td { vertical-align: top; word-break: break-word; }
.cell-performance-note { margin: 7px 0 0; color: #6b7984; font-size: 9px; line-height: 1.6; }

/* ---- Mobile graph/chart sizing ---- */
@media (max-width: 900px) {
  .graph-canvas-wrap, #graph-canvas { min-height: 430px; }
  #gap-scatter { width: 100%; height: auto; }
}

.preregistration-draft { margin-top: 16px; padding: 15px; border: 1px solid #bfd7d1; border-radius: 10px; background: #f5fbf9; }
.preregistration-draft header span { color: #1f6b5f; font: 8px monospace; letter-spacing: .12em; }
.preregistration-draft h4 { margin: 5px 0 10px; color: #173f38; font-size: 15px; }
.preregistration-draft dl { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin: 0; }
.preregistration-draft dt { color: #415651; font-size: 9px; font-weight: 800; }
.preregistration-draft dd { margin: 3px 0 0; color: #334155; font-size: 10px; line-height: 1.65; }
.preregistration-draft ul,.preregistration-draft ol { margin: 0; padding-left: 18px; }
@media(max-width:900px){.preregistration-draft dl{grid-template-columns:1fr}}

/* Defense-in-depth UI authorization: buttons are also hidden without capabilities. */
body:not(.can-review) [data-review],
body:not(.can-review) [data-review-paper],
body:not(.can-review) [data-undo-review],
body:not(.can-edit) [data-edit-fact] { display: none !important; }
body:not(.can-upload) [data-parse-paper] { display: none !important; }

/* Overview: inline metric explanations and spacious category trends. */
.stat-grid { align-items: start; }
.stat-card { position: relative; min-width: 0; padding: 22px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.stat-card > span { display: block; padding-right: 22px; color: #64748b; }
.stat-card > span::after { content: 'ⓘ'; position: absolute; right: 20px; color: #8194a8; }
.stat-card > strong { display: block; margin-top: 12px; font-size: 32px; letter-spacing: -.04em; }
.stat-card [data-stat-definition-text] { display: none; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 400; line-height: 1.7; letter-spacing: 0; }
.stat-card[aria-expanded="true"] [data-stat-definition-text] { display: block; }
.stat-card:hover, .stat-card[aria-expanded="true"] { border-color: #a7bfcf; }
.stat-card:focus-visible, .year-chart .bar:focus-visible { outline: 3px solid #398a7a; outline-offset: 3px; }
.trend-tools { display: flex; align-items: flex-end; flex-direction: column; gap: 10px; }
.trend-tools select { max-width: 100%; padding: 8px 30px 8px 12px; background: #f5f9f8; border: 1px solid #ccdcd7; border-radius: 8px; font-size: 12px; }
.year-chart { height: 290px; margin-top: 20px; padding-top: 28px; }
.year-chart .bar:focus-visible span { opacity: 1; }
.chart-loading { align-self: center; width: 100%; text-align: center; color: #64748b; font-size: 13px; }
.hero-visual { justify-self: center; }
.hero-visual .core { inset: auto; top: 50%; left: 50%; width: 120px; height: 120px; transform: translate(-50%,-50%); display: flex; flex-direction: column; justify-content: center; align-items: center; }
.hero-visual .core small { max-width: 100px; line-height: 1.5; text-align: center; letter-spacing: 0; }
.hero-visual .orbit-node { width: 104px; min-width: 0; padding: 10px 8px; white-space: normal; overflow-wrap: normal; line-height: 1.5; }
.hero-visual .n1 { top: 0; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); }
.hero-visual .n2 { top: 50%; bottom: auto; right: -12px; left: auto; transform: translateY(-50%); }
.hero-visual .n3 { bottom: 0; top: auto; left: 50%; right: auto; transform: translateX(-50%); }
.hero-visual .n4 { top: 50%; bottom: auto; left: -12px; right: auto; transform: translateY(-50%); }
@media(max-width:720px) { .year-chart { height: 250px; } .trend-card .card-head { flex-wrap: wrap; gap: 14px; } .trend-tools { align-items: flex-start; } .stat-card { padding: 20px; } }

/* Trial feedback: compact account controls, readable forms and responsive panels. */
.auth-user[hidden] { display: none !important; }
.auth-modal .detail-card { width: min(440px, 100%); padding: 32px; background: #fff; }
.auth-modal .auth-brand { font-size: 14px; font-weight: 700; letter-spacing: .08em; color: #216b60; }
.auth-modal h2 { margin: 18px 0 24px; font-size: 26px; line-height: 1.3; }
.auth-modal form { gap: 18px; }
.auth-modal label { font-size: 14px; gap: 8px; font-weight: 600; }
.auth-modal input { height: 46px; font-size: 16px; background: #fff; }
.auth-modal .primary { min-height: 46px; border: 0; border-radius: 8px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.auth-modal .auth-note { font-size: 12px; font-weight: 400; line-height: 1.8; }
.auth-modal .auth-error { font-size: 13px; }
.pagination { flex-wrap: wrap; gap: 6px; }
.pagination .page-total { font-size: 12px; color: #64748b; white-space: nowrap; }
.pagination .page-jump { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.pagination .record-page-jump { width: 64px; height: 36px; padding: 6px; border: 1px solid #cdd9e3; border-radius: 6px; }
.pagination button:disabled { opacity: .4; cursor: default; }
.discovery-guide { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; padding: 0; margin: 0 0 20px; }
.discovery-guide li { padding: 12px 16px; background: #e8f2ef; color: #255d54; border-radius: 8px; font-size: 13px; }
.discovery-methods { margin-top: 24px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.discovery-methods > summary { padding: 18px; cursor: pointer; font-size: 14px; font-weight: 600; }
.methods-intro { margin: 0; padding: 0 18px 18px; color: #64748b; line-height: 1.8; font-size: 13px; }
.discovery-methods .closed-loop-workbench, .discovery-methods .temporal-workbench { margin: 12px; }
@media(max-width:1100px) {
 .overview-grid, .landscape-grid, .ingestion-grid, .analysis-lower, .reasoning-layout, .temporal-layout, .closed-loop-science, .closed-loop-lower { grid-template-columns: minmax(0,1fr); }
 .trend-card, .coverage-card { min-height: 0; }
 .result-toolbar { flex-wrap: wrap; gap: 14px; }
 .pagination { max-width: 100%; }
}
@media(max-width:720px) {
 .topbar { height: auto; min-height: 68px; gap: 8px; padding: 12px; }
 .top-actions { gap: 5px; } .topbar h1 { font-size: 15px; }
 .agent-button { padding: 0 8px; } .language-toggle { width: 38px; }
 .auth-toggle { padding: 0 9px; } .auth-user { max-width: 80px; overflow: hidden; }
 .auth-modal { padding: 16px; } .auth-modal .detail-card { padding: 24px; }
 .discovery-guide { display: grid; } .component-recommend-form { grid-template-columns: minmax(0,1fr); }
 .reasoning-head, .closed-loop-head { display: block; } .reasoning-head p { margin-top: 12px; }
 .temporal-metrics, .closed-loop-gates, .workflow-guide { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .publication-evidence-band { grid-template-columns: minmax(0,1fr); }
 .page-jump { flex-wrap: wrap; }
}
.source-card { padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.source-card > small { display: block; color: #64748b; font-size: 11px; margin-top: 6px; }
.source-card blockquote { margin: 10px 0 0; padding-left: 12px; border-left: 3px solid #aac6bd; font-size: 12px; line-height: 1.7; }
