:root {
  color-scheme: dark;
  --bg: #07090d;
  --panel: #0e131b;
  --line: #253141;
  --text: #eef2f5;
  --muted: #8290a0;
  --mint: #65f4bd;
  --amber: #f4b860;
  --effect: #c99b62;
  --violet: #a891ff;
  --cyan: #62c9ee;
}

* { box-sizing: border-box; }
html { overflow-x: hidden; }
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(circle at 70% 0%, rgba(101, 244, 189, .07), transparent 26rem),
    var(--bg);
  overflow-x: hidden;
}
button, input { font: inherit; }
main { width: min(1500px, 100%); max-width: 100%; margin: auto; padding: 34px; }
header, .toolbar, .workspace, .section-heading { display: flex; justify-content: space-between; gap: 24px; min-width: 0; }
header { align-items: end; padding: 18px 0 30px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(42px, 7vw, 92px); letter-spacing: -.07em; line-height: .9; }
h2 { margin-bottom: 10px; font-size: 22px; }
.eyebrow { margin-bottom: 10px; color: var(--mint); font: 700 11px/1.2 ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; }
.lede { max-width: 700px; margin-bottom: 0; color: #aeb8c3; font-size: 17px; line-height: 1.55; }
.now-card, .topic-search, .answer-panel, .toolbar, aside, .graph-shell, .layer, .layer-panel, .ml-control-panel, .training-panel, .dictionary-shell, .dictionary-controls, .temporal-navigator, .concept-card, .law-shell, .theory-shell {
  border: 1px solid var(--line);
  background: rgba(14, 19, 27, .88);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .22);
}
.now-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-width: 230px; padding: 17px 20px; }
.now-card span, .now-card small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.now-card strong { display: block; margin: 5px 0; color: var(--mint); font: 600 30px ui-monospace, monospace; }
.prediction-strength-card {
  display: flex;
  width: auto;
  min-width: 292px;
  margin-left: auto;
}
.accuracy-grades {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}
.accuracy-grades span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid #273446;
  color: #aeb8c3;
  background: #0b1018;
  font: 700 9px ui-monospace, monospace;
  letter-spacing: 0;
  text-transform: none;
}
.accuracy-grades b {
  color: var(--mint);
  font-size: 11px;
}
.accuracy-battery {
  position: relative;
  width: 22px;
  height: 76px;
  border: 1px solid #3a4b61;
  border-radius: 9px;
  background:
    linear-gradient(to top, rgba(101, 244, 189, .12), rgba(98, 201, 238, .06)),
    #080d13;
  overflow: hidden;
}
.accuracy-battery::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 6px;
  width: 8px;
  height: 5px;
  border-radius: 4px 4px 0 0;
  background: #3a4b61;
}
.accuracy-battery i {
  position: absolute;
  inset: auto 3px 3px;
  height: calc(var(--accuracy-fill, 0) * 100%);
  border-radius: 6px;
  background: linear-gradient(to top, var(--mint), var(--cyan));
  box-shadow: 0 0 14px rgba(101, 244, 189, .45);
  transition: height .25s ease;
}
.layer-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 10px 12px;
}
.ml-control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-color: rgba(101, 244, 189, .38);
  background:
    linear-gradient(135deg, rgba(101, 244, 189, .10), rgba(98, 201, 238, .05)),
    rgba(14, 19, 27, .88);
}
.ml-control-panel p { margin: 0; color: var(--muted); font-size: 12px; }
.ml-control-panel button {
  min-width: 150px;
  border-color: rgba(101, 244, 189, .5);
}
.ml-control-panel button[aria-pressed="true"] {
  color: #07110d;
  background: var(--mint);
}
.layer-panel p { margin: 0; color: var(--muted); font-size: 12px; }
.layer-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.layer-tabs button { min-width: 120px; }
.layer-tabs button.holding {
  border-color: rgba(101, 244, 189, .65);
  color: var(--mint);
  box-shadow: inset 0 -3px 0 rgba(101, 244, 189, .5);
}
.layer-tabs button[aria-pressed="true"] {
  border-color: rgba(101, 244, 189, .55);
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(101, 244, 189, .16), rgba(98, 201, 238, .08)),
    #151c26;
}
.topic-search {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(320px, 1.2fr);
  gap: 12px 24px;
  margin-bottom: 14px;
  padding: 18px;
}
.topic-search label { display: block; margin-bottom: 5px; color: var(--text); font-weight: 700; }
.topic-search p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.search-control { display: flex; align-items: stretch; }
.search-control input {
  min-width: 0;
  flex: 1;
  padding: 13px 15px;
  border: 1px solid #334258;
  outline: none;
  color: var(--text);
  background: #090d13;
}
.search-control input:focus { border-color: var(--mint); box-shadow: 0 0 0 2px rgba(101, 244, 189, .12); }
.search-control button { min-width: 76px; border-color: var(--mint); color: #07110d; background: var(--mint); font-weight: 800; }
.search-control button:disabled { cursor: wait; opacity: .6; }
.search-status { align-self: center; }
.search-status.is-error { color: #ff8f8f; }
.search-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.answer-summary {
  justify-content: flex-start;
  margin: -6px 0 14px;
}
.search-summary span {
  padding: 5px 8px;
  border: 1px solid #2c394b;
  color: #b7c1cc;
  background: #121923;
  font: 600 10px ui-monospace, monospace;
}
.answer-panel {
  margin: -2px 0 14px;
  padding: 16px;
  border-color: rgba(101, 244, 189, .34);
  background:
    linear-gradient(135deg, rgba(101, 244, 189, .08), rgba(98, 201, 238, .04)),
    rgba(14, 19, 27, .9);
}
.answer-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}
.answer-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.28;
}
.answer-head > span {
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid rgba(101, 244, 189, .34);
  color: var(--mint);
  background: rgba(101, 244, 189, .06);
  font: 700 10px ui-monospace, monospace;
}
.answer-focus {
  margin: 12px 0 0;
  color: #aeb8c3;
  font-size: 12px;
}
.answer-trace {
  margin-top: 14px;
  border-top: 1px solid #263348;
  color: #b7c1cc;
}
.answer-trace summary {
  padding: 11px 0 6px;
  color: var(--mint);
  cursor: pointer;
  font: 800 11px ui-monospace, monospace;
  text-transform: uppercase;
}
.trace-grid {
  display: grid;
  grid-template-columns: minmax(110px, .28fr) minmax(0, 1fr);
  gap: 8px 12px;
  padding-top: 3px;
  font-size: 12px;
  line-height: 1.45;
}
.trace-grid span {
  color: #778395;
  font: 700 10px ui-monospace, monospace;
  text-transform: uppercase;
}
.trace-grid strong {
  min-width: 0;
  color: #d5dee8;
  font-weight: 600;
}
.answer-evidence {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.answer-evidence li {
  padding: 8px 0;
  border-top: 1px solid #243044;
  color: #b7c1cc;
  font-size: 12px;
  line-height: 1.45;
}
.answer-evidence strong { color: var(--mint); }
.toolbar { align-items: center; margin-bottom: 14px; padding: 10px; }
.filters { display: flex; gap: 6px; }
button {
  padding: 8px 12px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
button:hover, button.active { border-color: #39495e; color: var(--text); background: #151c26; }
.filters button[data-kind="ml"] {
  border-color: rgba(101, 244, 189, .36);
  color: var(--mint);
}
.filters button[data-kind="ml"].active {
  color: #07110d;
  background: var(--mint);
}
.toolbar label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
output { min-width: 36px; color: var(--mint); font-family: ui-monospace, monospace; }
.temporal-navigator {
  display: grid;
  grid-template-columns: minmax(350px, 1.25fr) minmax(180px, .55fr) minmax(260px, .8fr);
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
}
.temporal-pad {
  display: grid;
  grid-template-columns: 110px minmax(150px, 1fr) 110px;
  grid-template-areas:
    ". future ."
    "previous focus next"
    ". past .";
  gap: 6px;
}
#timeForward { grid-area: future; }
#parallelPrevious { grid-area: previous; }
#parallelNext { grid-area: next; }
#timeBackward { grid-area: past; }
.temporal-focus {
  grid-area: focus;
  display: grid;
  place-content: center;
  min-height: 68px;
  border: 1px solid #334258;
  text-align: center;
  background: #090d13;
}
.temporal-focus strong { color: var(--mint); font: 700 14px ui-monospace, monospace; }
.temporal-focus span { margin-top: 5px; color: var(--muted); font-size: 10px; }
.temporal-settings { display: grid; align-content: center; gap: 10px; }
.temporal-settings label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.temporal-settings input, .temporal-settings select {
  width: 100%;
  padding: 8px;
  border: 1px solid #334258;
  color: var(--text);
  background: #090d13;
}
.backtest-card { width: auto; padding: 15px; box-shadow: none; }
.backtest-card strong, .backtest-card span { display: block; }
.backtest-card strong { margin-bottom: 7px; color: var(--text); font-size: 17px; }
.backtest-card span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.time-axis { stroke: #344256; stroke-width: 1; stroke-dasharray: 4 8; }
.time-axis-label {
  fill: #6f7e90;
  font: 700 10px ui-monospace, monospace;
  letter-spacing: .08em;
  text-anchor: end;
}
.workspace { align-items: stretch; }
.graph-shell { position: relative; min-width: 0; flex: 1; overflow: hidden; }
#graph, #timeGraph { display: block; width: 100%; min-height: 620px; background-image: radial-gradient(#1d2937 1px, transparent 1px); background-size: 24px 24px; }
aside { width: 300px; padding: 22px; }
aside p { color: var(--muted); line-height: 1.55; }
.metric { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.metric div { grid-column: 1 / -1; height: 3px; background: #222d3b; }
.metric i { display: block; height: 100%; background: var(--mint); }
.evidence { margin: 18px 0 0; padding: 0; list-style: none; }
.evidence li { padding: 9px 0; border-top: 1px solid var(--line); color: #adb8c3; font-size: 12px; }
.node { cursor: pointer; transition: opacity .2s; }
.node circle { stroke: rgba(255,255,255,.6); stroke-width: 1; }
.node.cause-boundary circle {
  stroke: #f4b860;
  stroke-width: 4;
  filter: drop-shadow(0 0 8px rgba(244, 184, 96, .68));
}
.node.effect-boundary circle {
  stroke: #f1cfaa;
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(241, 207, 170, .46));
}
.node.ml-predicted circle {
  stroke: var(--mint);
  stroke-width: 4;
  filter: drop-shadow(0 0 10px rgba(101, 244, 189, .75));
}
.node.time-prediction-node circle {
  stroke: #b8ffe8;
  stroke-width: 4;
  stroke-dasharray: 3 4;
  filter: drop-shadow(0 0 12px rgba(101, 244, 189, .8));
}
.node text { fill: #e6edf3; font-size: 11px; pointer-events: none; }
.link { fill: none; opacity: .56; }
.link-count {
  fill: #0a0f16;
  stroke: #4a5a70;
  stroke-width: 1;
}
.link-count-text {
  fill: #f4f7fa;
  font: 700 10px ui-monospace, monospace;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.link.cause { stroke: var(--amber); }
.link.effect { stroke: var(--effect); }
.link.parallel { stroke: var(--cyan); stroke-dasharray: 5 5; }
.link.cycle { stroke: var(--violet); stroke-dasharray: 2 7; }
.link.prediction { stroke: var(--mint); stroke-width: 2.2; stroke-dasharray: 6 5; opacity: .72; }
.relation-probability {
  fill: #f8ddb5;
  paint-order: stroke;
  stroke: #080c12;
  stroke-width: 4px;
  font: 800 11px ui-monospace, monospace;
  text-anchor: middle;
  pointer-events: none;
}
.relation-probability.effect { fill: #f1cfaa; }
.relation-probability.prediction {
  fill: #d2ffed;
  stroke: #0d191f;
  stroke-width: 3px;
  font-size: 13px;
  letter-spacing: .02em;
}
.legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.legend i { display: inline-block; width: 18px; margin-right: 6px; border-top: 2px solid; vertical-align: middle; }
.legend .cause { color: var(--amber); }
.legend .effect { color: var(--effect); }
.legend .parallel { color: var(--cyan); border-top-style: dashed; }
.legend .cycle { color: var(--violet); border-top-style: dotted; }
.legend .prediction { color: var(--mint); border-top-style: dashed; }
.section-heading { align-items: end; margin: 46px 0 14px; }
.section-heading > p { max-width: 430px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.layer { padding: 18px; }
.layer time { color: var(--mint); font: 600 12px ui-monospace, monospace; }
.layer article { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.layer h3 { margin: 0 0 7px; font-size: 14px; line-height: 1.35; }
.layer p { margin: 0; color: var(--muted); font-size: 11px; }
.dictionary-layer { min-height: 760px; }
.dictionary-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 22px 0 14px;
}
.dictionary-heading > div > p:last-child { max-width: 680px; color: var(--muted); line-height: 1.5; }
.dictionary-stats { color: var(--mint); font: 600 11px ui-monospace, monospace; }
.dictionary-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
}
.dictionary-controls label {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}
.dictionary-controls input { grid-column: 1 / -1; width: 100%; accent-color: var(--mint); }
.dictionary-controls output { text-align: right; }
.dictionary-shell {
  display: grid;
  grid-template-columns: 46px minmax(220px, 310px) minmax(0, 1fr);
  min-height: 700px;
  overflow: hidden;
}
.dictionary-letters {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow-y: auto;
  border-right: 1px solid var(--line);
}
.dictionary-letters button {
  min-height: 27px;
  padding: 3px;
  font: 700 10px ui-monospace, monospace;
}
.dictionary-letters button small { display: block; color: #58687b; font-size: 7px; }
.dictionary-index { min-width: 0; border-right: 1px solid var(--line); }
.dictionary-index-heading, .dictionary-scan-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.dictionary-index-heading strong { color: var(--mint); font: 600 32px ui-monospace, monospace; }
.dictionary-index-heading span, .dictionary-scan-heading > span { color: var(--muted); font-size: 10px; }
.dictionary-words {
  display: grid;
  align-content: start;
  gap: 6px;
  height: 638px;
  overflow-y: auto;
  padding: 12px;
}
.dictionary-word {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid #263448;
  text-align: left;
}
.dictionary-word i {
  display: block;
  width: var(--word-bubble);
  height: var(--word-bubble);
  justify-self: center;
  border: 1px solid rgba(98, 201, 238, .62);
  border-radius: 50%;
  background: rgba(98, 201, 238, .2);
}
.dictionary-word.generic {
  border-color: rgba(101, 244, 189, .35);
  background: rgba(101, 244, 189, .06);
}
.dictionary-word.generic i {
  border-color: rgba(101, 244, 189, .8);
  background: rgba(101, 244, 189, .34);
}
.dictionary-word b { color: var(--text); font-size: 12px; }
.dictionary-word span { color: var(--muted); font: 600 9px ui-monospace, monospace; }
.dictionary-scan { min-width: 0; }
.dictionary-scan-heading h2 { margin: 0; font-size: 23px; }
#dictionaryGraph {
  display: block;
  width: 100%;
  height: 580px;
  background-image: radial-gradient(#1d2937 1px, transparent 1px);
  background-size: 24px 24px;
}
.dictionary-relation {
  stroke: var(--cyan);
  stroke-linecap: round;
  transition: stroke-width .2s ease, opacity .2s ease;
}
.dictionary-root { fill: var(--mint); stroke: #d8fff0; stroke-width: 1.5; }
.dictionary-peer { fill: var(--cyan); stroke: rgba(255,255,255,.7); stroke-width: 1; cursor: pointer; }
.dictionary-label {
  fill: var(--text);
  font: 600 11px ui-monospace, monospace;
  text-anchor: middle;
  pointer-events: none;
}
.dictionary-count {
  fill: var(--muted);
  font: 500 8px ui-monospace, monospace;
  text-anchor: middle;
  pointer-events: none;
}
.dictionary-status { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.concept-layer { margin-top: 14px; }
.concept-card { padding: 22px; }
.concept-card p { max-width: 850px; color: var(--muted); line-height: 1.55; }
.concept-card ul { margin: 18px 0 0; padding: 0; list-style: none; }
.concept-card li { padding: 10px 0; border-top: 1px solid var(--line); color: #adb8c3; font-size: 13px; }
.law-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 22px 0 14px;
}
.law-heading p { max-width: 780px; color: var(--muted); line-height: 1.55; }
.law-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  min-height: 600px;
}
.law-method {
  width: auto;
  border-width: 0 1px 0 0;
  box-shadow: none;
  background: transparent;
}
.law-domains {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}
.law-domains span,
.law-term {
  padding: 5px 8px;
  border: 1px solid #2c394b;
  color: #b7c1cc;
  background: #121923;
  font: 600 10px ui-monospace, monospace;
  overflow-wrap: anywhere;
}
.master-conclusion {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 143, 143, .38);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 143, 143, .10), transparent 12rem),
    rgba(255, 143, 143, .06);
}
.master-conclusion.accepted {
  border-color: rgba(101, 244, 189, .48);
  background:
    radial-gradient(circle at 0% 0%, rgba(101, 244, 189, .12), transparent 12rem),
    rgba(101, 244, 189, .06);
}
.master-conclusion h3 {
  margin: 0 0 8px;
  color: #ffd0d0;
  font-size: 18px;
  line-height: 1.25;
}
.master-conclusion.accepted h3 { color: var(--mint); }
.master-conclusion p:not(.eyebrow) {
  margin: 0;
  color: #d8e2ed;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.master-conclusion small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font: 600 10px/1.45 ui-monospace, monospace;
  overflow-wrap: anywhere;
}
.law-results {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.doctor-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.doctor-card {
  padding: 15px;
  border: 1px solid #27364a;
  background: rgba(9, 13, 19, .72);
}
.doctor-card:first-child {
  border-color: rgba(101, 244, 189, .78);
  background:
    radial-gradient(circle at 100% 0%, rgba(101, 244, 189, .12), transparent 14rem),
    rgba(9, 13, 19, .88);
}
.doctor-card:first-child::before {
  content: "Lead reviewer";
  display: inline-block;
  margin-bottom: 8px;
  color: #07110d;
  background: var(--mint);
  padding: 4px 7px;
  font: 900 9px ui-monospace, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.doctor-card.active { border-color: rgba(101, 244, 189, .45); }
.doctor-card:first-child.active { border-color: rgba(101, 244, 189, .78); }
.doctor-card.observe { border-color: rgba(244, 184, 96, .42); }
.doctor-card.standby { border-color: rgba(244, 184, 96, .42); }
.doctor-card.sleep { opacity: .68; }
.doctor-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.doctor-card-head span {
  color: var(--mint);
  font: 800 9px ui-monospace, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.doctor-card-head h3 { margin: 4px 0; font-size: 15px; }
.doctor-card-head p { margin: 0; color: var(--muted); font-size: 10px; }
.doctor-card-head strong {
  color: var(--text);
  font: 800 22px ui-monospace, monospace;
}
.doctor-question {
  margin: 12px 0;
  color: #d8e2ed;
  font-size: 12px;
  line-height: 1.45;
}
.doctor-grid {
  display: grid;
  gap: 7px;
}
.doctor-grid div {
  padding-top: 7px;
  border-top: 1px solid #1f2a3a;
}
.doctor-grid b,
.doctor-grid span {
  display: block;
}
.doctor-grid b {
  margin-bottom: 3px;
  color: var(--mint);
  font: 800 9px ui-monospace, monospace;
  text-transform: uppercase;
}
.doctor-grid span {
  color: #aeb8c3;
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.doctor-tests {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.doctor-tests li {
  padding: 7px 0;
  border-top: 1px solid #1f2a3a;
  color: #aeb8c3;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.master-card {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(168, 145, 255, .35);
  background:
    radial-gradient(circle at 0% 0%, rgba(168, 145, 255, .12), transparent 15rem),
    rgba(9, 13, 19, .72);
}
.master-card h3 { margin: 0 0 8px; }
.master-card p { margin: 0; color: #aeb8c3; line-height: 1.55; }
.review-verdict {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 143, 143, .38);
  background: rgba(255, 143, 143, .07);
}
.review-verdict.accepted {
  border-color: rgba(101, 244, 189, .45);
  background: rgba(101, 244, 189, .08);
}
.review-verdict strong,
.review-verdict span,
.review-verdict small {
  display: block;
}
.review-verdict strong { color: #ffd0d0; }
.review-verdict.accepted strong { color: var(--mint); }
.review-verdict span { margin: 6px 0; color: #d8e2ed; font-size: 12px; line-height: 1.5; }
.review-verdict small { color: var(--muted); font: 600 10px ui-monospace, monospace; }
.master-proposals {
  display: grid;
  gap: 8px;
}
.master-proposals section {
  padding: 10px;
  border: 1px solid #28364a;
  background: #0b1018;
}
.master-proposals strong,
.master-proposals span,
.master-proposals small {
  display: block;
}
.master-proposals strong { color: var(--violet); font-size: 13px; }
.master-proposals span { margin: 5px 0; color: #d8e2ed; font-size: 12px; }
.master-proposals small { color: var(--muted); font: 600 10px ui-monospace, monospace; }
.master-proposals strong,
.master-proposals span,
.master-proposals small,
.law-query,
.doctor-question,
.theory-card h3,
.law-card h3 {
  overflow-wrap: anywhere;
}
.law-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 2px;
  color: var(--muted);
  font: 800 10px ui-monospace, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.law-divider::before,
.law-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}
.law-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 18px;
  padding: 16px;
  border: 1px solid #253141;
  background: rgba(9, 13, 19, .72);
}
.law-card h3 { margin: 0 0 6px; font-size: 18px; }
.law-card p { color: #aeb8c3; line-height: 1.55; }
.law-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}
.law-meta span {
  padding: 4px 7px;
  border: 1px solid #2c394b;
  color: var(--mint);
  background: rgba(101, 244, 189, .06);
  font: 700 10px ui-monospace, monospace;
}
.law-probability {
  display: grid;
  place-items: center;
  align-content: center;
  width: 82px;
  height: 82px;
  justify-self: end;
  border: 1px solid rgba(101, 244, 189, .42);
  border-radius: 50%;
  background:
    conic-gradient(var(--mint) calc(var(--law-fit) * 1%), rgba(37, 49, 65, .8) 0),
    #090d13;
}
.law-probability strong {
  color: var(--text);
  font: 800 19px ui-monospace, monospace;
}
.law-probability span {
  color: var(--muted);
  font: 700 8px ui-monospace, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.law-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.law-evidence {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.law-evidence div {
  padding: 8px;
  border: 1px solid #243044;
  color: var(--muted);
  background: #0b1018;
  font-size: 11px;
}
.law-evidence strong { display: block; color: var(--text); font: 700 15px ui-monospace, monospace; }
.law-predictions {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}
.law-predictions p {
  margin: 0;
  padding: 8px;
  border: 1px solid #243044;
  background: #0b1018;
  color: #aeb8c3;
  font-size: 11px;
}
.law-predictions strong { color: var(--mint); }
.law-query {
  margin: 12px 0 0;
  padding: 10px;
  border-left: 2px solid var(--cyan);
  color: #aeb8c3;
  background: rgba(98, 201, 238, .06);
  font: 600 11px/1.45 ui-monospace, monospace;
}
.theory-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 22px 0 14px;
}
.theory-heading p { max-width: 840px; color: var(--muted); line-height: 1.55; }
.theory-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  min-height: 560px;
}
.theory-method {
  width: auto;
  border-width: 0 1px 0 0;
  box-shadow: none;
  background: transparent;
}
.theory-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 14px;
}
.theory-card {
  padding: 15px;
  border: 1px solid rgba(168, 145, 255, .32);
  background:
    radial-gradient(circle at 100% 0%, rgba(168, 145, 255, .10), transparent 13rem),
    rgba(9, 13, 19, .72);
}
.theory-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.theory-card-head span {
  color: var(--violet);
  font: 800 9px ui-monospace, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.theory-card-head h3 { margin: 4px 0; font-size: 16px; }
.theory-card-head p { margin: 0; color: var(--muted); font-size: 10px; }
.theory-card-head strong {
  color: var(--text);
  font: 800 22px ui-monospace, monospace;
}
.ml-layer { margin-top: 14px; }
.ml-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 22px 0 14px;
}
.ml-heading p { max-width: 820px; color: var(--muted); line-height: 1.55; }
.ml-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 14px;
  align-items: start;
}
.ml-pipeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0;
  min-height: 100%;
  min-width: 0;
  border: 1px solid rgba(98, 201, 238, .28);
  background:
    linear-gradient(135deg, rgba(98, 201, 238, .08), rgba(101, 244, 189, .04)),
    rgba(9, 13, 19, .84);
  padding: 15px;
}
.ml-pipeline h3 {
  margin: 0 0 6px;
  font-size: 17px;
}
.ml-pipeline p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.ml-pipeline-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.ml-pipeline-steps span {
  border: 1px solid #273446;
  background: #0b1018;
  padding: 8px 9px;
  color: #aeb8c3;
  font: 800 10px ui-monospace, monospace;
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}
.ml-pipeline-steps span::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #566276;
}
.ml-pipeline-steps span[data-status="pass"] {
  border-color: rgba(101, 244, 189, .42);
  color: #c8ffe8;
}
.ml-pipeline-steps span[data-status="pass"]::before { background: var(--mint); }
.ml-pipeline-steps span[data-status="fail"] {
  border-color: rgba(242, 119, 165, .42);
  color: #ffc7dd;
}
.ml-pipeline-steps span[data-status="fail"]::before { background: var(--pink); }
.ml-pipeline-result {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
  border-top: 1px solid rgba(126, 165, 218, .18);
  padding-top: 12px;
}
.ml-pipeline-result strong {
  color: #edf5ff;
  font-size: 14px;
}
.ml-pipeline-result span,
.ml-pipeline-result em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.ml-stage-grades {
  display: grid;
  gap: 6px;
  border-top: 1px dashed rgba(126, 165, 218, .22);
  padding-top: 8px;
}
.ml-stage-grades span {
  display: block;
  border: 1px solid #273446;
  background: #0b1018;
  color: #b7c1cc;
  font: 700 10px ui-monospace, monospace;
  padding: 7px 8px;
}
.ml-pipeline-result.is-pass strong { color: var(--mint); }
.ml-pipeline-result.is-fail strong { color: var(--pink); }
.training-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px;
  border-color: rgba(101, 244, 189, .34);
  background:
    linear-gradient(135deg, rgba(101, 244, 189, .08), rgba(98, 201, 238, .04)),
    rgba(14, 19, 27, .9);
}
.training-panel h3 {
  margin: 0 0 7px;
  font-size: 18px;
}
.training-panel p:not(.eyebrow) {
  margin: 0;
  color: #aeb8c3;
  font-size: 12px;
  line-height: 1.5;
}
.training-controls {
  display: grid;
  align-content: start;
  gap: 8px;
}
.training-controls label {
  color: var(--muted);
  font: 800 10px ui-monospace, monospace;
  text-transform: uppercase;
}
.training-controls select,
.training-controls input[type="file"] {
  min-width: 0;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #334258;
  color: var(--text);
  background: #090d13;
}
.training-controls input[type="file"] {
  color: #aeb8c3;
  font-size: 12px;
}
.training-controls button {
  border-color: rgba(101, 244, 189, .58);
  color: #07110d;
  background: var(--mint);
  font-weight: 800;
}
.training-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.training-actions button:first-child {
  color: var(--text);
  background: #121a24;
  border-color: rgba(98, 201, 238, .48);
}
.training-actions button:disabled {
  opacity: .46;
  cursor: not-allowed;
}
.training-report {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 7px;
  border-top: 1px solid rgba(126, 165, 218, .18);
  padding-top: 11px;
}
.training-report span {
  padding: 6px 8px;
  border: 1px solid #273446;
  color: #b7c1cc;
  background: #0b1018;
  font: 700 10px ui-monospace, monospace;
}
.ml-shell {
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  min-height: 560px;
  border: 1px solid var(--line);
  background: rgba(14, 19, 27, .88);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .22);
}
.ml-winner {
  width: auto;
  border-width: 0 1px 0 0;
  box-shadow: none;
  background:
    radial-gradient(circle at 0% 0%, rgba(101, 244, 189, .12), transparent 13rem),
    transparent;
}
.ml-winner h2 { color: var(--mint); }
.ml-results {
  display: grid;
  gap: 12px;
  padding: 14px;
}
.ml-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 18px;
  padding: 16px;
  border: 1px solid #253141;
  background: rgba(9, 13, 19, .72);
}
.ml-card.winner {
  border-color: rgba(101, 244, 189, .62);
  background:
    radial-gradient(circle at 100% 0%, rgba(101, 244, 189, .10), transparent 14rem),
    rgba(9, 13, 19, .82);
}
.ml-card h3 { margin: 0 0 6px; font-size: 18px; }
.ml-card p { color: #aeb8c3; line-height: 1.55; }
.ml-learned,
.ml-learned-card {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(98, 201, 238, .32);
  background: rgba(98, 201, 238, .06);
}
.ml-learned strong,
.ml-learned span,
.ml-learned small {
  display: block;
}
.ml-learned strong { color: var(--cyan); font: 800 10px ui-monospace, monospace; text-transform: uppercase; }
.ml-learned span { margin: 6px 0; color: #d8e2ed; font-size: 12px; line-height: 1.45; }
.ml-learned small { color: var(--muted); font: 700 10px ui-monospace, monospace; }
.ml-learned-card {
  margin: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(98, 201, 238, .10), transparent 12rem),
    rgba(9, 13, 19, .72);
}
.ml-learned-card h3 { margin: 0 0 8px; }
.ml-learned-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ml-learned-card li {
  padding: 8px 0;
  border-top: 1px solid #243044;
  color: #aeb8c3;
  font-size: 12px;
  line-height: 1.45;
}
.ml-score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(80px, 1fr));
  gap: 8px;
  margin: 14px 0;
}
.ml-score-grid div {
  padding: 9px;
  border: 1px solid #243044;
  background: #0b1018;
}
.ml-score-grid strong,
.ml-score-grid span {
  display: block;
}
.ml-score-grid strong {
  color: var(--text);
  font: 800 17px ui-monospace, monospace;
}
.ml-score-grid span {
  margin-top: 3px;
  color: var(--muted);
  font: 700 9px ui-monospace, monospace;
  text-transform: uppercase;
}
.ml-forecast {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ml-forecast span {
  padding: 5px 8px;
  border: 1px solid #2c394b;
  color: #b7c1cc;
  background: #121923;
  font: 600 10px ui-monospace, monospace;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  main { padding: 18px; }
  header, .workspace, .section-heading { flex-direction: column; align-items: stretch; }
  .prediction-strength-card {
    position: sticky;
    z-index: 6;
    top: 0;
    width: 100%;
    min-width: 0;
    margin-left: 0;
    align-self: stretch;
    backdrop-filter: blur(12px);
  }
  aside { width: auto; }
  .layers { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .layer-panel, .ml-control-panel { align-items: stretch; flex-direction: column; }
  .layer-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 4px;
    overflow: visible;
    padding-bottom: 2px;
  }
  .layer-tabs button {
    min-width: 0;
    padding: 8px 4px;
    font-size: 12px;
    white-space: normal;
  }
  .temporal-navigator { grid-template-columns: 1fr; }
  .temporal-pad {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "future future"
      "previous next"
      "focus focus"
      "past past";
  }
  .temporal-focus { min-height: 58px; }
  .temporal-settings,
  .temporal-settings label,
  .backtest-card {
    min-width: 0;
  }
  .topic-search { grid-template-columns: 1fr; }
  .search-control { flex-direction: column; }
  .search-control button { min-height: 43px; }
  .search-summary { justify-content: flex-start; }
  .answer-head { flex-direction: column; }
  .answer-head > span { flex: 0 1 auto; }
  .trace-grid { grid-template-columns: 1fr; }
  .filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
    gap: 4px;
    overflow: visible;
    width: 100%;
  }
  .filters button {
    min-width: 0;
    padding: 8px 4px;
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
  }
  #graph,
  #timeGraph {
    min-height: 460px;
  }
  .dictionary-heading { align-items: stretch; flex-direction: column; }
  .dictionary-controls { grid-template-columns: 1fr 1fr; }
  .dictionary-shell { grid-template-columns: 38px minmax(0, 1fr); }
  .dictionary-scan { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .dictionary-index { border-right: 0; }
  .law-heading { align-items: stretch; flex-direction: column; }
  .law-shell { grid-template-columns: 1fr; min-height: 0; }
  .law-method { border-width: 0 0 1px; }
  .doctor-panel { grid-template-columns: 1fr; }
  .master-card { grid-template-columns: 1fr; }
  .law-card { grid-template-columns: 1fr; }
  .law-probability { justify-self: start; }
  .law-evidence { grid-template-columns: 1fr; }
  .theory-heading { align-items: stretch; flex-direction: column; }
  .theory-shell { grid-template-columns: 1fr; min-height: 0; }
  .theory-method { border-width: 0 0 1px; }
  .theory-results { grid-template-columns: 1fr; }
  .ml-heading { align-items: stretch; flex-direction: column; }
  .ml-layout { grid-template-columns: 1fr; }
  .ml-pipeline { grid-template-columns: 1fr; }
  .training-panel { grid-template-columns: 1fr; }
  .training-actions { grid-template-columns: 1fr; }
  .ml-shell { grid-template-columns: 1fr; min-height: 0; }
  .ml-winner { border-width: 0 0 1px; }
  .ml-card { grid-template-columns: 1fr; }
  .ml-score-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  main { padding: 12px; }
  header { padding-top: 10px; }
  h1 {
    font-size: 38px;
    line-height: 1;
    letter-spacing: 0;
  }
  .now-card,
  .topic-search,
  .answer-panel,
  .toolbar,
  aside,
  .graph-shell,
  .layer-panel,
  .temporal-navigator,
  .dictionary-shell,
  .law-shell,
  .theory-shell,
  .ml-shell {
    max-width: 100%;
  }
  .prediction-strength-card {
    gap: 12px;
    padding: 14px 15px;
  }
  .prediction-strength-card strong {
    font-size: 34px;
  }
  .layer-tabs,
  .filters,
  .ml-score-grid {
    grid-template-columns: 1fr 1fr;
  }
  .answer-head h2 {
    font-size: 17px;
  }
  #graph,
  #timeGraph {
    min-height: 390px;
  }
}
