:root {
  /*
   * Site-wide palette — Vercel Geist color scales
   * @see https://vercel.com/geist/colors#scales
   * Accents use high-contrast steps (~700–900); soft fills use ~100.
   */
  --bg: #FAFAFA;              /* backgrounds-200 */
  --paper: #FFFFFF;           /* backgrounds-100 */
  --paper-2: #FAFAFA;
  --ink: #171717;             /* gray-1000 */
  --ink-2: #4A4A4A;           /* between gray-900/1000 */
  --muted: #6F6F6F;           /* gray-900 */
  --line: #EAEAEA;            /* gray-400 */
  --line-strong: #C9C9C9;     /* gray-500-ish */

  /*
   * PRIMARY ACCENT = Geist Blue (#0070F3)
   * Why blue (not teal):
   * - Trust / focus / “study tool” — not hospital-scrubs cliché
   * - Highest-contrast interactive color in Geist for links, selection, CTAs
   * - Matches the Vercel/Geist system we already adopted for edges & type colors
   * CSS var is still named --teal for historical reasons (used everywhere as primary).
   * True teal stays available only as a secondary semantic hue on edges/nodes.
   */
  --teal: #0070F3;
  --teal-soft: #EBF5FF;
  --teal-strong: #0068D6;

  --blue: #0070F3;
  --blue-soft: #EBF5FF;
  --blue-strong: #0068D6;

  --violet: #8E4EC6;
  --violet-soft: #F5EDFF;
  --violet-strong: #6E56CF;

  --pink: #D6409F;
  --pink-soft: #FDE8F4;

  --amber: #F76808;
  --amber-soft: #FFF4E5;
  --amber-strong: #CC4E00;

  --red: #E5484D;
  --red-soft: #FEEBEC;
  --red-strong: #C23B41;

  --green: #46A758;
  --green-soft: #E5F6E8;
  --green-strong: #2A7A3D;

  --cyan: #00A9DB;
  --cyan-soft: #E0F7FC;

  --shadow: 0 16px 42px rgba(23, 23, 23, 0.07);
  --radius: 16px;
  --topbar-h: 72px;
  /* Left rail fixed at original width; right wider so center shrinks ~30–35% */
  --left-w: 280px;
  --right-w: 420px;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); overflow: hidden; }
button, input, select { font: inherit; }
button { color: inherit; }

.app-shell {
  height: 100%;
  display: grid;
  /* left fixed | middle flex | right fixed-wide */
  grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
}
.topbar { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; gap: 24px; padding: 0 22px; background: rgba(255,255,255,.93); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); z-index: 20; }
/* One brand control: wordmark = home. No icon pile. */
.brand-home {
  flex: none;
  border: 0;
  background: transparent;
  margin: 0;
  padding: 4px 2px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.1;
}
.brand-home:hover { color: var(--teal); }
.brand-home:active { transform: translateY(0.5px); }
/* Contextual back — only when history exists; next to study title */
.workspace-nav-row { display: flex; align-items: center; gap: 10px; min-height: 18px; margin-bottom: 2px; }
.workspace-back {
  flex: none;
  border: 1px solid color-mix(in srgb, var(--teal) 35%, white);
  background: var(--teal-soft);
  color: var(--teal-strong);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}
.workspace-back:hover {
  background: color-mix(in srgb, var(--teal) 16%, white);
  border-color: var(--teal);
}
.workspace-back:active { transform: translateY(1px); }
.workspace-title-block { min-width: 0; }
.eyebrow { color: var(--teal); font-size: 10px; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; }
.mode-tabs { display: flex; align-items: stretch; height: 100%; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.mode-tabs::-webkit-scrollbar { display: none; }
.mode-tab { border: 0; background: transparent; padding: 0 11px; position: relative; color: var(--ink-2); font-size: 13px; cursor: pointer; white-space: nowrap; }
.mode-tab:hover { color: var(--ink); }
.mode-tab.active { color: var(--teal); font-weight: 650; }
.mode-tab.active::after { content: ""; position: absolute; height: 3px; border-radius: 3px 3px 0 0; left: 10px; right: 10px; bottom: 0; background: var(--teal); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.coverage-pill { font-size: 11px; color: var(--green-strong); background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 28%, white); border-radius: 999px; padding: 6px 10px; }
.text-button, .mini-button { border: 0; background: transparent; color: var(--teal); cursor: pointer; font-size: 12px; }
.text-button:hover, .mini-button:hover { text-decoration: underline; }
.icon-button { border: 1px solid var(--line); background: var(--paper); width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; cursor: pointer; }
.icon-button:hover { border-color: var(--line-strong); background: var(--paper-2); }

.left-rail { grid-column: 1; grid-row: 2; background: var(--paper); border-right: 1px solid var(--line); overflow-y: auto; z-index: 10; }
.rail-section { padding: 18px; border-bottom: 1px solid var(--line); }
.rail-section.compact { padding-top: 15px; padding-bottom: 15px; }
.rail-section > label:first-child, .field-label { display: block; margin-bottom: 7px; color: var(--ink-2); font-size: 11px; font-weight: 650; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); background: var(--paper-2); border-radius: 10px; padding: 8px 9px; }
.search-box:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.search-box svg { width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 1.8; flex: none; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
kbd { border: 1px solid var(--line); border-bottom-color: var(--line-strong); background: var(--paper); border-radius: 5px; padding: 1px 5px; color: var(--muted); font-size: 10px; }
.search-results { margin-top: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); max-height: 300px; overflow: auto; box-shadow: var(--shadow); }
.search-result { width: 100%; display: block; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; padding: 10px; cursor: pointer; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: var(--paper-2); }
.search-result strong { display: block; font-size: 12px; }
.search-result span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.domain-list, .choice-list { display: grid; gap: 4px; }
.domain-button, .choice-button { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 9px; padding: 9px 10px; text-align: left; cursor: pointer; color: var(--ink-2); font-size: 12px; line-height: 1.25; }
.domain-button { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 9px; }
.domain-button i { width: 8px; height: 8px; border-radius: 3px; background: var(--domain-color, var(--teal)); }
.domain-button small { color: var(--muted); font-size: 9px; }
.domain-button:hover, .choice-button:hover { background: var(--paper-2); }
.domain-button.active, .choice-button.active { border-color: color-mix(in srgb, var(--teal) 35%, white); background: var(--teal-soft); color: var(--teal-strong); font-weight: 620; }
.choice-button .choice-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.check-row { display: flex !important; align-items: center; gap: 8px; margin: 8px 0 !important; color: var(--ink-2) !important; font-size: 12px !important; font-weight: 450 !important; cursor: pointer; }
.check-row input { accent-color: var(--teal); }
.legend-list { display: grid; gap: 8px; }
.legend-list > div { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 11px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--blue); }
.legend-dot.structure { background: var(--teal); }
.legend-dot.disease { background: var(--red); }
.legend-dot.finding { background: var(--violet); }
.legend-dot.drug { background: var(--amber); }
.mode-control { display: none; }
.mode-control.active-control { display: block; }
.rail-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
select { width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 10px; background: var(--paper-2); color: var(--ink); font-size: 12px; margin-bottom: 12px; }
.full-button { width: 100%; border: 1px solid var(--teal); border-radius: 9px; padding: 9px 12px; background: var(--teal); color: white; cursor: pointer; font-size: 12px; font-weight: 650; }
.full-button.secondary { color: var(--teal-strong); background: var(--teal-soft); border-color: color-mix(in srgb, var(--teal) 35%, white); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.segmented button { border: 0; border-right: 1px solid var(--line); padding: 7px 4px; background: var(--paper); font-size: 10px; cursor: pointer; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--teal-soft); color: var(--teal); font-weight: 700; }
.source-list { display: grid; gap: 5px; max-height: calc(100vh - 260px); overflow: auto; }
.source-item { border: 1px solid var(--line); border-radius: 9px; padding: 9px; background: var(--paper-2); cursor: pointer; }
.source-item:hover, .source-item.active { border-color: color-mix(in srgb, var(--teal) 35%, white); background: var(--teal-soft); }
.source-item strong { display: block; font-size: 11px; line-height: 1.3; overflow-wrap: anywhere; }
.source-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }

.workspace { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.workspace-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex: none; }
.workspace-header h2 { margin: 3px 0 2px; font-family: var(--serif); font-weight: 600; font-size: 25px; letter-spacing: -.025em; }
.workspace-header p { margin: 0; color: var(--muted); font-size: 12px; }
.view-stats { display: flex; gap: 8px; }
.stat-chip { border: 1px solid var(--line); background: rgba(255,255,255,.65); border-radius: 10px; padding: 7px 9px; min-width: 64px; }
.stat-chip strong { display: block; font-size: 13px; }
.stat-chip span { display: block; margin-top: 1px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.visual-surface, .question-surface, .source-surface, .board-surface { flex: 1; min-height: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); overflow: hidden; }
.visual-surface { display: flex; flex-direction: column; }
.board-surface { position: relative; display: flex; flex-direction: column; overflow: hidden; }
.board-mount { position: absolute; inset: 0; min-width: 0; min-height: 0; }
.board-mount, .board-mount .tl-container, .board-mount > * { width: 100%; height: 100%; }
.board-loading, .board-error {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 10px;
  justify-items: center;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 30px;
}
.board-error { color: var(--red); background: color-mix(in srgb, var(--paper) 94%, transparent); }
.graph-toolbar { height: 44px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 14px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.breadcrumb { color: var(--muted); font-size: 11px; }
.breadcrumb button { border: 0; background: transparent; color: var(--teal); cursor: pointer; padding: 0; }
.toolbar-actions { display: flex; gap: 5px; }
.toolbar-actions .icon-button { width: 29px; height: 29px; font-size: 13px; }
.canvas-host { flex: 1; min-height: 0; position: relative; overflow: hidden; background-color: var(--paper); background-image: radial-gradient(var(--line) 0.7px, transparent 0.7px); background-size: 18px 18px; }
.graph-scroll-region { position: absolute; inset: 0; min-width: 0; min-height: 0; overflow: hidden; }
#graphSvg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; }
.canvas-host.pathway-mode { display: grid; grid-template-rows: minmax(0,1fr) auto; }
.canvas-host.pathway-mode .graph-scroll-region { position: relative; inset: auto; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; background: color-mix(in srgb, var(--paper) 86%, transparent); }
.canvas-host.pathway-mode #graphSvg { max-width: none; max-height: none; }
.pathway-step-rail { position: relative; z-index: 3; border-top: 1px solid var(--line); background: rgba(255,255,255,.98); padding: 10px 12px 12px; box-shadow: 0 -8px 24px rgba(23, 23, 23, 0.05); }
.pathway-rail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.pathway-rail-head strong { color: var(--ink); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.pathway-rail-head span { color: var(--muted); font-size: 9px; }
.pathway-concept-track { display: flex; align-items: stretch; gap: 7px; overflow-x: auto; padding: 1px 1px 8px; scrollbar-width: thin; }
.pathway-step-card { flex: 0 0 170px; min-height: 62px; border: 1px solid var(--line-strong); border-radius: 10px; background: white; padding: 8px 9px; color: inherit; text-align: left; cursor: pointer; }
.pathway-step-card:hover, .pathway-step-card:focus { border-color: var(--teal); background: var(--teal-soft); outline: none; }
.pathway-step-card.context { border-style: dashed; border-color: var(--line-strong); background: var(--paper-2); }
.pathway-step-card small { display: block; color: var(--teal); font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.pathway-step-card strong { display: block; margin-top: 4px; color: var(--ink); font-size: 10px; line-height: 1.3; }
.pathway-link-list { display: flex; gap: 6px; overflow-x: auto; padding-top: 2px; scrollbar-width: thin; }
.pathway-step-link { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-2); padding: 5px 8px; color: var(--ink-2); font-size: 8.5px; white-space: nowrap; }
.pathway-step-link b { color: var(--teal); font-weight: 750; }
.visual-loading { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; justify-items: center; background: color-mix(in srgb, var(--paper) 90%, transparent); color: var(--muted); font-size: 12px; }
.spinner { width: 25px; height: 25px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 30px; }

/* NEVER set stroke color here — JS sets per-edge colors (CSS would override attributes) */
.graph-edge {
  fill: none;
  opacity: 1;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.graph-edge.high { /* focused — bold colored stroke set via element.style */ }
.graph-edge.derived { stroke-dasharray: 5 4; }
.graph-edge.path-active, .graph-edge.path-edge { }
.graph-edge.muted { /* idle/dim — strokeOpacity set in JS */ }
.graph-edge.dimmed { opacity: 0.05; }
/* fill set inline to match edge stroke */
.edge-label {
  font-size: 12px;
  font-weight: 750;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}
.edge-label.muted { opacity: 0; }
.edge-label.dimmed { opacity: 0; }
.graph-node { cursor: pointer; }
.graph-node .node-body { fill: white; stroke: var(--line-strong); stroke-width: 1.2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 3px 6px rgba(23, 23, 23, 0.07)); }
.graph-node:hover .node-body { stroke: var(--teal); stroke-width: 1.8; }
.graph-node.selected .node-body { stroke: var(--teal); stroke-width: 2.4; }
.graph-node.path-active .node-body { stroke: var(--teal); stroke-width: 2.5; fill: var(--teal-soft); }
.graph-node.dimmed { opacity: .16; }
.graph-node text { pointer-events: none; }
.node-name { fill: var(--ink); font-size: 12px; font-weight: 630; }
.node-type { fill: var(--muted); font-size: 8.5px; text-transform: uppercase; letter-spacing: .08em; }
.node-priority { fill: var(--amber); font-size: 9px; }
.node-accent { stroke: none; }
.node-domain .node-body { fill: var(--teal-soft); stroke: color-mix(in srgb, var(--teal) 40%, white); }
.node-domain .node-name { font-family: var(--serif); font-size: 15px; fill: var(--teal-strong); }
.node-process .node-accent, .node-regulator .node-accent, .node-equation .node-accent { fill: var(--blue); }
.node-structure .node-accent, .node-cell .node-accent, .node-transporter .node-accent, .node-channel .node-accent { fill: var(--teal); }
.node-disease .node-accent, .node-syndrome .node-accent, .node-complication .node-accent { fill: var(--red); }
.node-clinical_finding .node-accent, .node-lab_finding .node-accent, .node-lab_test .node-accent, .node-urine_cast .node-accent, .node-pathology .node-accent { fill: var(--violet); }
.node-drug .node-accent, .node-intervention .node-accent { fill: var(--amber); }
.node-source .node-accent { fill: var(--muted); }

.inspector { grid-column: 3; grid-row: 2; background: var(--paper); border-left: 1px solid var(--line); overflow-y: auto; z-index: 10; }
.inspector-empty { min-height: 100%; display: grid; align-content: center; justify-items: center; text-align: center; padding: 36px; color: var(--muted); }
.inspector-icon { width: 44px; height: 44px; display: grid; place-content: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 21px; }
.inspector-empty h3 { margin: 15px 0 4px; color: var(--ink); font-family: var(--serif); font-size: 22px; }
.inspector-empty p { margin: 0; max-width: 260px; font-size: 14px; line-height: 1.55; }
.inspector-head { padding: 20px 20px 16px; border-bottom: 1px solid var(--line); }
.inspector-head .type-line { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.type-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.priority-badge { color: var(--amber); font-size: 12px; }
.inspector-head h3 { margin: 0; font-family: var(--serif); font-size: 27px; line-height: 1.13; font-weight: 600; }
.inspector-head p { margin: 9px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.inspector-section { padding: 15px 20px; border-bottom: 1px solid var(--line); }
.inspector-section h4 { margin: 0 0 9px; color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.relationship-list { display: grid; gap: 7px; }
.relationship-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; background: var(--paper-2); cursor: pointer; }
.relationship-row:hover { border-color: color-mix(in srgb, var(--teal) 32%, white); }
.relationship-row strong { display: block; font-size: 13px; }
.relationship-row span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.relationship-row i { color: var(--teal); font-style: normal; font-size: 14px; }
.evidence-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 9px; background: var(--paper-2); }
.evidence-card:last-child { margin-bottom: 0; }
.evidence-preview { width: 100%; aspect-ratio: 16/9; object-fit: contain; display: block; background: white; border-bottom: 1px solid var(--line); }
.evidence-body { padding: 10px; }
.evidence-body strong { display: block; font-size: 11px; line-height: 1.3; }
.evidence-meta { margin: 2px 0 5px; color: var(--teal-strong); font-size: 9px; font-weight: 600; }
.evidence-provenance-line { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 7px; }
.source-authority, .source-priority-signal { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 7px; font-size: 10px; line-height: 1; font-weight: 700; }
.source-authority.faculty { background: var(--blue-soft); color: var(--blue); }
.source-authority.student { background: var(--amber-soft); color: var(--amber); }
.source-priority-signal { background: var(--red-soft); color: var(--red); }
.evidence-body p { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.5; }
.evidence-class { display: inline-flex; margin-top: 7px; border-radius: 999px; padding: 3px 7px; background: var(--green-soft); color: var(--green); font-size: 10px; }
.evidence-class.derived { background: var(--amber-soft); color: var(--amber); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; color: var(--ink-2); font-size: 10px; }

.question-surface, .source-surface { overflow-y: auto; padding: 22px; }
/* Sticky recovery bar — one control only (no second Back in the page header) */
.source-return-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  margin: -22px -22px 14px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--teal-soft) 90%, white);
  border-bottom: 1px solid color-mix(in srgb, var(--teal) 22%, white);
  backdrop-filter: blur(10px);
}
.source-return-btn {
  flex: none;
  border: 1px solid color-mix(in srgb, var(--teal) 40%, white);
  background: white;
  color: var(--teal-strong);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(23, 23, 23, 0.04);
  max-width: min(420px, 92vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-return-btn:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}
.question-card { max-width: 840px; margin: 0 auto; }
.question-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; color: var(--muted); font-size: 10px; }
.question-stem { font-family: var(--serif); font-size: 20px; line-height: 1.5; white-space: pre-line; }
.answer-list { display: grid; gap: 9px; margin-top: 22px; }
.answer-choice { display: grid; grid-template-columns: 28px minmax(0,1fr); align-items: start; gap: 10px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--paper-2); padding: 12px; cursor: pointer; text-align: left; line-height: 1.45; }
.answer-choice:hover { border-color: color-mix(in srgb, var(--teal) 40%, white); background: var(--teal-soft); }
.answer-choice.selected { border-color: var(--teal); }
.answer-choice.correct { border-color: color-mix(in srgb, var(--green) 45%, white); background: var(--green-soft); }
.answer-choice.incorrect { border-color: color-mix(in srgb, var(--red) 40%, white); background: var(--red-soft); }
.answer-letter { width: 26px; height: 26px; display: grid; place-content: center; border: 1px solid var(--line-strong); border-radius: 50%; background: white; font-weight: 700; font-size: 11px; }
.question-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.question-actions button { width: auto; min-width: 110px; }
.explanation-panel { margin-top: 20px; border: 1px solid color-mix(in srgb, var(--green) 30%, white); border-radius: 12px; background: var(--green-soft); padding: 16px; }
.explanation-panel h4 { margin: 0 0 7px; font-size: 12px; }
.explanation-panel p { color: var(--ink-2); font-size: 12px; line-height: 1.6; white-space: pre-line; }
.reasoning-path { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 12px 0; }
.reasoning-path button { border: 1px solid color-mix(in srgb, var(--green) 35%, white); border-radius: 999px; background: white; color: var(--green); padding: 5px 8px; font-size: 9px; cursor: pointer; }
.reasoning-path span { color: var(--muted); }
.reasoning-caption { margin-top: 14px; color: var(--teal); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.reasoning-arrow { min-width: 56px; display: grid; justify-items: center; gap: 1px; color: var(--teal) !important; font-size: 15px; }
.reasoning-arrow small { max-width: 105px; color: var(--muted); font-size: 7.5px; line-height: 1.15; text-align: center; }
.mechanism-note { margin: 5px 0 10px !important; color: var(--muted) !important; font-size: 10px !important; }
.concept-set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.concept-set-grid button { border: 1px solid color-mix(in srgb, var(--teal) 32%, white); border-radius: 10px; background: white; padding: 10px; color: var(--ink); text-align: left; cursor: pointer; }
.concept-set-grid button:hover { border-color: var(--teal); background: var(--teal-soft); }
.concept-set-grid strong { display: block; font-size: 10px; line-height: 1.35; }
.concept-set-grid span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; text-transform: uppercase; }

.source-browser { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; min-height: 100%; }
.source-overview h3 { margin: 0; font-family: var(--serif); font-size: 24px; }
.source-overview p { color: var(--muted); font-size: 12px; }
.source-unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 18px; }
.source-unit { border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); overflow: hidden; cursor: pointer; }
.source-unit:hover { border-color: color-mix(in srgb, var(--teal) 40%, white); }
.source-unit img { width: 100%; aspect-ratio: 16/10; object-fit: contain; background: white; border-bottom: 1px solid var(--line); }
.source-unit div { padding: 8px; }
.source-unit strong { display: block; font-size: 10px; }
.source-unit span { color: var(--muted); font-size: 9px; }
.source-text-panel { border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); padding: 14px; overflow-y: auto; max-height: calc(100vh - 190px); }
.source-text-panel img { width: 100%; background: white; border: 1px solid var(--line); border-radius: 8px; }
.source-text-panel h4 { margin: 12px 0 6px; }
.source-text-panel pre { white-space: pre-wrap; font: 10px/1.5 var(--sans); color: var(--ink-2); }

.nephron-scene .segment-shape { fill: #fff; stroke: color-mix(in srgb, var(--teal) 45%, white); stroke-width: 3; vector-effect: non-scaling-stroke; }
.nephron-scene .segment-hit { fill: transparent; cursor: pointer; stroke: transparent; stroke-width: 24; }
.nephron-scene .segment-label { fill: var(--ink); font-size: 14px; font-weight: 700; }
.nephron-scene .segment-sub { fill: var(--muted); font-size: 10px; }
.nephron-overlay-mark { cursor: pointer; }
.nephron-overlay-mark circle { stroke: white; stroke-width: 2; filter: drop-shadow(0 2px 4px rgba(0,0,0,.16)); }
.nephron-overlay-mark text { fill: var(--ink); font-size: 9px; font-weight: 650; paint-order: stroke; stroke: white; stroke-width: 3px; }

.compare-grid { display: grid; grid-template-columns: 1fr 44px 1fr; gap: 10px; padding: 25px; min-width: 760px; }
.compare-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; }
.compare-card header { padding: 15px; border-bottom: 1px solid var(--line); }
.compare-card h3 { margin: 0; font-family: var(--serif); font-size: 19px; }
.compare-body { padding: 13px; }
.compare-row { border-bottom: 1px solid var(--line); padding: 10px 0; }
.compare-row:last-child { border-bottom: 0; }
.compare-row label { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.compare-row p { margin: 4px 0 0; color: var(--ink-2); font-size: 11px; line-height: 1.45; }
.compare-divider { display: grid; place-content: center; color: var(--muted); font-size: 10px; }

.learn-stepper { display: grid; grid-template-columns: 240px minmax(0,1fr); height: 100%; }
.learn-outline { border-right: 1px solid var(--line); padding: 15px; overflow-y: auto; background: var(--paper-2); }
.learn-outline button { width: 100%; border: 0; border-left: 2px solid var(--line); background: transparent; text-align: left; padding: 9px 10px; font-size: 11px; color: var(--ink-2); cursor: pointer; }
.learn-outline button.active { border-left-color: var(--teal); color: var(--teal); background: var(--teal-soft); font-weight: 650; }
.learn-content { padding: 24px; overflow-y: auto; }
.learn-content h3 { margin: 0; font-family: var(--serif); font-size: 24px; }
.learn-content p { color: var(--ink-2); font-size: 13px; line-height: 1.65; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 15px); opacity: 0; pointer-events: none; background: var(--ink); color: white; border-radius: 999px; padding: 8px 13px; font-size: 11px; transition: .2s ease; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-only, .mobile-drawer-close { display: none; }
.drawer-backdrop { display: none; }

@media (max-width: 1180px) {
  :root {
    --left-w: 250px;
    --right-w: 300px;
  }
  .topbar { gap: 12px; padding: 0 14px; }
  .brand-home { font-size: 20px; }
  .mode-tab { padding: 0 8px; }
  .coverage-pill { display: none; }
}

@media (max-width: 920px) {
  body { overflow: hidden; }
  .app-shell { grid-template-columns: minmax(0,1fr); grid-template-rows: 64px minmax(0,1fr); }
  .topbar { grid-column: 1; height: 64px; }
  .brand-home { font-size: 18px; }
  .workspace-back { padding: 3px 8px; font-size: 10px; }
  .mode-tabs { margin-left: auto; }
  .mode-tab { font-size: 11px; padding: 0 7px; }
  .top-actions { display: none; }
  .workspace { grid-column: 1; grid-row: 2; padding: 12px; }
  .workspace-header { align-items: flex-start; }
  .workspace-header h2 { font-size: 21px; }
  .view-stats { display: none; }
  .left-rail, .inspector { position: fixed; top: 64px; bottom: 0; z-index: 50; box-shadow: 14px 0 40px rgba(0,0,0,.16); transition: transform .24s ease; }
  .left-rail { left: 0; width: min(88vw, 340px); transform: translateX(-105%); }
  .left-rail.open { transform: translateX(0); }
  .inspector { right: 0; width: min(88vw, 255px); transform: translateX(105%); border-left: 1px solid var(--line); }
  .inspector.open { transform: translateX(0); }
  .mobile-only, .mobile-drawer-close { display: block; }
  .mobile-drawer-header { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 9px 14px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
  .mobile-drawer-header strong { font-size: 12px; }
  .drawer-close-button { border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); color: var(--teal); padding: 6px 9px; font-size: 11px; cursor: pointer; }
  .drawer-backdrop { position: fixed; inset: 64px 0 0; z-index: 45; display: block; border: 0; background: rgba(23, 23, 23, 0.28); backdrop-filter: blur(1px); }
  .source-browser { grid-template-columns: 1fr; }
  .source-text-panel { max-height: none; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 8px; gap: 6px; }
  .brand-home { font-size: 17px; }
  .mode-tabs { max-width: calc(100vw - 150px); }
  .mode-tab { font-size: 10px; padding: 0 6px; }
  .workspace-header p { display: none; }
  .workspace { padding: 8px; gap: 8px; }
  .workspace-header h2 { font-size: 18px; }
  .graph-toolbar { height: 38px; }
  .question-surface, .source-surface { padding: 14px; }
  .question-stem { font-size: 17px; }
  .answer-choice { padding: 10px; }
  .learn-stepper { grid-template-columns: 1fr; }
  .learn-outline { max-height: 160px; border-right: 0; border-bottom: 1px solid var(--line); }
}

@media print {
  body { overflow: visible; background: white; }
  .topbar, .left-rail, .inspector, .graph-toolbar { display: none !important; }
  .app-shell { display: block; }
  .workspace { display: block; padding: 0; }
  .visual-surface { height: 7.5in; box-shadow: none; }
}

/* Runtime visual system additions */
[hidden] { display: none !important; }
#graphSvg[hidden], .graph-scroll-region[hidden] { display: none !important; }
.html-visual { position: absolute; inset: 0; z-index: 2; overflow: auto; background: var(--paper); }
#graphSvg.is-panning { cursor: grabbing; }
.graph-node { outline: none; transition: opacity .16s ease; }
.graph-node:hover rect:first-of-type, .graph-node:focus rect:first-of-type { stroke-width: 2.2; }
/* Nodes dim via opacity; edges dim only via JS strokeOpacity (do not gray out colored strokes) */
.graph-node.muted { opacity: .18; }
.graph-edge.muted { opacity: 1; }
.edge-label.muted { opacity: 0; }
.graph-node.selected { opacity: 1; }
.graph-node.highlighted { opacity: 1; }
.graph-node.path-context-node { opacity: .58; }
.graph-node.path-context-node rect:first-of-type { stroke-dasharray: 6 4; }
.graph-edge.path-edge { stroke-dasharray: none; }
.node-title { font-size: 15px; font-weight: 650; }
.node-meta { font-size: 10px; text-transform: uppercase; letter-spacing: .055em; }
.edge-label { font-size: 9px; fill: var(--ink-2); paint-order: stroke; stroke: white; stroke-width: 4px; stroke-linejoin: round; }
.fatal-error { display: grid; gap: 5px; text-align: center; max-width: 440px; color: var(--red); }
.fatal-error span { color: var(--ink-2); font-size: 11px; }
.type-badge { background: color-mix(in srgb, var(--badge-color) 12%, white); color: var(--badge-color); border: 1px solid color-mix(in srgb, var(--badge-color) 25%, white); }
.evidence-button { display: block; width: 100%; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.evidence-button:hover { border-color: color-mix(in srgb, var(--teal) 38%, white); box-shadow: 0 5px 15px rgba(23, 23, 23, 0.07); }

.nephron-shell { min-width: 760px; padding: 14px; display: grid; gap: 12px; }
.nephron-stage { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: white; box-shadow: 0 4px 16px rgba(23, 23, 23, 0.04); }
.nephron-scene { width: 100%; height: auto; min-width: 0; display: block; aspect-ratio: 1160 / 620; }
.nephron-caption { display: flex; align-items: baseline; gap: 12px; color: var(--ink); font: 14px/1.4 Inter, ui-sans-serif, sans-serif; }
.nephron-caption strong { color: var(--teal); }
.nephron-caption span { color: var(--muted); }
.nephron-target-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.nephron-target-card { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 11px; align-items: start; border: 1px solid var(--line); border-radius: 11px; background: white; padding: 12px; color: inherit; text-align: left; cursor: pointer; }
.nephron-target-card:hover, .nephron-target-card:focus { border-color: var(--teal); background: var(--teal-soft); outline: none; }
.nephron-target-number { width: 30px; height: 30px; display: grid; place-content: center; border-radius: 50%; background: var(--target-color, var(--teal)); color: white; font-size: 12px; font-weight: 800; }
.nephron-target-copy small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.nephron-target-copy strong { display: block; margin-top: 3px; color: var(--ink); font-size: 14px; }
.nephron-target-copy > span { display: block; margin-top: 4px; color: var(--ink-2); font-size: 12px; line-height: 1.45; }

.compare-shell { max-width: 1180px; margin: 0 auto; padding: 24px; }
.compare-summary { max-width: 850px; margin-bottom: 18px; }
.compare-summary h3 { margin: 3px 0 7px; font: 600 27px/1.15 var(--serif); }
.compare-summary p { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.55; }
.comparison-matrix { display: grid; grid-template-columns: 180px minmax(0,1fr) minmax(0,1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; }
.matrix-header { border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--teal-soft); padding: 14px; text-align: left; color: var(--teal); font-size: 12px; font-weight: 750; }
.matrix-header.condition { cursor: pointer; font-family: var(--serif); font-size: 16px; }
.matrix-header.condition:hover { background: var(--teal-soft); }
.matrix-cell { padding: 13px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 68px; }
.matrix-cell.dimension { background: var(--paper-2); }
.matrix-cell strong { font-size: 10px; color: var(--ink); text-transform: uppercase; letter-spacing: .06em; }
.matrix-cell p { margin: 0; color: var(--ink-2); font-size: 11px; line-height: 1.5; }
.matrix-why { grid-column: 1 / -1; padding: 8px 14px 10px; border-bottom: 1px solid var(--line); background: var(--amber-soft); color: var(--amber-strong); font-size: 10px; line-height: 1.45; }
.matrix-why strong { color: var(--amber); }
.compare-evidence { margin-top: 20px; }
.evidence-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 8px; }
.evidence-mini { display: grid; grid-template-columns: 64px minmax(0,1fr); gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: white; color: inherit; text-align: left; cursor: pointer; }
.evidence-mini:hover { border-color: color-mix(in srgb, var(--teal) 40%, white); background: var(--teal-soft); }
.evidence-mini img { width: 64px; height: 48px; object-fit: contain; border: 1px solid var(--line); border-radius: 5px; background: white; }
.evidence-mini strong { display: block; font-size: 9px; line-height: 1.3; }
.evidence-mini small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.35; }

.learn-description { color: var(--muted); font-size: 10px; line-height: 1.45; margin: 6px 0 13px; }
.learn-progress { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; margin-bottom: 24px; }
.learn-progress span { display: block; height: 100%; background: var(--teal); border-radius: inherit; }
.learn-path-diagram { display: flex; align-items: center; gap: 7px; margin: 24px 0; overflow-x: auto; padding: 10px 2px 16px; }
.learn-node { min-width: 145px; border: 1px solid color-mix(in srgb, var(--teal) 32%, white); border-radius: 11px; background: white; padding: 10px; text-align: left; cursor: pointer; }
.learn-node:hover { background: var(--teal-soft); }
.learn-node strong { display: block; font-size: 11px; }
.learn-node span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.learn-arrow { min-width: 62px; display: grid; justify-items: center; color: var(--teal); font-size: 17px; }
.learn-arrow span { color: var(--muted); font-size: 8px; white-space: nowrap; }
.learn-reasoning, .learn-evidence { margin-top: 22px; }
.learn-reasoning h4, .learn-evidence h4 { margin: 0 0 10px; font-size: 11px; }
.learn-reasoning > div { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 9px; align-items: start; margin-bottom: 8px; }
.learn-reasoning > div > span { width: 22px; height: 22px; display: grid; place-content: center; border-radius: 50%; background: var(--teal-soft); color: var(--teal); font-size: 9px; font-weight: 700; }
.learn-reasoning p { margin: 0; font-size: 11px; line-height: 1.5; }
.learn-navigation { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.learn-navigation .full-button { width: auto; min-width: 110px; }
.full-button:disabled { opacity: .45; cursor: not-allowed; }
.learn-concept-set { margin: 16px 0 22px; }

.rationale-grid { display: grid; gap: 7px; margin-top: 14px; }
.rationale-row { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 9px; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 9px; }
.rationale-row > span { width: 22px; height: 22px; display: grid; place-content: center; border: 1px solid var(--line); border-radius: 50%; font-size: 9px; font-weight: 700; }
.rationale-row p { margin: 0; font-size: 10px; line-height: 1.45; }
.rationale-row p strong { display: block; margin-bottom: 2px; color: var(--ink); }
.rationale-row.correct { border-color: color-mix(in srgb, var(--green) 40%, white); background: var(--green-soft); }
.rationale-row.selected:not(.correct) { border-color: color-mix(in srgb, var(--red) 40%, white); background: var(--red-soft); }
.question-evidence { margin-top: 18px; }
.question-evidence h4 { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 9px; }
.mini-progress { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.mini-progress > div { border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); padding: 7px; }
.mini-progress strong { display: block; font-size: 12px; }
.mini-progress span { display: block; color: var(--muted); font-size: 8px; }

.source-unit.active { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.source-objectives { margin-top: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); padding: 10px 12px; }
.source-objectives summary { cursor: pointer; color: var(--teal); font-size: 10px; font-weight: 700; }
.source-objectives ol { color: var(--ink-2); font-size: 10px; line-height: 1.5; padding-left: 18px; }
.source-unit-objectives { border: 1px solid color-mix(in srgb, var(--teal) 28%, white); border-radius: 8px; background: var(--teal-soft); padding: 9px; color: var(--ink-2); font-size: 9px; }
.source-unit-objectives ul { margin: 5px 0 0; padding-left: 16px; }
.source-linked-concepts { margin-top: 14px; font-size: 10px; }
.source-linked-concepts > strong { display: block; margin-bottom: 7px; }
.tag-button { background: white; cursor: pointer; }
.tag-button:hover { border-color: var(--teal); color: var(--teal); }

@media (max-width: 760px) {
  .comparison-matrix { grid-template-columns: 110px minmax(180px,1fr) minmax(180px,1fr); min-width: 580px; }
  .compare-shell { padding: 14px; overflow-x: auto; }
  .evidence-strip { grid-template-columns: 1fr; }
  .learn-path-diagram { align-items: stretch; }
  .nephron-shell { min-width: 860px; }
}

.mobile-domain-index { min-height: 100%; padding: 14px; background: var(--paper); }
.mobile-domain-index-head { margin-bottom: 12px; }
.mobile-domain-index-head h3 { margin: 2px 0 5px; font: 600 22px/1.15 var(--serif); }
.mobile-domain-index-head p { margin: 0; color: var(--ink-2); font-size: 11px; line-height: 1.5; }
.mobile-domain-actions { display: flex; gap: 8px; margin-top: 10px; }
.mobile-domain-actions button { border: 1px solid color-mix(in srgb, var(--teal) 35%, white); border-radius: 9px; background: var(--teal-soft); color: var(--teal); padding: 8px 10px; font-size: 10px; font-weight: 700; cursor: pointer; }
.mobile-domain-section { margin-top: 16px; }
.mobile-domain-section h4 { margin: 0 0 8px; color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.mobile-concept-list { display: grid; gap: 8px; }
.mobile-concept-card { width: 100%; border: 1px solid var(--line); border-radius: 11px; background: white; padding: 10px 11px; color: inherit; text-align: left; cursor: pointer; box-shadow: 0 3px 10px rgba(23, 23, 23, 0.04); }
.mobile-concept-card:hover, .mobile-concept-card:focus { border-color: var(--teal); outline: none; }
.mobile-concept-card .mobile-concept-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mobile-concept-card small { color: var(--muted); font-size: 8px; letter-spacing: .06em; text-transform: uppercase; }
.mobile-concept-card .mobile-priority { color: var(--amber); font-size: 9px; white-space: nowrap; }
.mobile-concept-card strong { display: block; margin-top: 4px; font-size: 13px; line-height: 1.3; }
.mobile-concept-card p { margin: 5px 0 0; color: var(--ink-2); font-size: 9.5px; line-height: 1.45; }

/* Claim-level canonical evidence overlay */
.section-title-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.section-title-line h4 { margin: 0; }
.reviewed-badge { flex: none; border: 1px solid color-mix(in srgb, var(--green) 35%, white); border-radius: 999px; padding: 3px 7px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .03em; }
.reviewed-tag { border-color: color-mix(in srgb, var(--green) 40%, white); background: var(--green-soft); color: var(--green); }
.section-intro { margin: -1px 0 10px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.canonical-claim-list { display: grid; gap: 8px; }
.canonical-claim-card { border: 1px solid var(--line); border-radius: 10px; padding: 11px; background: var(--paper-2); }
.canonical-claim-card.derived { border-color: var(--line); background: var(--paper-2); }
.claim-topline { display: none; }
.claim-provenance { display: none; }
.claim-confidence { color: var(--muted); font-size: 10px; }
.claim-meta-row { margin-top: 8px; }
.claim-confidence-inline { color: var(--muted); font-size: 10px; margin-left: auto; }
.canonical-claim-card > p { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.55; }
.derivation-note { margin-top: 7px; border-radius: 7px; padding: 7px 8px; background: color-mix(in srgb, var(--amber) 12%, transparent); color: var(--amber-strong); font-size: 11px; line-height: 1.45; }
.claim-anchor-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; align-items: center; }
.claim-anchor {
  max-width: 148px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
  background: white;
  color: inherit;
  cursor: pointer;
  text-align: left;
  line-height: 1.2;
}
.claim-anchor:hover { border-color: color-mix(in srgb, var(--teal) 42%, white); background: var(--teal-soft); }
.claim-anchor strong {
  display: block;
  max-width: 136px;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 8.5px;
  font-weight: 650;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.claim-anchor span {
  display: block;
  margin-top: 1px;
  color: var(--teal-strong);
  font-size: 8px;
  font-weight: 600;
}
.more-evidence { align-self: center; color: var(--muted); font-size: 10px; }
.reviewed-row { border-color: color-mix(in srgb, var(--green) 28%, white); background: var(--paper-2); }
.reviewed-row span span { line-height: 1.4; }

.mechanism-relationship-list { display: grid; gap: 7px; margin: 10px 0 16px; }
.mechanism-relationship-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(120px, auto) minmax(120px, 1fr); align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.mechanism-relationship-row button { border: 0; border-radius: 8px; background: var(--teal-soft); padding: 7px 9px; color: var(--ink); font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.mechanism-relationship-row button:last-child { background: var(--paper-2); }
.mechanism-relationship-row span { color: var(--teal); font-size: 9px; font-weight: 750; text-align: center; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 680px) {
  .mechanism-relationship-row { grid-template-columns: 1fr; }
  .mechanism-relationship-row span { text-align: left; }
}

@media (max-width: 620px) {
  .canvas-host.pathway-mode { grid-template-rows: minmax(0,1fr) auto; }
  .pathway-step-rail { max-height: 220px; padding: 9px 9px 10px; }
  .pathway-rail-head span { display: none; }
  .pathway-step-card { flex-basis: 152px; }
  .nephron-shell { min-width: 980px; }
}
