.kgx {
  --kg-bg: #15202b;
  --kg-panel: #1b2835;
  --kg-text: #dce5ed;
  --kg-border: #405163;
  color: var(--kg-text);
  font-size: 14px;
}
.kgx-toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.kgx-toolbar label {
  display: grid;
  gap: 6px;
  flex: 1;
  min-width: 220px;
}
.kgx-toolbar label span {
  font-size: 12px;
  color: #b9c9d8;
}
.kgx input,
.kgx select {
  width: 100%;
  min-height: 40px;
  background: var(--kg-panel);
  color: var(--kg-text);
  border: 1px solid var(--kg-border);
  border-radius: 6px;
  padding: 8px;
}
.kgx input::placeholder {
  color: #afbfce;
}
.kgx button {
  background: var(--kg-panel);
  color: var(--kg-text);
  border: 1px solid var(--kg-border);
  border-radius: 6px;
  padding: 8px 12px;
  min-height: 36px;
  cursor: pointer;
  white-space: nowrap;
}
.kgx button:hover {
  border-color: #72aff5;
}
.kgx button:active {
  background: #30465a;
}
.kgx button:disabled {
  opacity: 0.5;
  cursor: default;
}
.kgx :focus-visible {
  outline: 2px solid #8dc3ff;
  outline-offset: 3px;
}
.kgx-status {
  font-size: 12px;
  color: #b9c9d8;
  margin: 8px 0;
  min-height: 18px;
}
.kgx-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  min-height: 20px;
  margin: 8px 0 12px;
}
.kgx-assesses {
  color: #62d6b2;
}
.kgx-exposes {
  color: #d3b16e;
}
.kgx-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border: 1px solid var(--kg-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--kg-bg);
}
.kgx-body.has-selection {
  grid-template-columns: minmax(0, 1fr) 360px;
}
.kgx-map {
  position: relative;
  min-width: 0;
}
.kgx-canvas {
  height: calc(100dvh - 270px);
  min-height: 530px;
  width: 100%;
}
.kgx-controls {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
}
.kgx-tooltip {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  pointer-events: none;
  background: #233448;
  padding: 10px;
  border-radius: 5px;
  max-width: 600px;
}
.kgx-inspector {
  padding: 18px;
  border-left: 1px solid var(--kg-border);
  max-height: calc(100dvh - 270px);
  min-height: 530px;
  overflow: auto;
  overflow-wrap: anywhere;
}
.kgx-inspector[hidden] {
  display: none;
}
.kgx-inspector-head {
  display: flex;
  align-items: start;
  gap: 10px;
  justify-content: space-between;
}
.kgx h2 {
  font-size: 19px;
  line-height: 1.35;
  margin: 0 0 12px;
}
.kgx h3 {
  font-size: 14px;
  margin: 24px 0 10px;
}
.kgx-description {
  line-height: 1.65;
  white-space: pre-wrap;
}
.kgx code {
  font-size: 11px;
  color: #9fc3e8;
  word-break: break-word;
}
.kgx-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.kgx dl {
  display: grid;
  grid-template-columns: 95px minmax(0, 1fr);
  gap: 9px;
  font-size: 12px;
  margin: 20px 0;
}
.kgx dt {
  color: #a6b9ca;
}
.kgx dd {
  margin: 0;
}
.kgx-relations {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
}
.kgx-relations li {
  display: grid;
  gap: 4px;
}
.kgx-relations small {
  color: #a6b9ca;
}
.kgx-relations button {
  text-align: left;
  white-space: normal;
}
.kgx-relations p {
  font-size: 12px;
  line-height: 1.5;
  margin: 4px 0;
}
.kgx summary {
  cursor: pointer;
  padding: 8px 0;
}
.kgx pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  line-height: 1.55;
}
.kgx-results {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  background: var(--kg-panel);
  max-height: 220px;
  overflow: auto;
}
.kgx-results[hidden] {
  display: none;
}
.kgx-results small {
  width: 100%;
}
.kgx-results button {
  white-space: normal;
  text-align: left;
}
#legacyGraphTools {
  margin-top: 20px;
}
#legacyGraphTools > summary {
  cursor: pointer;
  color: #98abc0;
  padding: 10px 0;
}
@media (max-width: 800px) {
  .kgx-body.has-selection {
    grid-template-columns: minmax(0, 1fr);
  }
  .kgx-canvas {
    height: 55dvh;
    min-height: 400px;
  }
  .kgx-inspector {
    border-left: 0;
    border-top: 1px solid var(--kg-border);
    max-height: none;
    min-height: 0;
  }
  .kgx-toolbar label {
    min-width: 100%;
  }
  .kgx-legend {
    gap: 8px;
  }
  .kgx-toolbar > button {
    width: 100%;
  }
}
