:root {
  color-scheme: dark;
  --bg: #0a101c;
  --panel: #101927;
  --line: #243247;
  --muted: #99adc7;
  --text: #eaf1fc;
  --accent: #6ee7c0;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select {
  font: inherit;
}
button,
select,
.import-button {
  background: #18243a;
  color: var(--text);
  border: 1px solid #34445d;
  border-radius: 7px;
  padding: 8px 11px;
  cursor: pointer;
}
button:hover,
.import-button:hover {
  background: #253652;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button.active {
  background: #1b423d;
  border-color: #58c6a9;
  color: #b3ffe5;
}
input {
  width: 100%;
  background: #0b1423;
  color: var(--text);
  border: 1px solid #34445d;
  border-radius: 7px;
  padding: 10px;
}
select {
  max-width: 100%;
}
a {
  color: #91beff;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 0 22px;
}
.brand {
  font-size: 20px;
  color: var(--accent);
  display: flex;
  gap: 9px;
  align-items: center;
}
.brand span {
  color: var(--text);
}
.brand strong {
  font-weight: 400;
  color: var(--muted);
}
.divider {
  height: 22px;
  width: 1px;
  background: var(--line);
}
.top-actions {
  display: flex;
  gap: 9px;
  margin-left: auto;
  align-items: center;
}
.import-button {
  position: relative;
  overflow: hidden;
  display: inline-block;
}
.import-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.import-button:focus-within {
  outline: 2px solid var(--accent);
}
#notice {
  padding: 9px 22px;
  background: #132331;
  color: #b4cadc;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
#notice.error {
  background: #45252b;
  color: #ffd1cf;
}
.workspace {
  display: grid;
  grid-template-columns: 260px minmax(300px, 1fr) 310px;
  height: calc(100dvh - 100px);
  min-height: 550px;
}
.sidebar,
.inspector {
  background: var(--panel);
  padding: 20px;
  overflow: auto;
  scrollbar-width: thin;
}
.sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.field-label,
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 650;
  margin: 10px 0 0;
}
.field-label:first-child {
  margin-top: 0;
}
.muted {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.badge {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 4px;
  background: #26364b;
  color: #c6d4e8;
  font-size: 12px;
  margin: 7px 5px 0 0;
}
.badge.private {
  background: #422e4f;
  color: #e2c4ff;
}
.badge.public {
  background: #173f37;
  color: #a0f3cf;
}
.results {
  flex: 1;
  min-height: 120px;
  overflow: auto;
  margin: 0 -10px;
  scrollbar-width: thin;
}
.result {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px;
  border-radius: 5px;
  line-height: 1.4;
  margin-bottom: 2px;
}
.result.selected {
  background: #26394f;
  box-shadow: inset 3px 0 var(--accent);
}
.result small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.affiliations {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  max-height: 28%;
  overflow: auto;
  flex-shrink: 0;
}
.affiliations summary {
  cursor: pointer;
  font-weight: 600;
}
.affiliate {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.affiliate a,
.affiliate button {
  display: block;
  margin-top: 5px;
}
.map-section {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.map-toolbar {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.map-toolbar > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.map-toolbar label {
  white-space: nowrap;
  color: var(--muted);
}
.map-toolbar select {
  padding: 6px;
}
.map-heading {
  padding: 19px 24px 0;
  pointer-events: none;
}
.map-heading h1 {
  font-size: 25px;
  margin: 0 0 7px;
  font-weight: 650;
  letter-spacing: -0.025em;
}
.map-heading p {
  color: var(--muted);
  margin: 0;
  font-size: 13px;
}
.graph-stage {
  position: relative;
  min-height: 320px;
  flex: 1;
  overflow: hidden;
  background-image: radial-gradient(#243248 1px, transparent 1px);
  background-size: 24px 24px;
}
#graph {
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
#graph:active {
  cursor: grabbing;
}
.graph-edge {
  stroke: #5d7596;
  stroke-opacity: 0.23;
  fill: none;
}
.graph-edge.selected {
  stroke: #9fe9d5;
  stroke-opacity: 0.8;
  stroke-width: 1.8;
}
.graph-node {
  cursor: pointer;
  outline: none;
}
.graph-node .halo {
  fill: none;
  stroke: transparent;
  stroke-width: 6;
}
.graph-node:hover .halo,
.graph-node:focus .halo,
.graph-node.selected .halo {
  stroke: #f5fffd;
  stroke-opacity: 0.6;
}
.graph-node text {
  fill: #c6d5e9;
  font-size: 12px;
  paint-order: stroke;
  stroke: #0a101c;
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}
.graph-node.selected text {
  fill: white;
  font-weight: bold;
}
.cluster-label {
  fill: #829bb8;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  pointer-events: none;
}
.map-controls {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: flex;
  gap: 5px;
}
.map-caption {
  position: absolute;
  right: 18px;
  bottom: 21px;
  color: var(--muted);
  font-size: 12px;
  max-width: 50%;
  text-align: right;
  pointer-events: none;
}
.legend {
  padding: 12px 20px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.inspector {
  border-left: 1px solid var(--line);
}
.inspector h2 {
  font-size: 23px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.inspector h3 {
  font-size: 14px;
  margin-top: 26px;
  color: #d5e2f4;
}
.inspector p {
  line-height: 1.65;
  color: #b6c6dc;
}
.inspector .eyebrow {
  color: var(--accent);
}
.inspector code {
  font-size: 12px;
  overflow-wrap: anywhere;
  color: #aac0df;
}
.inspector .action {
  width: 100%;
  margin-top: 9px;
}
.source {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.source a {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.source small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.connection {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 12px 0;
}
.connection small {
  display: block;
  color: var(--muted);
  margin: 4px 0;
  font-size: 12px;
}
.empty {
  padding: 18px 0;
  color: var(--muted);
  line-height: 1.6;
}
.inspector details {
  margin-top: 18px;
}
.inspector summary {
  cursor: pointer;
  color: var(--muted);
}
@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: 290px minmax(300px, 1fr) 350px;
  }
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 220px minmax(300px, 1fr);
  }
  .inspector {
    grid-column: 1/-1;
    border-top: 1px solid var(--line);
    max-height: 400px;
  }
  .workspace {
    height: auto;
  }
  .sidebar,
  .map-section {
    height: 70dvh;
    min-height: 550px;
  }
  .topbar {
    gap: 12px;
  }
  .topbar > strong,
  .divider {
    display: none;
  }
}
@media (max-width: 620px) {
  .topbar {
    height: auto;
    min-height: 64px;
    padding: 12px;
    flex-wrap: wrap;
  }
  .brand {
    font-size: 18px;
  }
  .top-actions {
    margin-left: 0;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .sidebar {
    height: auto;
    min-height: 0;
    padding: 14px;
  }
  .results {
    max-height: 180px;
    min-height: 0;
  }
  .affiliations {
    display: none;
  }
  .map-section {
    height: 65dvh;
    min-height: 450px;
  }
  .map-heading {
    padding: 16px;
  }
  .map-toolbar {
    padding: 12px;
  }
  .map-caption {
    max-width: 45%;
  }
  .inspector {
    max-height: none;
  }
  .legend {
    gap: 9px;
  }
  .map-heading h1 {
    font-size: 22px;
  }
}
