:root { color-scheme: light dark; --brand-bg:#0b1220; --fg:#0a0e14; --bg:#fff; --muted:#161d28; --line:#8794a8; --rule:#b4c3d8; --panel:#eef4fc; --accent:#0a62d0; --accent-ink:#083a7a; --accent-tint:#e3eefc; --warn-bg:#fff4d6; --warn-fg:#5c4200;
  --c-established:#0b6b3a; --c-strong:#1b7f55; --c-moderate:#8a6500; --c-preliminary:#2b3544; --c-hypothesis:#7a3fa0; --c-ai_prediction:#a3256f; --c-contradicted:#b3261e; --c-unknown:#2b3544; }
@media (prefers-color-scheme: dark) { :root { --fg:#f4f7fb; --bg:#12161d; --muted:#eef2f8; --line:#6a7890; --rule:#3d4b63; --panel:#18222f; --accent:#6db1ff; --accent-ink:#9ccaff; --accent-tint:#1c3150; --warn-bg:#3b3010; --warn-fg:#ffe29a;
  --c-established:#58d596; --c-strong:#6fd9aa; --c-moderate:#f0c44c; --c-preliminary:#e1e8f2; --c-hypothesis:#c99bf0; --c-ai_prediction:#ff8fc8; --c-contradicted:#ff8a80; --c-unknown:#e1e8f2; } }
* { box-sizing: border-box; }
body { margin: 0; font: 17px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--fg); background: var(--bg); }
header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.5rem; border-bottom: 1px solid var(--line); background: var(--brand-bg); color: #fff; }
h1 { font-size: 1.25rem; margin: 0; } main { padding: 1.25rem 1.5rem 2.5rem; max-width: 80rem; margin: 0 auto; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#status { margin: .5rem auto 0; padding: 0 1.5rem; max-width: 80rem; min-height: 1.5rem; font-weight: 500; color: var(--muted); }
form { display: grid; gap: .75rem; max-width: 26rem; } #search-form { max-width: none; grid-template-columns: 1fr auto; align-items: end; } label { display: grid; gap: .25rem; }
input, select, button { font: inherit; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--bg); color: var(--fg); }
button { cursor: pointer; background: var(--accent); color: #fff; border-color: transparent; font-weight: 600; border-radius: .5rem; padding: .55rem 1.1rem; } button:hover { filter: brightness(1.1); }
:focus-visible, g[tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; } label:has(input[type=checkbox]) { display: flex; gap: .5rem; align-items: center; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
#results { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; } #results button { background: var(--panel); color: var(--fg); border-color: var(--line); font-weight: 600; } #results button:hover { border-color: var(--accent); } .meta { color: var(--muted); font-size: .95em; }
#controls { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: .5rem 0; }
.warning { background: var(--warn-bg); color: var(--warn-fg); padding: .5rem .75rem; border-left: 4px solid var(--warn-fg); border-radius: .25rem; } .note { color: var(--muted); }
.legend { list-style: none; margin: 1.25rem 0; padding: 1rem 1.25rem; display: grid; gap: .55rem; font-size: 1rem; color: var(--muted); background: var(--panel); border: 1px solid var(--rule); border-radius: .75rem; } .legend li { display: grid; grid-template-columns: 12.5rem 1fr; align-items: center; gap: .75rem; } .legend .badge { justify-self: start; margin-right: 0; }
.badge { font-weight: 600; background: color-mix(in srgb, currentColor 12%, transparent); display: inline-block; padding: .05rem .5rem; border: 1px solid currentColor; border-radius: 1rem; font-size: .95rem; white-space: nowrap; margin-right: .35rem; }
.pred-flag { color: var(--c-ai_prediction); border-style: dashed; }
.cls-established { color: var(--c-established); } .cls-strong { color: var(--c-strong); } .cls-moderate { color: var(--c-moderate); } .cls-preliminary { color: var(--c-preliminary); }
.cls-hypothesis { color: var(--c-hypothesis); } .cls-ai_prediction { color: var(--c-ai_prediction); } .cls-contradicted { color: var(--c-contradicted); } .cls-unknown { color: var(--c-unknown); }
.graph { overflow: auto; border: 1px solid var(--rule); background: var(--panel); border-radius: .75rem; margin: 1.25rem 0; } .graph-svg { width: 100%; height: min(70vh, 720px); display: block; }
.edge-line { stroke: currentColor; stroke-width: 3.5; } .edge.prediction .edge-line { stroke-dasharray: 8 5; } .edge.cls-hypothesis .edge-line { stroke-dasharray: 2 5; } .edge.cls-contradicted .edge-line { stroke-dasharray: 1 6; stroke-width: 3; }
.edge { cursor: pointer; } .edge.selected .edge-line { stroke-width: 5; } .edge-label { fill: currentColor; font-size: 16px; font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 5px; }
.node { cursor: pointer; } .node.center { cursor: default; } .node-circle { fill: var(--bg); stroke: var(--fg); stroke-width: 4; } .node.center .node-circle { stroke-width: 6; } .node-label { fill: var(--fg); font-size: 17px; font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 5px; }
.type-disease { stroke: #b3261e; } .type-target { stroke: #0b5cad; } .type-compound { stroke: #8a6500; } .type-gene { stroke: #1b7f55; }
table { border-collapse: collapse; width: 100%; } th, td { text-align: left; padding: .35rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: middle; } caption { text-align: left; font-weight: 600; padding: .5rem 0; } tr.prediction td:first-child { border-left: 4px dashed var(--c-ai_prediction); }
#evidence { border: 1px solid var(--rule); background: var(--panel); border-radius: .75rem; padding: 1rem 1.25rem; margin: 1.25rem 0; } #evidence dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; } #evidence dt { font-weight: 600; } #evidence dd { margin: 0; }
blockquote { margin: .25rem 0 .5rem; padding-left: .75rem; border-left: 3px solid var(--line); color: var(--muted); } .callout { padding: .5rem .75rem; border: 1px solid currentColor; border-radius: .4rem; }
@media (max-width: 40rem) { .legend li { grid-template-columns: 1fr; gap: .2rem; } .graph { display: none; } #search-form { grid-template-columns: 1fr; } }          /* small screens: the table is the primary view */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
[role=tablist] { display: flex; gap: .5rem; border-bottom: 1px solid var(--rule); margin-bottom: 1.5rem; } [role=tab] { background: transparent; color: var(--fg); border: 1px solid transparent; border-bottom: 3px solid transparent; border-radius: .4rem .4rem 0 0; padding: .6rem 1rem; font-weight: 500; } [role=tab]:hover { color: var(--accent); }
[role=tab][aria-selected=true] { border-bottom-color: var(--accent); color: var(--accent); font-weight: 700; }
.card { border: 1px solid var(--rule); background: var(--panel); border-radius: .75rem; padding: 1rem 1.5rem; margin: 1rem 0; max-width: 60rem; } .card h3 { margin: .25rem 0; } .excerpt { font-style: italic; }
mark { background: #ffe58a; color: #111; padding: 0 .15rem; } .abstract { line-height: 1.6; } .card fieldset { border: 1px solid var(--line); border-radius: .4rem; } .radio { display: flex; gap: .5rem; align-items: baseline; }
.card textarea { width: 100%; margin: .5rem 0; font: inherit; padding: .4rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--bg); color: var(--fg); }
button.approve { background: #0b6b3a; } button.reject { background: #b3261e; } button:disabled { opacity: .5; cursor: not-allowed; } .confirm { font-weight: 600; } .card-msg { min-height: 1.5rem; color: var(--muted); }
#ask-form textarea { width: 100%; font: inherit; padding: .5rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--bg); color: var(--fg); }
.summary { font-size: 1.1rem; } .finding-text { font-weight: 600; } .finding.prediction { border-left: 6px dashed var(--c-ai_prediction); } .proposal { border-left: 6px solid var(--accent); }
.cls-computed { color: var(--c-preliminary); } .withheld { border: 1px dashed var(--c-contradicted); padding: .5rem 1rem; border-radius: .4rem; margin: 1rem 0; } .trace { margin-top: .5rem; }
.add-member { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; max-width: none; margin: 1rem 0; } .actions label { display: inline-flex; gap: .5rem; align-items: center; margin-right: .5rem; }
#project-detail { border: 1px solid var(--rule); background: var(--panel); border-radius: .75rem; padding: 1rem 1.25rem; margin: 1rem 0; } #project-form { margin: 1rem 0; max-width: 40rem; }
.brand { display: flex; align-items: center; gap: .75rem; } .brand img { display: block; height: auto; max-width: 100%; }
.login-brand { background: var(--brand-bg); border-radius: .6rem; padding: 1.25rem; margin: 0 0 1rem; max-width: 28rem; text-align: center; } .login-brand img { max-width: 100%; height: auto; }
/* sign-in: logo panel on the left, form on the right (stacked on narrow screens); second-factor and set-up stay as one centred card */
#mfa, #enroll { max-width: 28rem; margin: 1.5rem auto 2rem; padding: 1.25rem 1.5rem; background: var(--panel); border: 1px solid var(--rule); border-radius: .75rem; }
#login { max-width: 60rem; margin: 1.5rem auto 2rem; padding: 1.5rem; background: var(--panel); border: 1px solid var(--rule); border-radius: .75rem;
  display: grid; grid-template-columns: minmax(0, 28rem) minmax(0, 1fr); grid-template-areas: "brand title" "brand form"; grid-template-rows: auto 1fr; column-gap: 2rem; align-items: start; }
#login .login-brand { grid-area: brand; align-self: start; width: 100%; max-width: 28rem; margin: 0; padding: 1.25rem; }
#login h2 { grid-area: title; align-self: end; }
#login form { grid-area: form; }
#login h2, #mfa h2, #enroll h2 { margin: 0 0 .75rem; font-size: 1.6rem; }
#login form, #mfa form, #enroll form { max-width: none; gap: .75rem; }
#login form button[type=submit], #mfa form button[type=submit], #enroll-form button[type=submit] { width: 100%; padding: .7rem 1.1rem; }
#mfa h2, #enroll h2 { text-align: center; }
@media (max-width: 56rem) { #login { grid-template-columns: minmax(0, 1fr); grid-template-areas: "brand" "title" "form"; max-width: 30rem; } #login h2 { text-align: center; } }
@media (max-width: 40rem) { #login, #mfa, #enroll { margin: 1rem .75rem 2rem; padding: 1rem; } }
/* a section marked hidden must stay hidden even when a rule above sets its display (the sign-in grid once stayed on screen after login) */
[hidden] { display: none !important; }
/* buttons inside tables (e.g. "Why?") stay compact so rows are not stretched */
td button { padding: .25rem .8rem; font-size: .95rem; }
/* colour restored on the signed-in pages: table header rule in the accent colour; form fields sized to sit between the labels and the headings */
th { border-bottom: 2px solid var(--accent); }
input, select { font-size: 1.05rem; padding: .6rem .75rem; border-radius: .5rem; }
form label:not(:has(input[type=checkbox])) { font-weight: 600; font-size: .95rem; }
/* one colour system for every signed-in screen: interactive things are accent blue, headings are deep blue, and nodes carry a tint of their type colour */
:root { accent-color: var(--accent); }
h2, h3, caption, th { color: var(--accent-ink); }
[role=tab] { color: var(--accent-ink); font-weight: 600; } [role=tab][aria-selected=true] { color: var(--accent); }
#results button { background: var(--accent-tint); color: var(--accent-ink); border-color: var(--accent); border-width: 1.5px; }
input, select, textarea { border: 1.5px solid var(--line); } select { border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--accent); }
.node-circle.type-disease { fill: color-mix(in srgb, #b3261e 16%, var(--bg)); } .node-circle.type-target { fill: color-mix(in srgb, #0a62d0 16%, var(--bg)); }
.node-circle.type-compound { fill: color-mix(in srgb, #8a6500 18%, var(--bg)); } .node-circle.type-gene { fill: color-mix(in srgb, #1b7f55 16%, var(--bg)); }
.graph { border-color: var(--accent); }
.legend, #evidence, .card, #project-detail { border-color: color-mix(in srgb, var(--accent) 35%, var(--rule)); }
@media (prefers-color-scheme: dark) { button:not(.approve):not(.reject):not([role=tab]) { color: #08111f; } }   /* dark theme: the accent blue is light, so button text must be dark */

/* One consistent reveal control; hide the browser's own (Edge/IE) so there are never two. */
input[type=password]::-ms-reveal, input[type=password]::-ms-clear { display: none; }
.show-pw { display: flex; align-items: center; gap: .5rem; font-weight: 400; font-size: .95rem; }
.show-pw input { width: auto; margin: 0; }

/* Stronger secondary text: pure black (white in dark theme), normal weight. */
:root { --muted: #000; }
@media (prefers-color-scheme: dark) { :root { --muted: #fff; } }

/* Print: plain black-on-white report of the current view. */
@media print {
  :root { --bg: #fff; --fg: #000; --muted: #000; --panel: #fff; --line: #555; --rule: #999; --accent: #000; --accent-ink: #000; --accent-tint: #fff; color-scheme: light; }
  body { background: #fff; color: #000; font-size: 11pt; }
  body::before { content: "MOLEQEN \2014  scientific intelligence for drug R&D"; display: block; font-weight: 700; font-size: 12pt; border-bottom: 1.5pt solid #000; padding-bottom: .3rem; margin-bottom: .75rem; }
  header, .skip, #status, #tabs, #search-form, #controls, #logout, #ask-form, #project-form, #queue-status, label[for], .show-pw, button, details > summary { display: none !important; }
  td button, .card button { display: none !important; }
  #results { display: flex !important; margin: .4rem 0 .8rem; }
  #results::before { content: "Search results:"; font-weight: 700; margin-right: .5rem; }
  #results button { display: inline-block !important; background: #fff; color: #000; border: 1pt solid #555; padding: .1rem .5rem; font-size: 10pt; }
  main, #explorer { max-width: none; margin: 0; padding: 0; }
  .legend, .graph, #evidence, .card, #project-detail, .callout { background: #fff; border: 1pt solid #555; box-shadow: none; }
  .graph { overflow: visible; }
  .graph-svg { width: 100%; height: auto; max-height: 12cm; }
  #table th:last-child, #table td:last-child { display: none; } /* Details column holds only on-screen buttons */
  .node-circle, .node-circle[class] { fill: #fff !important; stroke: #000; }
  table { width: 100%; border-collapse: collapse; }
  th, td { border-bottom: .5pt solid #555; }
  tr, .card, li, blockquote, svg { break-inside: avoid; }
  #table { break-inside: avoid-page; } /* keep the header row with its data rows */
  h2, h3, caption { break-after: avoid; }
  a { color: #000; text-decoration: underline; }
}

/* Clear (×) button inside text fields marked data-clearable. */
.clearable { position: relative; display: block; }
.clearable > input, .clearable > textarea { width: 100%; box-sizing: border-box; padding-right: 2.4rem; }
.clearable > .clear-btn { position: absolute; top: .35rem; right: .35rem; width: 1.9rem; height: 1.9rem; padding: 0; display: grid; place-items: center; font-size: 1.3rem; line-height: 1; font-weight: 400; border-radius: 50%; background: transparent; color: var(--fg); border: 1px solid transparent; }
.clearable > .clear-btn:hover { background: var(--accent-tint); border-color: var(--accent); filter: none; }
.clearable > .clear-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.clearable > .clear-btn[hidden] { display: none !important; }
@media (prefers-color-scheme: dark) { .clearable > button.clear-btn:not(.approve):not(.reject) { color: #fff; } }   /* must out-rank the dark-mode button text rule */
@media print { .clear-btn { display: none !important; } }

/* Big graphs: edge labels stay hidden until the line is hovered, focused or selected (the line's accessible name and tooltip always carry the full text). */
.graph-svg.quiet .edge-label { display: none; }
.graph-svg.quiet .edge.selected .edge-label { display: block; }

/* Hover/focus label: a large high-contrast pill drawn above the whole graph, so it is readable on any background and never hidden under other lines. */
.edge-tip { display: none; pointer-events: none; } .edge-tip.on { display: block; } .edge-tip rect { fill: var(--fg); } .edge-tip text { fill: var(--bg); font-weight: 700; }

/* Graph notes: a calm blue callout, distinct from the amber warning. The words carry the meaning; colour only helps it stand out. */
.graph-note { background: var(--accent-tint); color: var(--accent-ink); padding: .5rem .75rem; border-left: 4px solid var(--accent); border-radius: .25rem; font-weight: 600; margin: .5rem 0; }

.copy-link { margin-left: .5rem; font-size: .85em; padding: .1rem .5rem; }
.form-error { margin: .75rem 0 0; max-width: 28rem; }
