/* shared-explorer.css: the shared neurons explorer. Everything is under .sx, and it uses the page's colour and type
   tokens, so it follows the light and dark themes without a redraw. */
.sx {
  --sx-other: #aab0b8;
  --sx-half: #efb48a;
  display: grid;
  gap: 18px;
  min-width: 0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sx {
    --sx-other: #737d89;
    --sx-half: #a5673a;
  }
}

:root[data-theme="dark"] .sx {
  --sx-other: #737d89;
  --sx-half: #a5673a;
}

.sx-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: var(--fs-ui);
  color: var(--muted);
}

.sx-bar label,
.sx-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-weight: var(--w-strong, 600);
}

.sx input,
.sx select,
.sx button {
  font: inherit;
  font-size: var(--fs-small);
  color: var(--ink);
  background: var(--well);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 4px 8px;
  min-height: 30px;
}

.sx input {
  width: 13em;
  font-weight: 400;
}

.sx select {
  max-width: 100%;
  min-width: 0;
  font-weight: 400;
}

.sx button {
  cursor: pointer;
}

.sx button[aria-pressed="true"] {
  background: var(--tint-neurons);
  border-color: var(--c-neurons);
  color: var(--t-neurons);
  font-weight: var(--w-strong, 600);
}

.sx input:focus-visible,
.sx select:focus-visible,
.sx button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.sx-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 22px;
  align-items: start;
}

.sx-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px 12px 8px;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.sx-title {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--fs-medium);
  line-height: 1.3;
  font-weight: var(--w-strong, 600);
  color: var(--ink);
  text-wrap: pretty;
}

.sx-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: var(--fs-small);
}

.sx-controls label {
  min-width: 0;
  max-width: 100%;
}

.sx-controls[hidden],
.sx-examples[hidden] {
  display: none;
}

.sx-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sx-chart {
  position: relative;
  min-width: 0;
}

.sx-chart svg {
  display: block;
  width: 100%;
  touch-action: pan-y;
}

.sx-note {
  position: absolute;
  inset: 40% 0 auto;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-small);
}

.sx svg text {
  font-family: var(--font-text);
  font-size: var(--fs-small);
  fill: var(--ink-2);
}

.sx svg text.sx-ax {
  font-size: var(--fs-micro);
  fill: var(--muted);
}

.sx svg text.sx-name {
  fill: var(--muted);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.sx svg text.sx-sel {
  fill: var(--t-neurons);
  font-weight: var(--w-strong, 600);
}

.sx svg text.sx-val {
  fill: var(--t-neurons);
  font-weight: var(--w-strong, 600);
}

.sx svg text.sx-cat {
  fill: var(--ink);
  font-weight: var(--w-strong, 600);
}

.sx svg text.sx-cat.on {
  fill: var(--t-neurons);
}

.sx svg text.sx-own {
  fill: var(--ink-2);
}

.sx svg .sx-axis { stroke: var(--muted); stroke-width: 1; fill: none; }
.sx svg .sx-grid-l { stroke: var(--rule-2); stroke-width: 1; }
.sx svg .sx-zero { stroke: var(--rule); stroke-width: 1; }
.sx svg .sx-other { fill: var(--sx-other); fill-opacity: 0.7; }
.sx svg .sx-held { fill: var(--c-control); }
.sx svg .sx-picked { fill: var(--c-neurons); }
.sx svg .sx-most { fill: var(--c-neurons); }
.sx svg .sx-least { fill: var(--sx-half); }
.sx svg .sx-ring { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.sx svg .sx-whisker { stroke: var(--ink); stroke-width: 1.5; }
.sx svg .sx-diamond { fill: var(--ink); stroke: var(--surface); stroke-width: 1.5; }

.sx-tip {
  position: fixed;
  z-index: 50;
  max-width: 300px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: var(--shadow);
  pointer-events: none;
  font-family: var(--font-text);
  font-size: var(--fs-small);
  line-height: 1.4;
}

.sx-tip b {
  display: block;
  font-weight: var(--w-strong, 600);
}

.sx-tip div {
  color: var(--muted);
}

@media (max-width: 720px) {
  .sx-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
