:root {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #192a25;
  background: #f3f5ef;
  font-synthesis: none;
  --quiet: #4b6258;
  --line: #dce5dd;
  --paper: #fcfdfa;
  --accent: #285c46;
  --graph: #142722;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, select, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #538865;
  outline-offset: 3px;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.25rem); letter-spacing: -.055em; line-height: 1.08; }
h2 { font-size: 1.12rem; letter-spacing: -.025em; line-height: 1.3; }
.masthead, main { max-width: 1510px; margin: 0 auto; padding: 0 clamp(15px, 3vw, 46px); }
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 19px;
  padding-bottom: 16px;
}
.identity { display: flex; align-items: center; gap: 14px; }
.identity p { color: var(--quiet); margin-top: 6px; font-size: .9rem; }
.mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 12px;
  font-size: 1.65rem;
  background: var(--graph);
  color: #b6ecc8;
}
.dataset {
  flex: none;
  border: 1px solid #b7d1bf;
  border-radius: 50px;
  padding: 6px 10px;
  background: #e9f3e9;
  color: #284d39;
  font-size: .76rem;
  font-weight: 650;
}
#questions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
#questions button, .zoom button, #clear {
  border: 1px solid var(--line);
  color: #233d30;
  background: var(--paper);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: .83rem;
  font-weight: 650;
}
#questions button:hover, #clear:hover { border-color: #7f9b87; }
#questions button[aria-pressed="true"] { color: #fff; border-color: var(--accent); background: var(--accent); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(295px, 365px); gap: 14px; align-items: start; padding-bottom: 12px; }
.canvas-card, .card { border-radius: 14px; border: 1px solid var(--line); }
.canvas-card { position: relative; background: var(--graph); color: #f2faf6; border-color: #284338; }
.skip-answer { position: absolute; top: 9px; left: 14px; z-index: 3; padding: 7px 10px; border-radius: 6px; background: #203a30; color: #f2faf6; }
.skip-answer:not(:focus) { clip-path: inset(50%); }
.graph-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 7px; padding: 13px 16px 0; }
#counts, .graph-hint { color: #b2c9be; font-size: .79rem; margin-top: 4px; }
.zoom { display: flex; gap: 5px; }
.zoom button { background: #203a30; border-color: #436458; color: #f2faf6; padding: 6px 9px; }
.zoom button:hover { background: #315346; }
.search-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 16px 0; flex-wrap: wrap; }
#search-form { display: flex; position: relative; gap: 5px; flex: 0 1 340px; min-width: 0; }
#search-form input, #search-form button {
  padding: 6px 9px;
  border: 1px solid #55776a;
  border-radius: 7px;
  background: #203a30;
  color: #f2faf6;
  font-size: .85rem;
}
#search-form input { width: 100%; min-width: 0; }
#search-form input::placeholder { color: #bed3c9; }
#search-form button:hover { background: #315346; }
#search-results {
  position: absolute;
  z-index: 2;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  display: grid;
  gap: 3px;
  padding: 6px;
  border: 1px solid #709585;
  border-radius: 8px;
  background: #142722;
  box-shadow: 0 5px 20px #081b15aa;
}
#search-results button { text-align: left; overflow-wrap: anywhere; }
#search-results p, #path-status { font-size: .8rem; color: #e2efe7; }
#search-results p { padding: 5px; }
#path-status { display: flex; align-items: center; gap: 6px; min-height: 18px; }
.path-swatch { width: 17px; height: 3px; border-radius: 2px; background: #a9ecc4; }
.canvas-card :focus-visible { outline-color: #9be6b9; }
#graph {
  display: block;
  width: 100%;
  height: clamp(310px, calc(100vh - 313px), 520px);
  background: radial-gradient(ellipse at center, #1b352c 0, transparent 76%);
  touch-action: none;
  cursor: grab;
}
#graph:focus-visible { outline-offset: -4px; }
#graph:active { cursor: grabbing; }
.link { stroke: #83a698; stroke-width: 1.2; opacity: .42; transition: opacity .15s; }
.link.muted { opacity: .17; }
.link.focus { stroke: #a9ecc4; stroke-width: 2; opacity: .92; }
.link.attached { stroke: #ffd18f; stroke-width: 2.3; opacity: 1; }
.node { cursor: pointer; transition: opacity .15s; }
.node circle { stroke: #142722; stroke-width: 1.65; }
.node .hit { fill: transparent; stroke: none; }
.node text {
  fill: #f2faf6;
  stroke: #142722;
  stroke-width: 3;
  paint-order: stroke;
  font-size: 13px;
  font-weight: 660;
  pointer-events: none;
}
.node.muted { opacity: .51; }
.node.quiet text { visibility: hidden; }
.node:hover, .node:focus-visible { opacity: 1; outline: none; }
.node:hover text, .node:focus-visible text { visibility: visible; }
.node.selected circle.core { stroke: #ffd18f; stroke-width: 3.25; }
.node:focus-visible circle.core { stroke: #fff; stroke-width: 3.25; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 13px; border-top: 1px solid #345046; padding: 9px 16px 0; margin: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; color: #e2efe7; }
.legend strong { font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.graph-hint { padding: 4px 16px 10px; }
.sidebar { display: grid; gap: 12px; min-width: 0; }
.card { background: var(--paper); padding: 15px; }
.answer-head p, .fallback p { font-size: .84rem; color: var(--quiet); line-height: 1.4; margin-top: 5px; }
#scope-label { display: grid; gap: 4px; font-size: .78rem; font-weight: 600; margin-top: 12px; }
#scope { max-width: 100%; padding: 7px 6px; border: 1px solid #aebfb2; border-radius: 7px; background: #fff; color: #243a2d; }
#answer { display: grid; gap: 7px; margin-top: 10px; max-height: 42vh; overflow: auto; padding: 4px; }
.inspecting #answer { max-height: 23vh; }
.entry {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 9px;
  background: #f2f6f0;
  border: 1px solid #dfe8df;
  border-radius: 7px;
  overflow-wrap: anywhere;
  color: inherit;
}
button.entry:hover { background: #e6f1e7; border-color: #7f9b87; }
.entry strong { display: block; font-size: .88rem; font-weight: 700; }
.entry small, .empty { display: block; margin-top: 3px; color: var(--quiet); font-size: .8rem; line-height: 1.35; }
.group-title { font-size: .78rem; margin: 5px 0 0; font-weight: 750; }
#statement { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; font-size: .78rem; }
#statement summary { cursor: pointer; font-weight: 650; }
pre { overflow: auto; max-height: 25vh; padding: 8px; border-radius: 6px; background: #eaf1ea; font-size: .75rem; }
.inspect-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#clear { padding: 4px 8px; }
#node-detail { max-height: 26vh; overflow: auto; padding: 3px; }
#node-detail p, #node-detail li { font-size: .78rem; overflow-wrap: anywhere; }
#node-detail p { margin-top: 7px; }
#node-detail ul { list-style: none; padding: 0; margin: 7px 0 0; display: grid; gap: 5px; }
#load-status, .fallback { margin-top: 16px; }
.fallback input { margin-top: 10px; max-width: 100%; }

@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  #answer { max-height: 390px; }
  #graph { height: clamp(280px, 56vw, 450px); }
}
@media (max-width: 480px) {
  .masthead { flex-wrap: wrap; padding-top: 16px; padding-bottom: 14px; }
  .identity p { font-size: .81rem; }
  .mark { height: 40px; width: 40px; }
  .graph-bar { padding: 12px 12px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .link, .node { transition: none; }
}
