/* The light theme shares the blue-grey of the dark theme: a misty page, white panels and the ink
   header, whose colour is the panel colour of the dark theme. */
:root{
  --paper:#E7ECF0;--panel:#FFFFFF;--ink:#18212A;--muted:#5F6D7A;
  --line:#DEE4EA;--line-strong:#B7C2CC;--code:#F3F6F9;
  --kg:#167684;--kg-strong:#0F5D69;--kg-soft:#DDEDF1;
  --llm:#AD6708;--llm-soft:#F7EBD6;
  --drop:#B0443F;--drop-soft:#F6E3E2;--context:#6C8594;
  --mono:ui-monospace,"SF Mono","JetBrains Mono",Menlo,Consolas,monospace;
  --sans:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --header:#18212A;--header-ink:#F2F5F7;--header-muted:#A9B6C2;--header-line:rgba(255,255,255,.16);
  --fill:#1A6B78;--on-fill:#FFFFFF;--panel-shadow:0 10px 28px rgba(20,30,38,.05);
  /* Similarity of a generated name: red below θ, neutral at θ, teal above (the score boxes and their legend). */
  --score-low:color-mix(in srgb,var(--drop) 55%,var(--panel));--score-mid:color-mix(in srgb,var(--line-strong) 45%,var(--panel));
  --score-high:color-mix(in srgb,var(--kg) 55%,var(--panel));
}
/* ?print draws the figures of the paper, so it keeps the colours they were drawn with. */
html[data-print]{
  --paper:#E9EEE9;--ink:#18212A;--muted:#68747D;--line:#E2E5E1;--line-strong:#BEC7C1;--code:#F6F8F6;
  --kg:#0E7C86;--kg-strong:#08636B;--kg-soft:#E1F0F0;--llm:#B26B00;--llm-soft:#F8ECD7;
  --drop:#B34740;--drop-soft:#F7E5E3;--context:#718E93;
}
/* The dark theme continues the ink of the light header: its panels are #18212A. Filled controls
   keep a mid-tone teal with light text, so that they do not outshine the graph. */
:root[data-theme="dark"]{
  --paper:#121820;--panel:#18212A;--ink:#E4EAEF;--muted:#94A2AE;
  --line:#26313D;--line-strong:#3A4755;--code:#141C25;
  --kg:#56B4BE;--kg-strong:#83CCD3;--kg-soft:#173540;
  --llm:#E0A65C;--llm-soft:#3A2D1B;--drop:#E08079;--drop-soft:#3D2426;--context:#8199A6;
  --header:#0D1218;--header-ink:#E4EAEF;--header-muted:#94A2AE;--header-line:#26313D;
  --fill:#2A7480;--on-fill:#F2F7F9;--panel-shadow:none;
}
/* A wide screen shows the page larger, as the zoom of the browser would: 2,560 CSS pixels show
   the layout of 1,920. Narrower screens keep the sizes of the stylesheet. The zoom also scales the
   viewport units, so the rules that use vh or vw divide them by it, and the scripts measure the
   graph in the pixels of the page (app.js, native-graph.js). */
:root{--page-zoom:1}
@media (min-width:2048px){:root{--page-zoom:1.1}}
@media (min-width:2304px){:root{--page-zoom:1.2}}
@media (min-width:2560px){:root{--page-zoom:1.333}}
html{zoom:var(--page-zoom)}
html[data-print]{--page-zoom:1}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%}
body{
  color:var(--ink);font-family:var(--sans);-webkit-font-smoothing:antialiased;
  background:
    var(--paper);
}
button,input,select{font:inherit}
button,a,input,select,.panel,.mode-switch,.mode-option,.code-shell,.theta-wrap,.db-picker,.top-control{border-radius:0!important}
button{cursor:pointer}
.topbar{
  position:sticky;top:0;z-index:100;border-bottom:1px solid var(--line-strong);
  background:var(--header);
  box-shadow:none;}
.topbar-inner{width:min(1240px,100%);min-height:58px;margin:0 auto;padding:10px clamp(32px,calc(4vw / var(--page-zoom)),52px);display:flex;align-items:center;gap:18px}
.topbar-brand{display:flex;align-items:center;gap:10px}
.topbar-controls{margin-left:auto;display:flex;align-items:stretch;gap:8px}
.db-picker,.top-control{height:36px;border:1px solid var(--line-strong);background:var(--panel);box-shadow:none}
.db-picker{display:flex;align-items:center;gap:8px;padding:0 8px 0 10px}.db-status{width:7px;height:7px;border-radius:50%;background:var(--kg);box-shadow:0 0 0 3px var(--kg-soft)}.db-picker label{font-size:11px;color:var(--muted);font-weight:700}.db-picker select{min-width:150px;height:34px;border:0;background:transparent;color:var(--ink);font-size:12px;font-weight:700}
.top-control{display:flex;align-items:center;justify-content:center;padding:0 12px;text-decoration:none;color:var(--ink);font-size:12px;font-weight:700}
.wrap{width:min(1240px,100%);margin:0 auto;padding:40px clamp(32px,calc(4vw / var(--page-zoom)),52px) 78px}

.workspace{display:grid;grid-template-columns:minmax(360px,420px) minmax(0,1fr);gap:20px;align-items:start}
.panel{border:1px solid var(--line-strong);background:var(--panel);box-shadow:none}
.query-panel{padding:18px}.panel-heading{display:flex;justify-content:space-between;gap:12px;padding-bottom:12px;margin-bottom:11px;border-bottom:1px solid var(--line)}.section-label{font-size:12px;font-weight:700}.execution-state,.run-hint{font:11px var(--sans);color:var(--muted)}.execution-state{padding:4px 7px;border:1px solid var(--line);background:var(--code)}
.qmeta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}.mode-title{font:700 11px var(--sans);color:var(--muted);}.mode-switch{display:inline-flex;border:1px solid var(--line-strong);background:var(--code)}.mode-option{min-width:58px;padding:5px 9px;text-align:center;font:700 11px var(--sans);color:var(--muted);border-right:1px solid var(--line-strong)}.mode-option:last-child{border-right:0}.active-base{color:var(--llm);background:var(--llm-soft);box-shadow:inset 0 -2px 0 var(--llm)}.active-context{color:var(--kg);background:var(--kg-soft);box-shadow:inset 0 -2px 0 var(--kg)}.mode-detail{font:11px var(--sans);color:var(--muted)}.mode-help{margin:0 0 13px;color:var(--muted);font-size:12px;line-height:1.5}
.code-shell{overflow:hidden;border:1px solid var(--line-strong);background:var(--code);box-shadow:none}.code-top{height:31px;display:flex;align-items:center;justify-content:space-between;padding:0 11px;border-bottom:1px solid var(--line);font:11px var(--sans);color:var(--muted);}.code-top strong{color:var(--kg)}.query-code{min-height:230px;max-height:350px;overflow:auto;margin:0;padding:14px 15px;white-space:pre-wrap;font:13px/1.65 var(--mono)}.kw{color:var(--kg);font-weight:700}.gen{color:var(--llm);font-weight:700}.cmt{color:var(--muted)}
.theta-wrap{margin-top:14px;padding:12px;border:1px solid var(--line);background:var(--code);box-shadow:none}.theta-wrap.off{display:none}.theta-row{display:flex;justify-content:space-between;font:11px var(--sans);color:var(--muted)}.theta-row strong{color:var(--kg)}input[type=range]{width:100%;margin-top:9px;accent-color:var(--kg)}
.run-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px}.run-btn{padding:10px 18px;border:1px solid var(--fill);color:var(--on-fill);background:var(--fill);box-shadow:none;font-size:13px;font-weight:700}.run-btn:disabled{opacity:.55}
.live-dot{width:8px;height:8px;border-radius:50%;background:var(--drop);box-shadow:0 0 0 3px var(--drop-soft)}
.privacy{grid-column:1/-1;margin:0;padding:9px 10px;border-left:2px solid var(--kg);background:var(--kg-soft);color:var(--muted);font-size:11px;line-height:1.5}.field{display:flex;flex-direction:column;gap:5px}.field label,.grounding-method legend{font-size:11px;font-weight:700;color:var(--muted);}.field input,.field select{min-height:35px;padding:8px 9px;border:1px solid var(--line-strong);background:var(--code);color:var(--ink);font:11.5px var(--sans)}
.grounding-method{grid-column:1/-1;padding:0;border:0}.ground-option{display:flex;gap:9px;align-items:flex-start;padding:8px;cursor:pointer}.ground-option:has(input:checked){background:color-mix(in srgb,var(--kg-soft) 52%,transparent);box-shadow:inset 3px 0 0 var(--kg)}.ground-option input[type=radio]{appearance:none;width:14px;height:14px;margin:2px 0 0;border:1.5px solid var(--line-strong);border-radius:50%!important;background:var(--panel);display:grid;place-items:center}.ground-option input[type=radio]::before{content:"";width:7px;height:7px;border-radius:50%;background:var(--kg);transform:scale(0)}.ground-option input[type=radio]:checked::before{transform:scale(1)}.ground-option span{display:flex;flex-direction:column;gap:3px}.ground-option strong{font-size:12px}.ground-option small{font-size:11px;color:var(--muted)}.embedding-settings{display:grid;grid-template-columns:1fr 1fr;gap:11px;padding:9px 8px 3px 31px}.embedding-settings.is-disabled{opacity:.45}
.graph-panel{padding:0;overflow:hidden}.graph-toolbar{min-height:62px;display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--line)}.graph-status{margin-top:5px;color:var(--muted);font:11px var(--sans)}.graph-controls{display:flex;gap:6px}.graph-controls button{height:32px;min-width:34px;padding:0 10px;border:1px solid var(--line-strong);color:var(--ink);background:var(--panel);box-shadow:none;font-size:11px;font-weight:700}
.graph-stage{position:relative;height:570px;overflow:hidden;background:var(--panel);}#kgGraph{display:block;width:100%;height:100%}.graph-help{position:absolute;left:12px;bottom:11px;padding:5px 7px;border:1px solid var(--line-strong);background:color-mix(in srgb,var(--panel) 86%,transparent);color:var(--muted);font-size:11px;pointer-events:none}.tooltip{position:absolute;z-index:20;max-width:270px;padding:9px 10px;border:1px solid var(--line-strong);background:var(--panel);box-shadow:none;font-size:11px;line-height:1.45;pointer-events:none}.tooltip code{font:11px var(--mono);color:var(--muted);word-break:break-all}
.link{stroke:var(--line-strong);stroke-width:1;stroke-opacity:.35}.link.query-link{stroke:var(--kg);stroke-width:2;stroke-opacity:.95}.link.context-link{stroke:var(--context);stroke-width:1.4;stroke-opacity:.72}.link.faded{stroke-opacity:.025}.node circle{stroke:var(--panel);--node-stroke:1.3px;fill:var(--kg);filter:drop-shadow(0 2px 3px rgba(20,30,38,.18))}.node.type-Group circle{fill:color-mix(in srgb,var(--kg) 58%,var(--llm) 42%)}.node.type-City circle,.node.type-Venue circle{fill:color-mix(in srgb,var(--kg) 58%,#73858A 42%)}.node text{fill:var(--ink);font-size:9.5px;font-family:var(--sans);paint-order:stroke;stroke:var(--panel);stroke-width:3px;pointer-events:none}.node.type-Athlete text{display:none}.node.query-result text,.node.inspect text{display:block;font-weight:800;font-size:11px}.node.query-result circle{fill:var(--kg);stroke:color-mix(in srgb,var(--kg) 60%,white 40%);--node-stroke:3px;filter:drop-shadow(0 0 9px color-mix(in srgb,var(--kg) 55%,transparent))}.node.context circle{fill:var(--context);--node-stroke:2px}.node.faded{opacity:.055}.node.inspect circle{stroke:var(--llm);--node-stroke:3px}
.legend{display:flex;gap:14px;flex-wrap:wrap;padding:11px 14px;border-top:1px solid var(--line);color:var(--muted);font-size:11px}.legend span{display:flex;align-items:center;gap:6px}.legend i{width:7px;height:7px;border-radius:50%;display:inline-block}.lg-kg{background:var(--kg)}.lg-result{background:var(--kg);box-shadow:0 0 0 2px var(--kg-soft)}.lg-context{background:var(--context)}.lg-llm{background:var(--llm)}.lg-drop{background:var(--drop)}.caption{margin:16px 0 0;padding:10px 12px;border-left:3px solid var(--line-strong);color:var(--muted);font-size:12px;line-height:1.5}
@media(max-width:920px){.workspace{grid-template-columns:1fr}.graph-stage{height:520px}}@media(max-width:760px){.topbar-inner{flex-wrap:wrap;padding:8px 24px}.topbar-controls{width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto auto}.wrap{padding:28px 24px 58px}}@media(max-width:560px){.topbar-inner{padding-inline:16px}.wrap{padding-inline:16px}.topbar-controls{grid-template-columns:1fr 1fr}.db-picker{grid-column:1/-1}.embedding-settings{grid-template-columns:1fr}.graph-toolbar{align-items:flex-start;flex-direction:column}.graph-stage{height:470px}}

/* Compose + defer: compare two physical execution strategies */
.compose-run{
  margin-top:14px;
  padding-top:13px;
  border-top:1px solid var(--line);
}
.compose-run[hidden],
.execution-result[hidden]{
  display:none!important;
}
.compose-run-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.compose-run-title{
  color:var(--ink);
  font-size:11px;
  font-weight:700;
}
.compose-run-note{
  color:var(--muted);
  font:11px var(--sans);
}
.compose-buttons{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.strategy-btn{
  min-height:78px;
  padding:10px 11px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:3px;
  text-align:left;
  border:1px solid var(--line-strong);
  color:var(--ink);
  background:var(--panel);
  box-shadow:none;
  transition:transform .14s ease,border-color .14s ease,box-shadow .14s ease;
}
.strategy-btn:hover{
  transform:translateY(-1px);
  box-shadow:none;
}
.strategy-btn:disabled{
  opacity:.55;
  cursor:default;
  transform:none;
}
.strategy-btn strong{
  font-size:12.5px;
  line-height:1.2;
}
.strategy-btn small{
  color:var(--muted);
  font:11px/1.35 var(--sans);
}
.strategy-kicker{
  font:700 11px var(--sans);
}
.genop-first-btn{
  border-color:color-mix(in srgb,var(--llm) 45%,var(--line-strong));
  background:
    color-mix(in srgb,var(--llm-soft) 45%,var(--panel));
}
.genop-first-btn .strategy-kicker{
  color:var(--llm);
}
.planner-btn{
  border-color:color-mix(in srgb,var(--kg) 45%,var(--line-strong));
  background:
    color-mix(in srgb,var(--kg-soft) 50%,var(--panel));
}
.planner-btn .strategy-kicker{
  color:var(--kg);
}

.execution-result{
  margin-top:12px;
  border:1px solid var(--line-strong);
  background:
    var(--panel);
  box-shadow:none;
}
.execution-result.genop-first{
  box-shadow:inset 3px 0 0 var(--llm);
}
.execution-result.planner{
  box-shadow:inset 3px 0 0 var(--kg);
}
.execution-result-head{
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-bottom:1px solid var(--line);
}
.execution-result-head > div:first-child{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.execution-eyebrow{
  color:var(--muted);
  font:700 11px var(--sans);
}
.execution-result-head strong{
  font-size:13px;
}
.execution-badge{
  padding:5px 7px;
  border:1px solid var(--line-strong);
  background:var(--code);
  color:var(--ink);
  font:700 11px var(--sans);
}
.execution-result.genop-first .execution-badge{
  color:var(--llm);
  border-color:color-mix(in srgb,var(--llm) 45%,var(--line-strong));
  background:var(--llm-soft);
}
.execution-result.planner .execution-badge{
  color:var(--kg);
  border-color:color-mix(in srgb,var(--kg) 45%,var(--line-strong));
  background:var(--kg-soft);
}
.execution-order{
  display:flex;
  align-items:stretch;
  gap:5px;
  padding:11px 12px;
  overflow-x:auto;
  border-bottom:1px solid var(--line);
}
.execution-step{
  min-width:88px;
  flex:1 0 auto;
  padding:8px 8px;
  border:1px solid var(--line);
  background:var(--code);
}
.execution-step .step-no{
  display:block;
  margin-bottom:4px;
  color:var(--muted);
  font:700 11px var(--sans);
}
.execution-step strong{
  display:block;
  font-size:11px;
  line-height:1.25;
}
.execution-step small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font:11px/1.35 var(--sans);
}
.execution-arrow{
  display:flex;
  align-items:center;
  color:var(--muted);
  font-family:var(--sans);
  font-size:12px;
}
.execution-result.genop-first .execution-step.genop-step{
  border-color:color-mix(in srgb,var(--llm) 45%,var(--line-strong));
  background:var(--llm-soft);
}
.execution-result.planner .execution-step.genop-step{
  border-color:color-mix(in srgb,var(--kg) 45%,var(--line-strong));
  background:var(--kg-soft);
}
.execution-metrics{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  border-bottom:1px solid var(--line);
}
.execution-metric{
  padding:10px 12px;
  border-right:1px solid var(--line);
}
.execution-metric:last-child{
  border-right:0;
}
.execution-metric span{
  display:block;
  margin-bottom:3px;
  color:var(--muted);
  font:11px var(--sans);
}
.execution-metric strong{
  display:block;
  color:var(--ink);
  font:700 16px var(--sans);
}
.execution-result.planner #executionCalls,
.execution-result.planner #executionReduction{
  color:var(--kg);
}
.execution-result.genop-first #executionCalls{
  color:var(--llm);
}
.execution-explanation{
  margin:0;
  padding:10px 12px 11px;
  color:var(--muted);
  font-size:11px;
  line-height:1.5;
}

@media(max-width:560px){
  .compose-buttons{
    grid-template-columns:1fr;
  }
  .compose-run-head{
    align-items:flex-start;
    flex-direction:column;
  }
  .execution-metrics{
    grid-template-columns:1fr;
  }
  .execution-metric{
    border-right:0;
    border-bottom:1px solid var(--line);
  }
  .execution-metric:last-child{
    border-bottom:0;
  }
}

/* The recorded demo and the local workbench share the graph renderer and dataset
   picker, but are separate user-facing modes. Keep inactive controls out of both
   layout and keyboard navigation instead of mixing both products in one panel. */
[data-page-mode="demo"] .live-only,
[data-page-mode="live"] .demo-only{
  display:none!important;
}

/* Semantic graph palette: color communicates state, never entity type. */
.node circle,
.node.type-Group circle,
.node.type-Team circle,
.node.type-Venue circle,
.node.type-City circle,
.node.type-Athlete circle,
.node.type-NobelPrize circle,
.node.type-NobelField circle,
.node.type-NobelAward circle,
.node.type-NobelLaureate circle{
  fill:var(--kg)!important;
}
.node.query-result circle{
  fill:var(--kg)!important;
  stroke:color-mix(in srgb,var(--kg) 60%,white 40%)!important;
}
.node.context circle{
  fill:var(--context)!important;
}
.node.generated-candidate circle,
.node.generated-attribute circle{
  fill:var(--llm)!important;
}
.node.generated-candidate.candidate-dropped circle,
.node.generated-attribute.generated-wrong circle,
.node.composition-dropped circle,
.node.generated-attribute.composition-dropped circle{
  fill:var(--drop)!important;
  stroke:var(--drop)!important;
}

/* Keep the Java engine address aligned with the full settings card width. */
.engine-settings #engineBase{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
}
.engine-settings #engineBase{
  display:block!important;
}

/* Generate attributes: GENOP result summary */
.attribute-result[hidden]{display:none!important}
.attribute-result{
  margin-top:12px;
  border:1px solid color-mix(in srgb,var(--llm) 42%,var(--line-strong));
  background:
    var(--panel);
  box-shadow:
    inset 3px 0 0 var(--llm);
}
.attribute-result-head{
  min-height:52px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-bottom:1px solid var(--line);
}
.attribute-result-head > div{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.attribute-eyebrow{
  color:var(--llm);
  font:700 11px var(--sans);
}
.attribute-result-head strong{
  font-size:13px;
}
.generated-pill{
  padding:5px 7px;
  border:1px solid color-mix(in srgb,var(--llm) 50%,var(--line-strong));
  color:var(--llm);
  background:var(--llm-soft);
  font:700 11px var(--sans);
}
.attribute-metrics{
  display:grid;
  grid-template-columns:1fr 1fr;
  border-bottom:1px solid var(--line);
}
.attribute-metric{
  padding:10px 12px;
  border-right:1px solid var(--line);
}
.attribute-metric:last-child{border-right:0}
.attribute-metric span{
  display:block;
  margin-bottom:3px;
  color:var(--muted);
  font:11px var(--sans);
}
.attribute-metric strong{
  color:var(--llm);
  font:700 18px var(--sans);
}
.sample-summary{
  padding:8px 12px;
  border-bottom:1px solid var(--line);
  color:var(--muted);
  font:11px var(--sans);
}
.attribute-rows{
  max-height:220px;
  overflow:auto;
}
.attribute-row{
  display:grid;
  grid-template-columns:minmax(0,1.3fr) minmax(0,.8fr) auto;
  gap:8px;
  align-items:center;
  padding:8px 12px;
  border-bottom:1px solid var(--line);
}
.attribute-row:last-child{border-bottom:0}
.attribute-player{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:11px;
  font-weight:700;
}
.attribute-others{
  display:block;
  margin-top:2px;
  white-space:normal;
  font-size:11px;
  font-weight:400;
  color:var(--muted);
}
.attribute-generated-value{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--llm);
  font:700 11px var(--sans);
}
.attribute-state{
  min-width:58px;
  padding:3px 5px;
  border:1px solid var(--line-strong);
  text-align:center;
  font:700 11px var(--sans);
}
.attribute-state.correct{
  color:var(--kg);
  border-color:color-mix(in srgb,var(--kg) 44%,var(--line-strong));
  background:var(--kg-soft);
}
.attribute-state.wrong{
  color:var(--drop);
  border-color:color-mix(in srgb,var(--drop) 44%,var(--line-strong));
  background:var(--drop-soft);
}
.attribute-state.abstain{
  color:var(--muted);
  background:var(--code);
}
.attribute-note{
  margin:0;
  padding:9px 12px 10px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:11px;
  line-height:1.45;
}

/* Ephemeral GENOP-generated attribute nodes in the graph */
.node.generated-attribute circle{
  fill:var(--llm)!important;
  stroke:color-mix(in srgb,var(--llm) 55%,white 45%)!important;
  --node-stroke:2.5px!important;
  filter:drop-shadow(0 0 8px color-mix(in srgb,var(--llm) 45%,transparent))!important;
}
.node.generated-attribute text{
  display:block!important;
  fill:var(--llm);
  font-weight:800;
  font-size:10.5px;
}
.node.generated-attribute.generated-wrong circle{
  stroke:var(--drop)!important;
  --node-stroke:3px!important;
}
.node.generated-attribute.generated-abstain circle{
  fill:var(--muted)!important;
  stroke:var(--panel)!important;
  opacity:.78;
}
.generated-tag{
  fill:var(--llm)!important;
  font:800 7.5px var(--mono)!important;
  letter-spacing:.08em;
  text-transform:uppercase;
  stroke:var(--panel)!important;
  stroke-width:2.5px!important;
}
.generated-link{
  stroke:var(--llm)!important;
  stroke-width:1.8!important;
  stroke-opacity:.82!important;
  stroke-dasharray:4 3;
}
.generated-link.wrong{
  stroke:var(--drop)!important;
}
.generated-link.abstain{
  stroke:var(--muted)!important;
  stroke-opacity:.55!important;
}

/* Generate attributes: explicit Player -> Position relation */
.generated-edge-label{
  fill:var(--llm);
  font:800 8px var(--mono);
  letter-spacing:.02em;
  text-anchor:middle;
  paint-order:stroke;
  stroke:var(--panel);
  stroke-width:3px;
  stroke-linejoin:round;
  pointer-events:none;
}
.generated-edge-label.wrong{fill:var(--drop)}
.generated-edge-label.abstain{fill:var(--muted)}

.node.context.type-Athlete text{
  display:block;
  font-weight:800;
  font-size:10.5px;
}

/* Position is visibly a separate generated value node. */
.node.generated-attribute circle{
  fill:var(--llm)!important;
}

/* ----------------------------------------------------------------
   Ground entities
   Start with all country nodes. Generated candidates are always orange.
   Passing candidates ground to existing country nodes through SIMJOIN.
   ---------------------------------------------------------------- */
.node.generated-candidate circle{
  fill:var(--llm)!important;
  stroke:color-mix(in srgb,var(--llm) 58%,white 42%)!important;
  --node-stroke:2.2px!important;
  filter:drop-shadow(0 0 7px color-mix(in srgb,var(--llm) 42%,transparent))!important;
}
.node.generated-candidate text{
  display:block!important;
  fill:var(--llm);
  font-size:10.5px;
  font-weight:800;
}
.node.generated-candidate.candidate-dropped circle{
  stroke:var(--drop)!important;
  --node-stroke:2.5px!important;
}
.node.grounded-target circle{
  stroke:var(--kg-strong)!important;
  --node-stroke:3.5px!important;
  filter:drop-shadow(0 0 9px color-mix(in srgb,var(--kg) 50%,transparent))!important;
}
.grounding-link{
  stroke:var(--kg)!important;
  stroke-width:2!important;
  stroke-opacity:.88!important;
  stroke-dasharray:5 3;
}

.similarity-box rect{
  fill:color-mix(in srgb,var(--panel) 94%,transparent);
  stroke:var(--line-strong);
  stroke-width:1;
  filter:drop-shadow(0 3px 5px rgba(20,30,38,.12));
}
.similarity-box.pass rect{
  stroke:var(--kg);
  fill:color-mix(in srgb,var(--kg-soft) 72%,var(--panel));
}
.similarity-box.fail rect{
  stroke:var(--drop);
  fill:color-mix(in srgb,var(--drop-soft) 68%,var(--panel));
}
.similarity-box-title{
  fill:var(--muted)!important;
  font:700 6.8px var(--mono)!important;
  letter-spacing:.03em;
  text-transform:uppercase;
  stroke:none!important;
  paint-order:normal!important;
}
.similarity-box-score{
  fill:var(--ink)!important;
  font:800 9px var(--mono)!important;
  stroke:none!important;
  paint-order:normal!important;
}

/* Ground-entity candidates intentionally do NOT receive the GENERATED tag.
   Their orange node styling already communicates generation. */

/* ----------------------------------------------------------------
   Generate attributes
   Add Position as a new leaf on the existing KG rather than arranging
   Player / Position into rows.
   ---------------------------------------------------------------- */
.node.attribute-source circle{
  stroke:var(--kg-strong)!important;
  --node-stroke:2.2px!important;
}
.generated-link{
  stroke-dasharray:3 3;
}

/* Below-threshold best match: visible as a possibility, but not grounded. */
.potential-grounding-link{
  stroke:var(--llm)!important;
  stroke-width:1.2!important;
  stroke-opacity:.26!important;
  stroke-dasharray:2 5;
}

/* A country can be the best candidate target even when it does not pass θ. */
.node.potential-ground-target circle{
  stroke:color-mix(in srgb,var(--llm) 42%,var(--line-strong));
}

/* Formal grounding remains visually stronger than a potential best match. */
.node.grounded-target circle{
  stroke:var(--kg-strong)!important;
  --node-stroke:3.5px!important;
}

/* ================================================================
   Soft-borderless UI pass
   Major rectangular controls/cards are separated by light, shadow,
   and spacing instead of straight outline borders.
   ================================================================ */

.code-shell,.theta-wrap,.db-picker,.top-control,.graph-controls button,.field input,.field select,.graph-help,.tooltip{
  box-shadow:
    none;
}

.mode-switch {
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--muted) 10%,transparent);
}

.mode-option {
  border-right:0!important;
}
.mode-option + .mode-option {
  box-shadow:inset 1px 0 0 color-mix(in srgb,var(--muted) 10%,transparent);
}

/* ================================================================
   Run state labels belong beside the run controls.
   ================================================================ */
.run-action-cluster {
  display:flex;
  align-items:center;
  gap:9px;
}

.run-state {
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:4px 9px;
  background:color-mix(in srgb,var(--code) 82%,transparent);
  color:var(--muted);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb,var(--muted) 8%,transparent);
  font:700 11px var(--sans);
  white-space:nowrap;
}

.compose-buttons-row {
  display:flex;
  align-items:center;
  gap:10px;
}

.compose-buttons-row .compose-buttons {
  flex:1 1 auto;
}

.compose-state {
  flex:0 0 auto;
  align-self:center;
}

/* Keep buttons visually strong without outline borders. */
.run-btn {
  border:0!important;
}
.genop-first-btn {
  border:0!important;
  box-shadow:
    inset 3px 0 0 var(--llm);
}
.planner-btn {
  border:0!important;
  box-shadow:
    inset 3px 0 0 var(--kg);
}

@media(max-width:640px){

  .compose-buttons-row{
    align-items:stretch;
    flex-direction:column;
  }
  .compose-state{
    align-self:flex-start;
  }
}

/* ===============================================================
   Final no-straight-border pass
   =============================================================== */

.topbar-brand{
  gap:12px;
}

.run-btn,.strategy-btn{
  border:0!important;
}

.mode-switch{
  border:0!important;
  box-shadow:none!important;
  gap:2px;
  background:transparent;
}
.mode-option,
.mode-option + .mode-option{
  border:0!important;
  box-shadow:none!important;
}
.mode-option{
  background:color-mix(in srgb,var(--code) 82%,transparent);
}
.mode-option.active-base{
  background:var(--llm-soft);
  box-shadow:none!important;
}
.mode-option.active-context{
  background:var(--kg-soft);
  box-shadow:none!important;
}

.privacy{
  border:0!important;
  box-shadow:none!important;
}

/* No rectangular stroke around similarity score boxes. */
.similarity-box rect,
.similarity-box.pass rect,
.similarity-box.fail rect{
  stroke:none!important;
}

/* Result cards keep depth, but lose straight accent bars. */
.execution-result,
.execution-result.genop-first,
.execution-result.planner,
.attribute-result{
  border:0!important;
  box-shadow:
    none!important;
}

/* Strategy buttons use a colored glow instead of a straight inset stripe. */
.genop-first-btn{
  box-shadow:
    none!important;
}
.planner-btn{
  box-shadow:
    none!important;
}

/* Execution-state labels are plain inline text, not badges. */
.execution-state.run-state,
#runModeDefault{
  min-height:0!important;
  padding:0!important;
  margin:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  color:var(--muted)!important;
  font:700 11px/1 var(--sans)!important;
  text-transform:lowercase;
}

/* Relevant-only result views can afford stronger labels/nodes. */
.node.generated-candidate circle{
  --node-stroke:2.6px!important;
}
.node.generated-candidate text,
.node.generated-attribute text,
.node.context.type-Athlete text{
  font-size:11px!important;
}
.grounding-link{
  stroke-width:2.2!important;
}
.generated-link{
  stroke-width:2!important;
}

/* Similarity score is visually separate from the label and has no outline. */
.similarity-box rect,
.similarity-box.pass rect,
.similarity-box.fail rect{
  stroke:none!important;
  stroke-width:0!important;
  outline:none!important;
  filter:drop-shadow(0 4px 7px rgba(20,30,38,.10));
}
.similarity-box.pass rect{
  fill:color-mix(in srgb,var(--kg-soft) 72%,var(--panel));
}
.similarity-box.fail rect{
  fill:color-mix(in srgb,var(--drop-soft) 68%,var(--panel));
}

/* Keep candidate labels on the right side of the node;
   similarity boxes are placed on the left in JS. */
.node.generated-candidate > text:not(.generated-tag){
  transform:translateX(2px);
}

/* Grounding similarity box: no border, no outline, compact text. */
.similarity-box rect,
.similarity-box.pass rect,
.similarity-box.fail rect{
  stroke:none!important;
  stroke-width:0!important;
  outline:none!important;
}
.similarity-box-title{
  font-size:6.5px!important;
  letter-spacing:.015em!important;
}
.similarity-box-score{
  font-size:9px!important;
}

/* Two-ring grounding layout: slightly more breathing room. */
.node.generated-candidate > text:not(.generated-tag){
  font-size:10.5px!important;
  font-weight:800;
}

/* Similarity boxes remain strictly borderless. */
.similarity-box rect,
.similarity-box.pass rect,
.similarity-box.fail rect{
  stroke:none!important;
  stroke-width:0!important;
  outline:none!important;
}

/* A little less visual density in the radial result than the previous pass. */
.grounding-link{
  stroke-width:2!important;
}
.potential-grounding-link{
  stroke-width:1.15!important;
  stroke-opacity:.24!important;
}

/* ===============================================================
   Query editor: shorter, inset / recessed surface
   =============================================================== */
.code-shell{
  overflow:hidden;
  border:0!important;
  background:
    var(--code)!important;
  box-shadow:
    none!important;
}

.code-top{
  height:27px!important;
  padding:0 12px!important;
  background:transparent!important;
  border:0!important;
  opacity:.82;
}

.query-code{
  min-height:142px!important;
  padding:10px 14px 12px!important;
  font-size:12.5px!important;
  line-height:1.52!important;
}

/* Keep the Query panel visually tighter around the shorter editor. */
.query-panel{
  padding-top:16px!important;
}
.mode-help{
  margin-bottom:9px!important;
}

/* Keep the large SVG from invalidating layout/paint outside its own panel. */
.graph-stage{
  contain:layout paint;
}

@media(max-width:560px){
  .query-code{
    min-height:132px!important;
    max-height:190px!important;
  }
}

/* Attribute result radial view is intentionally a little smaller than
   grounding so every Player + Position pair remains visible. */
.node.generated-attribute text{
  font-size:9.5px!important;
}
.node.attribute-source text{
  font-size:9.5px!important;
}
.node.generated-attribute circle{
  --node-stroke:2.1px!important;
}
.generated-edge-label{
  font-size:7.2px!important;
}

/* Attribute result keeps every Player/Position pair readable in the viewport. */
.node.generated-attribute text,
.node.attribute-source text{
  font-size:8.8px!important;
}
.generated-edge-label{
  font-size:6.7px!important;
}

/* ===============================================================
   Left-aligned fixed tabs + full-width yellow → blue rule
   =============================================================== */

/* ===============================================================
   User-supplied GenSPARQL icon in upper bar
   =============================================================== */
.topbar-brand-icon{
  width:34px;
  height:34px;
  object-fit:cover;
  flex:0 0 34px;
  display:block;
  filter:saturate(1.05) contrast(1.02);
  box-shadow:none;
}

.topbar-brand{
  gap:9px!important;
}

/* ===============================================================
   Expanded readable attribute result
   =============================================================== */
.node.attribute-source text{
  display:block!important;
  font-size:9.6px!important;
  font-weight:750!important;
}

.node.generated-attribute text{
  display:block!important;
  font-size:9.8px!important;
  font-weight:800!important;
}

.node.generated-attribute .generated-tag{
  font-size:7.4px!important;
  font-weight:850!important;
  letter-spacing:.04em;
}

.generated-edge-label{
  font-size:7.3px!important;
  font-weight:750!important;
}

@media(max-width:620px){
  
  
  .topbar-brand-icon{
    width:31px;
    height:31px;
    flex-basis:31px;
  }
}

/* ===============================================================
   Header / tabs color refinement — yellow → green → blue only
   =============================================================== */

/* Transparent icon asset: no square background, no card-like shadow. */
.topbar-brand-icon{
  object-fit:contain!important;
  background:transparent!important;
  box-shadow:none!important;
  filter:saturate(1.08) contrast(1.04)!important;
}

/* Keep the Compose strategy buttons grouped and left aligned. */
.compose-buttons-row{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:10px!important;
}

.compose-buttons-row .compose-buttons{
  flex:0 1 610px!important;
  width:min(610px, calc(100% - 100px))!important;
  min-width:0!important;
}

/* Keep default pre-recorded state neutral but within the same palette. */
#runModeDefault{
  color:#238B78!important;
}

@media(max-width:720px){
  .compose-buttons-row{
    align-items:flex-start!important;
    flex-wrap:wrap!important;
  }
  .compose-buttons-row .compose-buttons{
    width:100%!important;
    flex-basis:100%!important;
  }
}

/* ===============================================================
   Compose strategy controls
   =============================================================== */
.compose-buttons-row{
  justify-content:flex-start!important;
  align-items:center!important;
  gap:12px!important;
}

.compose-buttons-row .compose-buttons{
  flex:0 1 auto!important;
  width:auto!important;
  max-width:620px!important;
}

@media(max-width:760px){
  .compose-buttons-row{
    align-items:flex-start!important;
  }
}

/* ===============================================================
   Connected, lighter, borderless tabs
   =============================================================== */

/* ===============================================================
   Larger KG legend and graph annotations
   =============================================================== */
.graph-toolbar .section-label{
  font-size:15px!important;
  line-height:1.15!important;
}

.graph-status{
  margin-top:6px!important;
  font-size:12px!important;
  line-height:1.35!important;
}

.graph-help{
  font-size:11.5px!important;
  line-height:1.35!important;
  padding:6px 9px!important;
}

.legend{
  gap:18px!important;
  padding:13px 15px!important;
  font-size:12.5px!important;
  line-height:1.3!important;
}

.legend span{
  gap:7px!important;
}

.legend i{
  width:9px!important;
  height:9px!important;
}

.caption{
  font-size:13px!important;
}

/* Attribute result now has three evaluation metrics. */
.attribute-metrics{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}

.attribute-metric span{
  font-size:11px!important;
}

/* No GENERATED text is drawn on Position nodes. */
.node.generated-attribute .generated-tag{
  display:none!important;
}

@media(max-width:560px){
  .attribute-metrics{
    grid-template-columns:1fr!important;
  }
}

/* Requested interface cleanup */
.topbar-inner{
  min-height:66px;
  padding-block:12px;
}

/* Reliable Run visibility and compact Live fields */
.run-btn{
  background:var(--fill)!important;
  color:var(--on-fill)!important;
}
.execution-state.run-state,
#runModeDefault{
  font-family:var(--sans)!important;
  font-size:11px!important;
  line-height:1!important;
  font-weight:700!important;
}
.run-row[hidden]{
  display:none!important;
}

.embedding-settings .field input,
.embedding-settings .field select{
  width:100%;
  min-width:0;
}
.embedding-settings .field{
  min-width:0;
}

/* Round 2: matching section-title typography */
.query-panel .section-label,
.graph-toolbar .section-label{
  font-family:var(--sans)!important;
  font-size:15px!important;
  line-height:1.15!important;
  font-weight:700!important;
}

/* Compose + defer: full 35-node Defender result view. */
.node.composition-defender text{
  display:block!important;
  font-size:7.8px!important;
  font-weight:850!important;
}
.node.composition-defender circle{
  --node-stroke:2.4px!important;
}
.node.composition-source text{
  display:none!important;
}
.generated-edge-label.composition-generated-edge{
  display:none!important;
}

/* Round 3: Compose + defer keeps original labels and the 2-hop path to Group A. */
.node.composition-source text{
  display:block!important;
  font-size:6.8px!important;
  font-weight:760!important;
  letter-spacing:-.08px;
}
.node.composition-source circle{
  --node-stroke:1.8px!important;
}
.node.composition-team text{
  display:block!important;
  font-size:9.2px!important;
  font-weight:850!important;
}
.node.composition-team circle{
  fill:color-mix(in srgb,var(--kg) 72%,var(--llm) 28%)!important;
  --node-stroke:2.4px!important;
}
.node.composition-group text{
  display:block!important;
  font-size:10.5px!important;
  font-weight:900!important;
}
.node.composition-group circle{
  fill:color-mix(in srgb,var(--kg) 54%,var(--llm) 46%)!important;
  --node-stroke:3px!important;
  filter:drop-shadow(0 0 8px color-mix(in srgb,var(--kg) 35%,transparent))!important;
}
.link.composition-path-link{
  stroke:var(--kg)!important;
  stroke-width:1.15px!important;
  stroke-opacity:.34!important;
}

/* First query: all non-matched country nodes live in an unlinked peripheral ring. */
.node.outer-country{
  opacity:.58;
}
.node.outer-country circle{
  fill:color-mix(in srgb,var(--kg) 42%,var(--panel) 58%)!important;
  stroke:color-mix(in srgb,var(--kg) 32%,var(--line-strong) 68%)!important;
  --node-stroke:1.1px!important;
  filter:none!important;
}
.node.outer-country text{
  display:block!important;
  fill:var(--muted)!important;
  font-size:8.5px!important;
  font-weight:650!important;
}
.node.outer-country.inspect{
  opacity:1;
}

/* ===============================================================
   Upload KG + collapsible pre-recorded demo + Live free-query UI
   =============================================================== */
.kg-upload-input{display:none}
    .kg-upload-status{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.78rem;opacity:.72}

    .prerecorded-summary-copy{font-weight:500;opacity:.62;margin-left:auto}
    .live-query-block{margin:14px 0 18px}
    .live-query-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:7px}
    .live-query-head label{font-weight:700}
    .live-query-hint{font-size:.76rem;opacity:.62;text-align:right}
    .live-query-shell{border:1px solid color-mix(in srgb,currentColor 20%,transparent);border-radius:10px;overflow:hidden}
    .live-query-top{display:flex;align-items:center;justify-content:space-between;padding:7px 10px;font-size:.72rem;opacity:.7;border-bottom:1px solid color-mix(in srgb,currentColor 14%,transparent)}
    #liveQuery{display:block;width:100%;min-height:220px;resize:vertical;border:0;outline:0;padding:14px 16px;background:transparent;color:inherit;font:500 .82rem/1.55 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;box-sizing:border-box;tab-size:2}
    .live-query-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:9px}
    .live-query-result{margin-top:12px;border:1px solid color-mix(in srgb,currentColor 16%,transparent);border-radius:9px;overflow:auto;max-height:260px}
    .live-query-result[hidden]{display:none}
    .live-result-meta{padding:8px 10px;font-size:.76rem;opacity:.7;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent)}
    .live-result-table{width:100%;border-collapse:collapse;font:500 .76rem/1.35 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace}
    .live-result-table th,.live-result-table td{padding:7px 9px;text-align:left;white-space:nowrap;border-bottom:1px solid color-mix(in srgb,currentColor 10%,transparent)}
    .live-result-table tr:last-child td{border-bottom:0}
    .live-result-empty{padding:12px;font-size:.8rem;opacity:.7}
    @media (max-width:760px){.kg-upload-status{display:none}.live-query-head{align-items:flex-start;flex-direction:column}.live-query-hint{text-align:left}}

/* Keep the upload control aligned with the database selector. */
#uploadKgBtn{white-space:nowrap}
.kg-upload-status{align-self:center;color:var(--muted);font-family:var(--sans)}

/* Match the existing recessed query-editor language. */

.live-query-shell{
  border:0!important;
  border-radius:0!important;
  background:var(--code);
  box-shadow:none;
}
.live-query-top,.live-result-meta,.live-result-table th,.live-result-table td{border:0!important}
.live-query-result{border:0!important;border-radius:0!important;background:var(--panel);box-shadow:none}
.live-query-actions .top-control{background:var(--panel)!important;box-shadow:none!important;padding:0 11px!important;height:34px!important}

@media(max-width:760px){
  .topbar-controls{grid-template-columns:minmax(0,1fr) auto auto auto!important}
  .kg-upload-status{display:none!important}
}
@media(max-width:560px){
  .topbar-controls{grid-template-columns:1fr 1fr!important}
  .db-picker{grid-column:1/-1!important}
  #uploadKgBtn{grid-column:auto!important}
}

/* ===============================================================
   Live result placement: directly below the KG in the right column
   =============================================================== */

.live-query-result-panel{
  margin:0;
  padding:0;
  overflow:hidden!important;
  max-height:none!important;
  background:var(--panel);
}
.live-query-result-panel[hidden]{display:none!important}
.live-result-panel-head{
  min-height:62px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  box-shadow:inset 0 -1px 0 color-mix(in srgb,var(--muted) 10%,transparent);
}
.live-result-panel-head .section-label{font-size:15px!important}
.live-result-panel-head .live-result-meta{
  padding:0!important;
  margin-top:5px;
  color:var(--muted);
  font:11px/1.4 var(--sans);
  opacity:1;
}
.live-result-scope{
  max-width:260px;
  color:var(--muted);
  font:11px/1.45 var(--sans);
  text-align:right;
}
.live-result-scroll{
  max-height:330px;
  overflow:auto;
}
.live-query-result-panel .live-result-table th,
.live-query-result-panel .live-result-table td{
  padding:9px 12px;
  box-shadow:inset 0 -1px 0 color-mix(in srgb,var(--muted) 8%,transparent);
}
.live-query-result-panel .live-result-table th{
  position:sticky;
  top:0;
  z-index:1;
  background:var(--panel);
  color:var(--kg);
  font-weight:700;
}

/* ===============================================================
   Compose + defer: interactive physical-plan steps
   =============================================================== */
.execution-step{
  appearance:none;
  text-align:left;
  color:var(--ink);
  cursor:pointer;
  transition:transform .14s ease,box-shadow .14s ease,opacity .14s ease,background .14s ease;
}
.execution-step:hover{transform:translateY(-1px)}
.execution-step.is-complete{opacity:.68}
.execution-step.is-active{
  opacity:1;
  background:color-mix(in srgb,var(--kg-soft) 74%,var(--panel))!important;
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb,var(--kg) 44%,transparent)!important;
}
.execution-result.genop-first .execution-step.genop-step.is-active{
  background:color-mix(in srgb,var(--llm-soft) 80%,var(--panel))!important;
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb,var(--llm) 48%,transparent)!important;
}
.execution-step:focus-visible{
  outline:2px solid var(--kg);
  outline-offset:2px;
}

/* Dense binding snapshots deliberately suppress labels so 1,248 / 2,496
   SVG nodes remain legible and fast; hover still exposes the tooltip. */
.node.composition-source.composition-dense text,
.node.generated-attribute.composition-dense text{
  display:none!important;
}
.node.composition-source.composition-dense circle{
  fill:var(--kg)!important;
  --node-stroke:.7px!important;
  filter:none!important;
}
.node.generated-attribute.composition-pos-node circle{
  fill:var(--llm)!important;
}
.node.generated-attribute.composition-dense circle{
  --node-stroke:.6px!important;
  filter:none!important;
}

/* Planner survivors are the bindings that reach GENOP. */
.node.composition-survivor:not(.composition-dropped) circle{
  stroke:color-mix(in srgb,var(--kg) 62%,white 38%)!important;
}

/* FILTER keeps Defender bindings and visibly drops all other Group A rows. */
.node.composition-dropped{
  opacity:.12!important;
}
.node.composition-dropped circle{
  stroke:var(--drop)!important;
  --node-stroke:2px!important;
  filter:none!important;
}
.node.generated-attribute.composition-dropped circle{
  fill:color-mix(in srgb,var(--drop) 58%,var(--llm) 42%)!important;
}
.link.composition-drop-link{
  stroke:var(--drop)!important;
  stroke-opacity:.13!important;
  stroke-width:1px!important;
}

/* In intermediate Group-A GENOP stages, ?pos is a visible generated value. */
.node.generated-attribute.composition-pos-node:not(.composition-dense):not(.composition-dropped) text{
  display:block!important;
  font-size:8.2px!important;
  font-weight:850!important;
}

@media(max-width:920px){

  .live-result-scroll{max-height:280px}
}

/* ===============================================================
   Compose GENOP-first Step 1: compact athlete-binding cloud
   =============================================================== */
.node.composition-binding-cloud text{
  display:none!important;
}
.node.composition-binding-cloud circle{
  fill:var(--kg)!important;
  stroke:none!important;
  filter:none!important;
  opacity:.9;
}
.node.composition-binding-group circle{
  fill:color-mix(in srgb,var(--kg) 58%,var(--llm) 42%)!important;
  stroke:var(--panel)!important;
  --node-stroke:1.8px!important;
  filter:drop-shadow(0 0 5px color-mix(in srgb,var(--kg) 24%,transparent))!important;
}
.node.composition-binding-group text{
  display:block!important;
  font-size:9px!important;
  font-weight:900!important;
}
.link.composition-binding-link{
  stroke:color-mix(in srgb,var(--kg) 66%,var(--muted) 34%)!important;
  stroke-width:.32px!important;
  stroke-opacity:.13!important;
}

/* Compose GENOP Position values: small yellow dots with hover details. */
.node.generated-attribute.composition-pos-node text{display:none!important;}
.node.generated-attribute.composition-binding-pos circle{fill:var(--llm)!important;stroke:none!important;filter:none!important;opacity:.98!important;}
.link.generated-link.composition-binding-pos-link{stroke:var(--llm)!important;stroke-width:.28px!important;stroke-opacity:.30!important;stroke-dasharray:none!important;}

/* Compose generated Position nodes: interaction-only labels.
   No Position text is drawn in any Compose step; hover shows a tooltip and
   clicking a yellow dot pins that tooltip until the canvas is clicked. */
.node.generated-attribute.composition-pos-node text{
  display:none!important;
}
.node.generated-attribute.composition-pos-node{
  cursor:pointer;
}
.node.generated-attribute.composition-pos-node:hover circle,
.node.generated-attribute.composition-pos-node.inspect circle{
  stroke:color-mix(in srgb,var(--llm) 62%,white 38%)!important;
  --node-stroke:2px!important;
  filter:drop-shadow(0 0 7px color-mix(in srgb,var(--llm) 38%,transparent))!important;
}

/* ===============================================================
   Mode dot + matched query editor height
   =============================================================== */

.prerecorded-dot{
  width:8px;
  height:8px;
  flex:0 0 8px;
  border-radius:50%!important;
  background:var(--kg);
  box-shadow:0 0 0 3px var(--kg-soft);
}

/* Live Free Query uses the same default content height as Sample Query. */
#liveQuery{
  min-height:142px;
  max-height:560px;
  resize:vertical!important;
  padding:10px 14px 12px!important;
  line-height:1.52!important;
}
.live-query-top{
  height:27px!important;
  padding:0 12px!important;
}

/* API key belongs at the bottom of Live settings. */
.live-api-key-field{
  grid-column:1/-1!important;
  width:100%!important;
  max-width:220px!important;
  margin-top:2px;
}

@media(max-width:560px){
  #liveQuery{
    height:132px!important;
    min-height:132px!important;
    max-height:190px!important;
  }
}

/* ===============================================================
   Live demo tutorial, API key placement, sample-query picker
   =============================================================== */
.live-guide{
  width:100%;
  padding:12px 14px;
  background:color-mix(in srgb,var(--code) 82%,var(--kg-soft) 18%);
  box-shadow:none;
}
.live-guide-title{
  margin-bottom:9px;
  color:var(--ink);
  font-size:12.5px;
  font-weight:700;
}
.live-guide-steps{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px 13px;
}
.live-guide-steps span{
  display:flex;
  align-items:flex-start;
  gap:7px;
  color:var(--muted);
  font-size:11px;
  line-height:1.42;
}
.live-guide-steps b{
  flex:0 0 18px;
  width:18px;
  height:18px;
  display:grid;
  place-items:center;
  background:var(--kg-soft);
  color:var(--kg);
  font:700 11px var(--sans);
}
.live-guide-note{
  margin:9px 0 0;
  color:var(--muted);
  font:11px/1.45 var(--sans);
}

.live-query-actions{
  display:flex!important;
  align-items:center!important;
  flex-wrap:wrap!important;
  gap:8px!important;
}
.sample-query-select{
  min-height:36px;
  max-width:245px;
  padding:7px 9px;
  border:0!important;
  background:var(--code);
  color:var(--ink);
  box-shadow:none;
  font:700 11px var(--sans);
}

/* ===============================================================
   Dense Live-query result layout
   Large result sets use tiny dots and compact fixed coordinates so the
   relevant subgraph fits inside the KG viewport instead of leaving large gaps.
   =============================================================== */
.node.live-dense-result text{
  display:none!important;
}
.node.live-dense-result circle,
.node.live-dense-result.query-result circle{
  --node-stroke:.55px!important;
  filter:none!important;
}
.node.live-dense-context text,
.node.live-dense-context.context text{
  display:block!important;
  font-size:7.8px!important;
  font-weight:800!important;
}
.node.live-dense-context circle,
.node.live-dense-context.context circle{
  --node-stroke:1.15px!important;
  filter:none!important;
}
.node.live-dense-result.inspect circle{
  stroke:var(--llm)!important;
  --node-stroke:1.4px!important;
}

@media(max-width:560px){
  .live-guide-steps{grid-template-columns:1fr}
  .sample-query-select{width:100%;max-width:none}
}

/* ===============================================================
   Live Free Query — result-centric 0/1/2-hop KG view
   Only result entities plus up to two structural neighbour levels are
   rendered. Result dots are uniform within a view; context gets smaller and
   progressively more transparent with hop distance.
   =============================================================== */
.node.live-query-result-node,
.node.live-query-result-node.query-result{
  opacity:1!important;
}
.node.live-query-result-node circle,
.node.live-query-result-node.query-result circle{
  fill:var(--kg)!important;
  stroke:color-mix(in srgb,var(--kg) 52%,var(--panel) 48%)!important;
  --node-stroke:.8px!important;
  filter:none!important;
}
.node.live-query-result-node text{
  display:none!important;
}
.node.live-query-result-node.live-show-label text,
.node.live-query-result-node.inspect text{
  display:block!important;
  font-weight:800!important;
}

.node.live-context-1,
.node.live-context-1.context{
  opacity:.48!important;
}
.node.live-context-2,
.node.live-context-2.context{
  opacity:.34!important;
}
.node.live-context-1 circle,
.node.live-context-1.context circle,
.node.live-context-2 circle,
.node.live-context-2.context circle{
  fill:var(--context)!important;
  stroke:none!important;
  filter:none!important;
}
.node.live-context-1 text,
.node.live-context-2 text{
  display:none!important;
}
.node.live-context-1.live-show-label text,
.node.live-context-2.live-show-label text,
.node.live-context-1.inspect text,
.node.live-context-2.inspect text{
  display:block!important;
  fill:color-mix(in srgb,var(--muted) 88%,var(--panel))!important;
  font-weight:800!important;
}
.node.live-context-2.live-show-label text,
.node.live-context-2.inspect text{
  font-weight:900!important;
}

.link.live-result-link{
  stroke:var(--kg)!important;
  stroke-width:.85px!important;
  stroke-opacity:.32!important;
}
.link.live-context-link-1{
  stroke:var(--context)!important;
  stroke-width:.75px!important;
  stroke-opacity:.22!important;
}
.link.live-context-link-2{
  stroke:var(--context)!important;
  stroke-width:.65px!important;
  stroke-opacity:.14!important;
}

/* Selection remains easy to see even when the base dot is tiny. */
.node.live-query-result-node.inspect circle,
.node.live-context-1.inspect circle,
.node.live-context-2.inspect circle{
  stroke:var(--llm)!important;
  --node-stroke:1.6px!important;
  opacity:1!important;
}

/* Live GENOP generated value nodes. A generated value is also a result node, whose teal rule
   above is more specific, so this rule names both classes to keep the orange of the legend. It
   has no glow, as the result nodes: a glow grows with the zoom of the fit. */
.node.live-generated-pos circle,
.node.live-generated-pos.live-query-result-node.query-result circle{
  fill:var(--llm)!important;
  stroke:color-mix(in srgb,var(--llm) 58%,white 42%)!important;
  --node-stroke:1.3px!important;
  filter:none!important;
}
.node.live-generated-pos text{display:none!important}
.node.live-generated-pos.inspect circle{stroke:var(--drop)!important;--node-stroke:2px!important}
.live-run-feedback{
  min-height:18px;
  margin-top:7px;
  font:11px/1.4 var(--sans);
  color:var(--muted);
}
.live-run-feedback.ok{color:var(--kg)}
.live-run-feedback.err{color:var(--drop)}
.live-run-feedback.warn{color:var(--llm)}

/* Java GenSPARQL engine integration */
.engine-settings{
  grid-column:1/-1;
  border:1px solid var(--line-strong);
  background:var(--panel);
  padding:12px;
  display:grid;
  gap:10px;
}

.engine-settings-copy{
  margin-top:3px;
  font:11px/1.45 var(--sans);
  color:var(--muted);
}

.engine-connection-status{
  min-height:20px;
  padding:6px 8px;
  border-left:2px solid var(--line-strong);
  background:var(--code);
  color:var(--muted);
  font:11px/1.45 var(--sans);
  overflow-wrap:anywhere;
}
.engine-connection-status.ok{
  border-left-color:var(--kg);
  color:var(--kg);
  background:var(--kg-soft);
}
.engine-connection-status.err{
  border-left-color:var(--drop);
  color:var(--drop);
  background:var(--drop-soft);
}
.engine-settings input:disabled,
.engine-settings select:disabled{
  opacity:.55;
  cursor:not-allowed;
}

/* ===============================================================
   Live controls layout refinement
   - keep Execution backend controls inside the card
   - place Test engine below the backend fields
   - sample query + Load sample on one row
   - Run query + Clear on one row
   =============================================================== */
.engine-settings,
.engine-settings *{
  box-sizing:border-box;
}
.engine-settings{
  width:100%;
  min-width:0;
  max-width:100%;
  overflow:hidden;
}

.engine-settings-actions{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:9px;
  width:100%;
  min-width:0;
}
.engine-settings-actions #testEngineBtn{
  flex:0 0 auto;
}
.engine-settings-actions .engine-connection-status{
  flex:1 1 auto;
  min-width:0;
}

.live-query-actions{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:8px!important;
  width:100%;
  min-width:0;
}
.live-query-action-row{
  display:flex;
  align-items:center;
  gap:8px;
  width:100%;
  min-width:0;
}
.live-query-load-row .sample-query-select{
  flex:1 1 auto;
  min-width:0;
  width:auto;
}
.live-query-run-row #liveRunBtn,
.live-query-run-row #clearLiveQuery{
  flex:0 0 auto;
  white-space:nowrap;
}

@media(max-width:560px){

  .live-query-action-row{
    width:100%;
  }
  .live-query-load-row .sample-query-select{
    flex:1 1 0;
  }
}

@media(max-width:560px){
  .engine-settings-actions{align-items:stretch;flex-direction:column}
  .graph-help{right:8px;left:8px!important;white-space:normal}
}

/* ?print: the graph panel as a figure of a two-column paper. The panel is about 500 px wide
   and printed at about 241 pt, so text needs about 17 px to print at 8 pt or more. */
html[data-print] .graph-controls,
html[data-print] .graph-help{display:none!important}
html[data-print] #kgGraph .outer-country{display:none!important}
html[data-print] #kgGraph text{font-size:20px!important}
html[data-print] .graph-stage{height:250px!important}
html[data-print] .graph-status,
html[data-print] .legend,
html[data-print] #graphTitle{font-size:18px!important}
html[data-print] .graph-status{white-space:normal!important;line-height:1.3}

/* The recorded mode hides the live panel, so the threshold row carries the choice of similarity. */
.theta-similarity{display:flex;flex-wrap:wrap;align-items:center;gap:6px 14px;margin-top:8px;font-size:11px;color:var(--muted)}
.theta-similarity>span{font-weight:700;font-size:11px}
.theta-similarity label{display:inline-flex;align-items:center;gap:5px;cursor:pointer;color:var(--ink)}

/* Obsidian-style focus (app.js applyClasses, outside ?print): hovering a node keeps it and its
   neighbours bright and dims the rest; the labels follow the zoom in large graphs. */
#kgGraph .node{transition:opacity .18s ease}
#kgGraph .link{transition:stroke-opacity .18s ease,opacity .18s ease}
#kgGraph .node.dimmed{opacity:.14}
#kgGraph .link.dimmed{opacity:.1}
#kgGraph .generated-edge-label{transition:opacity .18s ease}
#kgGraph .generated-edge-label.dimmed{opacity:.14}
#kgGraph .link.focus-link{stroke-opacity:.95;stroke-width:1.6}
#kgGraph .node.label-focus text:not(.leaf-label){display:block}
#kgGraph .node text{transition:opacity .2s ease}
#kgGraph.large .node text{font-size:calc(9.5px / var(--k,1));stroke-width:calc(3px / var(--k,1))}
#kgGraph.large .node.query-result text,#kgGraph.large .node.inspect text{font-size:calc(11px / var(--k,1))}
#kgGraph .node .leaf-label{display:none;font-size:calc(9.5px / var(--k,1));stroke-width:calc(3px / var(--k,1))}
#kgGraph .node .leaf-label.shown,#kgGraph .node.inspect .leaf-label{display:block}
#kgGraph .node:not(.inspect) text.occluded{display:none}
#kgGraph.zoom-near .node.type-Athlete text:not(.leaf-label){display:block}
#kgGraph.zoom-far .node:not(.inspect):not(.label-focus):not(.query-result):not(.type-Team):not(.type-Group):not(.type-NobelPrize):not(.type-NobelField) text{opacity:0}
.graph-controls button[aria-pressed="true"]{background:var(--kg-soft);border-color:var(--kg);color:var(--kg)}
.theta-similarity label.is-disabled{color:var(--muted);cursor:not-allowed;opacity:.6}
.theta-similarity-note{flex-basis:100%;font-size:11px;color:var(--muted)}
#kgGraph .generated-edge-label.grounding-score-label{fill:var(--kg-strong)}
.attribute-row.attribute-head{position:sticky;top:0;z-index:1;background:var(--panel);padding-top:7px;padding-bottom:7px;font:600 11px/1.25 var(--sans);color:var(--muted)}

/* A label that finds no free place (declutterLabels in app.js) appears when its node is hovered. */
#kgGraph .node:not(.inspect) > text.declutter-hidden,
#kgGraph .generated-edge-label.declutter-hidden{display:none!important}

/* Many pairs at a low θ: the pairs beyond the closest entity of each name stay in the background. */
#kgGraph.crowded-pairs .grounding-link.additional-pair{stroke-width:.6px!important;stroke-opacity:.18!important;stroke-dasharray:none!important}

/* ===============================================================
   Workbench layout: a dark header with the title, one toolbar with the
   settings, a status line and the scenario tabs, then the graph with the
   query and the details of a selection beside it. The interface uses one
   sans-serif face; the monospace face is kept for code and identifiers.
   =============================================================== */
/* The page: a teal light at the top left, an amber light at the top right and a faint teal one
   at the bottom, over a diagonal wash of the two, in the colours of the theme. */
body{
  background:
    radial-gradient(circle at 10% 0%,color-mix(in srgb,var(--kg) 24%,transparent),transparent 38%),
    radial-gradient(circle at 90% 12%,color-mix(in srgb,var(--llm) 19%,transparent),transparent 35%),
    radial-gradient(circle at 52% 96%,color-mix(in srgb,var(--kg) 10%,transparent),transparent 42%),
    linear-gradient(135deg,color-mix(in srgb,var(--paper) 86%,var(--kg-soft) 14%),var(--paper) 46%,
      color-mix(in srgb,var(--paper) 84%,var(--llm-soft) 16%));
  background-attachment:fixed;
}
html[data-print] body{background:var(--paper)}
.topbar-inner,.wrap{width:calc(100% - 48px);max-width:1760px;padding-inline:0}

/* Header: the name of the page and the two links that are not settings. */
.topbar{position:sticky;top:0;z-index:100;color:var(--header-ink);background:var(--header);border-bottom:1px solid var(--header-line)}
.topbar-inner{min-height:64px;padding-block:10px;gap:16px}
.topbar-brand{gap:12px;min-width:0}
.topbar-brand-icon{width:34px;height:34px;flex:0 0 34px}
.brand-text{display:flex;flex-direction:column;gap:3px;min-width:0}
.brand-title{margin:0;color:var(--header-ink);font-size:21px;font-weight:700;line-height:1.15}
/* The wordmark, from yellow through green to blue. */
.brand-wordmark{
  background:linear-gradient(92deg,#F6C744 0%,#E7C53D 22%,#35AD87 55%,#248DB8 100%);
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent;
}
.brand-tagline{margin:0;color:var(--header-muted);font-size:13px;line-height:1.35}
.topbar-controls{align-items:center;gap:8px}
.topbar .top-control{height:32px;color:var(--header-ink);background:transparent;border:1px solid var(--header-line);font-weight:600}
.topbar .top-control:hover{background:rgba(255,255,255,.08)}
/* The mark of GitHub (Octicons, MIT license) in the colour of the text of the button. */
.top-control-icon{width:16px;height:16px;flex:0 0 16px;margin-right:7px;fill:currentColor}

/* Toolbar: the data and the settings of every view, each with its label above it. */
.wrap{padding-top:16px;padding-bottom:32px}
.toolbar{margin:0 0 10px;padding:12px 16px;border:1px solid var(--line);background:var(--panel);box-shadow:var(--panel-shadow)}
.primary-settings{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 32px}
.control-group{display:flex;flex-direction:column;gap:6px;min-width:0;margin:0;padding:0;border:0}
.control-label,.similarity-control legend,.theta-row label{padding:0;color:var(--muted);font-size:12px;font-weight:600;line-height:1.2}
.database-row{display:flex;align-items:center;gap:8px}
.toolbar .db-picker{height:34px;padding:0 6px 0 4px;border:1px solid var(--line-strong);background:var(--panel)}
.toolbar .db-picker select{min-width:170px;height:32px;border:0;background:transparent;color:var(--ink);font-size:13px;font-weight:600}
.toolbar .database-row .top-control{height:34px;font-size:13px;font-weight:600}
.kg-upload-status{color:var(--muted);font-size:12px;white-space:nowrap}
.kg-upload-status:empty{display:none}
.page-mode-switch{display:inline-flex;gap:2px;width:max-content;padding:2px;border:1px solid var(--line-strong);background:var(--code)}
.page-mode-option{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:84px;height:28px;padding:0 12px;border:1px solid transparent;color:var(--muted);font-size:13px;font-weight:600;text-decoration:none;white-space:nowrap}
.page-mode-option:hover{color:var(--ink)}
.page-mode-option[aria-current="page"]{cursor:default;border-color:var(--line-strong);background:var(--panel)}
#demoModeLink[aria-current="page"]{color:var(--kg-strong)}
#liveModeLink[aria-current="page"]{color:var(--drop)}
.page-mode-option:not([aria-current="page"]) .prerecorded-dot,
.page-mode-option:not([aria-current="page"]) .live-dot{opacity:.55}
.page-mode-option .live-dot,.page-mode-option .prerecorded-dot{box-shadow:none}
.threshold-control{flex:0 1 300px;width:300px}
.theta-row{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.theta-row output{color:var(--kg-strong);font-size:13px;font-weight:700;font-variant-numeric:tabular-nums}
.threshold-control input{display:block;width:100%;height:20px;margin:7px 0;cursor:pointer;accent-color:var(--kg)}
.threshold-control.inactive{opacity:.45}
.threshold-control.inactive input{cursor:default}
/* A floated legend is laid out as an ordinary child, so it lines up with the other labels. */
.similarity-control legend{float:left;width:100%}
.similarity-options{display:flex;gap:4px}
.similarity-options label{position:relative;display:flex;cursor:pointer}
.similarity-options input{position:absolute;width:1px;height:1px;opacity:0}
.similarity-options span{display:flex;align-items:center;justify-content:center;min-width:92px;height:34px;padding:0 12px;border:1px solid var(--line-strong);color:var(--muted);background:var(--panel);font-size:13px;font-weight:600}
.similarity-options input:checked+span{color:var(--on-fill);background:var(--fill);border-color:var(--fill)}
.similarity-options input:focus-visible+span{outline:2px solid var(--kg);outline-offset:2px}
.similarity-options label.is-disabled{opacity:.4;cursor:not-allowed}
.theta-similarity-note{display:block;margin-top:2px;color:var(--muted);font-size:12px}
.theta-similarity-note[hidden]{display:none!important}

/* Live: the engine and the models fold away under the toolbar. */
.connection-settings{margin-top:12px;padding-top:10px;border-top:1px solid var(--line)}
.connection-settings>summary{width:100%;cursor:pointer;color:var(--kg-strong);font-size:13px;font-weight:600}
.connection-settings>summary span{margin-left:10px;color:var(--muted);font-size:12px;font-weight:400}
.connection-panel>.engine-settings{margin-top:12px}
/* Open, the settings lie over the workspace, so the graph keeps its size; a click elsewhere or
   Escape closes them (app.js). */
.connection-settings{position:relative}
.connection-settings[open]>.connection-panel{position:absolute;z-index:30;top:calc(100% + 8px);left:-17px;right:-17px;
  padding:4px 16px 16px;border:1px solid var(--line-strong);background:var(--panel);box-shadow:0 14px 32px rgba(20,30,38,.18)}
.toolbar .engine-settings{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px;width:auto;padding:0;border:0;background:transparent;overflow:visible}
.toolbar .engine-settings>.field{flex:1 1 360px;min-width:0}
.toolbar .engine-settings-actions{display:flex;gap:8px}
.toolbar #engineBase{flex:1 1 auto;min-width:0;width:auto}
.toolbar #testEngineBtn{height:35px}
.toolbar .engine-connection-status{flex:1 1 220px;min-height:35px;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.connection-settings .live-settings{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 14px;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.toolbar .live-settings>.field{flex:0 1 230px;min-width:150px}
.toolbar .live-settings>.field>input{width:100%}
.toolbar .grounding-method[hidden]{display:none!important}
.toolbar .embedding-settings{flex:1 1 480px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;max-width:none;margin:0;padding:0;border:0}
.toolbar .embedding-settings.is-disabled{display:none}
.field label{font-size:12px;font-weight:600}
.field input,.field select{font-size:13px}

/* Status line: what the view shows and where its answers come from. */
.status-line{display:flex;flex-direction:column;gap:4px;margin:0 0 12px}
.status-line .caption{margin:0;padding:0;border:0;color:var(--muted);font-size:13px;line-height:1.5}
.status-line .caption:empty{display:none}
.status-line .privacy{margin:0;padding:0;border:0;background:transparent;color:var(--muted);font-size:13px}

/* Scenario tabs: they change the graph and the query, so they sit above both. */
.tabs{display:flex;gap:4px;width:max-content;max-width:100%;margin:0 0 12px;padding:3px;border:1px solid var(--line);background:var(--panel)}
.tabs .tab{height:32px;padding:0 16px;border:1px solid transparent;color:var(--muted);background:transparent;font-size:13px;font-weight:600;white-space:nowrap}
.tabs .tab:hover{color:var(--ink)}
.tabs .tab[aria-selected="true"]{color:var(--on-fill);background:var(--fill);border-color:var(--fill)}
.tabs .tab:focus-visible{outline:2px solid var(--kg);outline-offset:2px}

/* The graph takes the width and sets the height of the row; the column beside it scrolls
   within that height, as the map and the context panel of the T-MIGRANTS explorer do. */
.workspace{display:grid;grid-template-columns:minmax(0,1fr) clamp(340px,calc(27vw / var(--page-zoom)),430px);gap:16px;align-items:stretch}
.graph-column,.query-column{min-width:0;display:flex;flex-direction:column;gap:12px}
.query-column{contain:size;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
.query-column>.panel,.query-column>.attribute-result,.graph-column>.execution-result{flex:0 0 auto;margin:0}
.query-column>.info-panel{flex:1 1 160px;min-height:160px;display:flex;flex-direction:column}
.panel{border:1px solid var(--line);background:var(--panel);box-shadow:var(--panel-shadow)}

/* Graph panel: title and status on the left, the legend of the similarity on the right. */
.graph-panel{padding:0;overflow:hidden}
.graph-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:60px;padding:12px 16px;border-bottom:1px solid var(--line)}
.graph-heading{min-width:0}
#graphTitle{font-size:15px;font-weight:700}
.graph-status{margin-top:3px;color:var(--muted);font-size:12px;line-height:1.45}
.graph-stage{height:clamp(460px,calc(100vh / var(--page-zoom) - 300px),820px);min-height:0;background:var(--panel)}
.graph-stage .graph-controls{position:absolute;top:12px;right:12px;z-index:4;display:flex;gap:4px}
.graph-controls button{height:30px;min-width:30px;padding:0 9px;border:1px solid var(--line-strong);color:var(--ink);background:var(--panel);font-size:12px;font-weight:600;white-space:nowrap}
.graph-controls button[aria-pressed="true"]{color:var(--kg-strong);background:var(--kg-soft);border-color:var(--kg)}
.graph-stage .graph-legend{position:absolute;z-index:4;left:12px;top:12px;display:flex;flex-direction:column;align-items:flex-start;gap:7px;padding:10px 12px;border:1px solid var(--line);background:color-mix(in srgb,var(--panel) 92%,transparent);color:var(--muted);font-size:12px;pointer-events:none}
.graph-legend:before{content:"Legend";margin-bottom:1px;color:var(--ink);font-size:12px;font-weight:600}
.graph-help{left:12px;bottom:12px;max-width:calc(100% - 24px);padding:4px 8px;border:1px solid var(--line);font-size:12px}
.header-legend{display:flex;align-items:center;gap:7px;flex:0 0 auto;color:var(--muted);font-size:12px;white-space:nowrap}
.header-legend[hidden]{display:none}
.score-ramp{position:relative;width:132px;height:8px;border:1px solid var(--line-strong);
  background:linear-gradient(90deg,var(--score-low) 0,color-mix(in srgb,var(--score-low) 25%,var(--score-mid)) var(--theta),
    color-mix(in srgb,var(--score-high) 25%,var(--score-mid)) var(--theta),var(--score-high) 100%)}
.score-ramp::after{content:"";position:absolute;left:var(--theta);top:-4px;bottom:-4px;width:2px;margin-left:-1px;background:var(--ink)}
.score-legend-theta{color:var(--ink);font-weight:600;font-variant-numeric:tabular-nums}

/* Tooltip: the last line says what a click does. */
.tooltip{max-width:280px;padding:8px 10px;border:1px solid var(--line-strong);background:var(--panel);box-shadow:0 6px 18px rgba(20,30,38,.14);font-size:12px;line-height:1.45}
.tooltip .tooltip-action{margin-top:5px;padding-top:5px;border-top:1px solid var(--line);color:var(--llm);font-weight:600}

/* Compose + defer: the steps can be played one after the other. */
.execution-result{border:1px solid var(--line);background:var(--panel);box-shadow:var(--panel-shadow)}
.execution-result-head{gap:12px}
.execution-actions{display:flex;align-items:center;gap:8px}
.playback-btn{height:28px;padding:0 10px;border:1px solid var(--line-strong);color:var(--kg-strong);background:var(--panel);font-size:12px;font-weight:600;white-space:nowrap}
.playback-btn[aria-pressed="true"]{color:var(--on-fill);background:var(--fill);border-color:var(--fill)}
.playback-track{height:3px;margin:0 16px 2px;background:var(--line)}
.playback-track>span{display:block;width:0;height:100%;background:var(--kg-strong);transition:width .3s ease}
.execution-result.genop-first .playback-track>span{background:var(--llm)}

/* Query column. */
.query-column .query-panel{padding:16px}
.query-column .panel-heading{padding-bottom:9px;margin-bottom:10px}
.query-column .mode-help{margin-bottom:10px;font-size:12px}
.query-column .query-code{min-height:150px;max-height:none;padding:12px;font:12px/1.7 var(--mono)}
.query-column .run-row{margin-top:12px}
.section-label{font-size:15px;font-weight:700}
.live-query-panel{padding:16px}
.live-query-panel .live-query-block{margin:0}
.live-query-panel .live-query-head{margin-bottom:8px}
/* The editor grows with the query up to this height (fitEditor in app.js) and scrolls beyond it. */
.query-column #liveQuery{font-size:12px;max-height:300px;min-height:180px}
.query-column .sample-query-select{min-width:0;width:100%;max-width:none;font-size:12px}
.live-run-feedback .retry-btn,.engine-connection-status .retry-btn{height:26px;margin-left:8px;padding:0 9px;border:1px solid currentColor;color:inherit;background:transparent;font-size:12px;font-weight:600}
/* The results of live mode stand in the column, under the query. */
.query-column>.live-query-result-panel{flex:0 0 auto;margin:0}

/* Info: the details of a selection, or the settings of the view while nothing is selected. */
.info-panel{min-height:0;padding:0;overflow:hidden}
.info-panel-head{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--line)}
.info-panel-head>div{display:flex;align-items:baseline;gap:10px}
.info-panel-head h2{margin:0;font-size:15px;font-weight:700}
#infoKind{color:var(--muted);font-size:12px}
.info-clear{width:26px;height:26px;border:1px solid var(--line);background:var(--panel);color:var(--muted);font-size:17px;line-height:1;cursor:pointer}
.info-clear[hidden]{display:none!important}
.info-content{flex:1 1 auto;min-height:0;padding:14px 16px 16px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}
.info-title{margin:0 0 6px;font-size:17px;line-height:1.35;font-weight:700;overflow-wrap:anywhere}
.info-description{margin:0 0 12px;color:var(--muted);font-size:12px;line-height:1.55}
.info-footnote{margin:14px 0 0;color:var(--muted);font-size:12px;line-height:1.55}
.info-caution{margin:12px 0 0;padding-left:10px;border-left:2px solid var(--line-strong);color:var(--muted);font-size:12px;line-height:1.55}
.info-citation{margin:8px 0 0;color:var(--muted);font-size:12px;font-style:italic;line-height:1.5}
.info-stats{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:8px 0 12px;padding:10px 0;border-block:1px solid var(--line)}
.info-stats>div{display:flex;flex-direction:column;gap:2px}
.info-stats strong{color:var(--ink);font-size:20px;font-weight:700;font-variant-numeric:tabular-nums}
.info-stats span{color:var(--muted);font-size:12px}
.info-fields{margin:0}
.info-field{display:grid;grid-template-columns:96px minmax(0,1fr);align-items:baseline;gap:10px;padding:5px 0;font-size:12px;line-height:1.5}
.info-field dt{color:var(--muted)}
.info-field dd{margin:0;min-width:0;overflow-wrap:anywhere}
.info-field code{font:11px/1.5 var(--mono)}
.info-selection-heading{margin-bottom:10px}
.info-selection-heading .info-title{margin-top:8px}
.info-badge{display:inline-block;padding:1px 6px;border:1px solid var(--line);color:var(--kg-strong);background:var(--kg-soft);font-size:11px;font-weight:600;line-height:1.5}
.info-badge.generated{color:var(--llm);background:var(--llm-soft);border-color:color-mix(in srgb,var(--llm) 20%,var(--line))}
.info-badge.unmatched{color:var(--drop);background:var(--drop-soft)}
.info-section{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.info-section h4{margin:0 0 6px;color:var(--ink);font-size:13px;font-weight:600}
.info-iri{display:block;color:var(--kg-strong);font:11px/1.6 var(--mono);overflow-wrap:anywhere;text-decoration:none}
a.info-iri:hover{text-decoration:underline}
.info-copy{margin-top:6px;padding:2px 8px;border:1px solid var(--line);background:var(--panel);color:var(--muted);font-size:11px}
.info-entity{display:flex;align-items:baseline;gap:6px;padding:0;border:0;background:transparent;color:var(--kg-strong);font-size:12px;line-height:1.55;text-align:left;overflow-wrap:anywhere}
.info-entity:hover{text-decoration:underline}
.info-entity>span{font-size:11px;opacity:.6}
.info-relation{display:flex;gap:9px;padding:6px 0;border-bottom:1px solid color-mix(in srgb,var(--line) 65%,transparent)}
.info-direction{color:var(--muted);font-size:13px;line-height:1.55}
.info-predicate{display:block;color:var(--muted);font:11px/1.55 var(--mono)}
.info-more>summary{padding-top:8px;color:var(--kg-strong);font-size:12px;cursor:pointer}
.info-language{color:var(--muted);font:11px var(--mono)}

/* Graph interaction: relations can be clicked, nodes reached with the keyboard. */
.relation-hit-target{stroke:transparent;stroke-width:12;fill:none;pointer-events:stroke;cursor:pointer;vector-effect:non-scaling-stroke}
#kgGraph .link.inspect-link{stroke:var(--llm);stroke-width:2.5;stroke-opacity:1;opacity:1}
#kgGraph .node[role="button"]{cursor:pointer}
#kgGraph .node:focus{outline:none}
#kgGraph .node:focus-visible circle{stroke:var(--llm);--node-stroke:3px}
/* The rules above set the outline of each kind of node in --node-stroke. It is at most 0.3 of
   the radius (--r, set by app.js), so that a small node keeps its colour instead of turning
   into a ring, at every zoom. The figures of ?print keep the outlines they were drawn with. */
#kgGraph .node circle{stroke-width:var(--node-stroke,1.3px)}
html:not([data-print]) #kgGraph .node circle{stroke-width:min(var(--node-stroke,1.3px),calc(var(--r,4px) * .3))}
.live-result-scroll tbody tr{cursor:pointer}
.live-result-scroll tbody tr:hover{background:var(--kg-soft)}

html[data-print] .info-panel,html[data-print] .header-legend{display:none!important}

@media(max-width:1100px){
  .primary-settings{gap:12px 22px}
  .threshold-control{flex-basis:240px;width:240px}
}
@media(max-width:920px){
  .workspace{grid-template-columns:minmax(0,1fr)}
  .query-column{contain:none;overflow:visible;display:grid;grid-template-columns:1fr 1fr;align-items:start}
  .query-column>.attribute-result{grid-column:1/-1}
  .graph-stage{height:520px}
}
@media(max-width:720px){
  .topbar-inner,.wrap{width:calc(100% - 32px)}
  .topbar-inner{flex-wrap:nowrap;padding-inline:0}
  .topbar-controls{display:flex;width:auto;margin-left:auto}
  .brand-tagline{display:none}
  .primary-settings{display:grid;grid-template-columns:1fr 1fr;gap:12px}
  .database-control{grid-column:1/-1}
  .threshold-control{width:auto}
  .query-column{grid-template-columns:1fr}
  .toolbar .embedding-settings{grid-template-columns:1fr}
  .graph-toolbar{flex-direction:column;align-items:flex-start;gap:8px}
}
@media(max-width:560px){
  .primary-settings{grid-template-columns:1fr}
  .page-mode-switch{width:100%}
  .page-mode-option{flex:1 1 0}
  .database-row{flex-wrap:wrap}
  .toolbar .db-picker{flex:1 1 auto}
  .toolbar .db-picker select{width:100%;min-width:0}
  .similarity-options label{flex:1 1 0}
  .similarity-options span{min-width:0;width:100%}
  .tabs{width:100%}
  .tabs .tab{flex:1 1 0;min-width:0;padding:0 6px;font-size:12px}
  .toolbar .live-settings>.field{flex:1 1 100%}
  .graph-stage{height:460px}
  /* On a phone the legend is one strip along the top of the graph, the zoom buttons move to
     the bottom, and the hint gives way: the Info panel says the same. */
  .graph-stage .graph-legend{right:8px;left:8px;top:8px;flex-direction:row;flex-wrap:wrap;gap:4px 12px;padding:6px 8px}
  .graph-legend:before{display:none}
  .graph-stage .graph-controls{top:auto;bottom:8px;right:8px}
  .graph-help{display:none}
}

/* ===============================================================
   One screen. In a window wider than 920 px the workbench fills the window and the page does
   not scroll: the header, the toolbar, the status line and the tabs keep their height, and the
   graph and the column beside it share the rest. The graph grows and shrinks with the window
   and the column scrolls by itself. A window too low for a graph panel of 300 px scrolls (the
   panel clips what overflows it, so the floor is on the panel), and the figures of ?print keep
   their layout.
   =============================================================== */
@media (min-width:921px){
  html:not([data-print]) body{display:flex;flex-direction:column;height:calc(100vh / var(--page-zoom))}
  html:not([data-print]) .topbar{flex:0 0 auto}
  html:not([data-print]) .wrap{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;padding-bottom:16px}
  html:not([data-print]) .wrap>*{flex:0 0 auto}
  html:not([data-print]) .wrap>.workspace{flex:1 1 auto;min-height:0;grid-template-rows:minmax(0,1fr)}
  html:not([data-print]) .graph-column{min-height:0}
  html:not([data-print]) .graph-column>.graph-panel{flex:1 1 auto;min-height:300px;display:flex;flex-direction:column}
  html:not([data-print]) .graph-stage{flex:1 1 auto;height:auto;min-height:0}

  /* The steps of Compose + defer stand above the graph in three rows: the strategy, the steps
     beside the counts, and the explanation. */
  .graph-column>.execution-result{display:grid;grid-template-columns:minmax(0,1fr) auto;margin:0}
  .execution-result-head{grid-column:1/-1;min-height:0;padding:6px 12px}
  .execution-result-head>div:first-child{flex-direction:row;align-items:baseline;gap:8px}
  .execution-order{grid-column:1;grid-row:2;padding:8px 12px;border-bottom:0}
  .execution-step{padding:5px 8px}
  .execution-step .step-no{margin-bottom:2px}
  .execution-metrics{grid-column:2;grid-row:2;grid-template-columns:repeat(3,auto);align-self:center;border-bottom:0}
  .execution-metric{padding:4px 14px;border-right:0;border-left:1px solid var(--line)}
  .execution-metric:last-child{border-right:0}
  .execution-metric strong{font-size:15px}
  .playback-track{grid-column:1/-1;grid-row:3;margin:0 12px}
  .execution-explanation{grid-column:1/-1;grid-row:4;padding:6px 12px 8px}
}
/* In a low window the explanation gives way to the graph: the steps and the counts say it. */
@media (min-width:921px) and (max-height:820px){
  .graph-column>.execution-result .execution-explanation{display:none}
}
