/* Knowledge Graph explorer — bahn-zu-spaet look on top of bzs.css */

.gx {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 32px;
}
@media (min-width: 640px) {
  .gx {
    padding: 32px 40px 40px;
  }
}
.gx-intro {
  max-width: var(--wrap);
  margin-bottom: 16px;
}
.gx-intro h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-top: 6px;
}
@media (min-width: 640px) {
  .gx-intro h2 {
    font-size: 44px;
  }
}
.gx-intro p {
  color: var(--stone-600);
  margin-top: 6px;
  font-size: 14px;
  max-width: 52rem;
}
kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--stone-300);
  background: #fff;
  padding: 0 5px;
}

.gx-shell {
  position: relative;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  height: min(80vh, 860px);
  min-height: 560px;
  border: 1px solid var(--stone-200);
  background: #fff;
}
.gx-has-panel .gx-shell {
  grid-template-columns: 290px minmax(0, 1fr) 340px;
}
.gx-shell:fullscreen {
  height: 100vh;
  max-height: none;
  border: 0;
}

/* ---- sidebar ---- */
.gx-side {
  border-right: 1px solid var(--stone-200);
  overflow-y: auto;
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--stone-50);
}
.gx-side section {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.gx-side .label {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: baseline;
}
.gx-side output {
  font-family: var(--font-mono);
  color: var(--stone-900);
  letter-spacing: 0;
}
.gx-hint {
  text-transform: none;
  letter-spacing: 0;
  font-size: 10px;
  color: var(--stone-400);
}
.gx-side input[type="range"] {
  width: 100%;
}
.gx-side .field {
  width: 100%;
}
.gx-side-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--stone-200);
}
.gx-stats-line {
  font-size: 11px;
  color: var(--stone-500);
}
.gx-stats-line b {
  color: var(--stone-900);
  font-weight: 500;
}
.gx-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.gx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.gx-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 12px;
  border: 1px solid var(--stone-300);
  background: #fff;
  color: var(--stone-500);
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s,
    background-color 0.15s;
}
.gx-chip:hover {
  border-color: var(--stone-700);
}
.gx-chip.active {
  color: var(--stone-900);
  border-color: var(--stone-900);
}
.gx-chip:not(.active) .gx-dot {
  opacity: 0.25;
}
.gx-chip-sm {
  font-size: 11px;
  padding: 2px 7px;
}
.gx-chip-sm.active {
  background: var(--stone-900);
  color: var(--stone-50);
}
.gx-n {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--stone-500);
}
.gx-chip-sm.active .gx-n {
  color: var(--stone-300);
}
.gx-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.gx-seg {
  display: flex;
  border: 1px solid var(--stone-300);
  background: #fff;
}
.gx-seg button {
  flex: 1;
  padding: 5px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  border: 0;
  background: none;
  color: var(--stone-600);
  cursor: pointer;
  border-right: 1px solid var(--stone-300);
}
.gx-seg button:last-child {
  border-right: 0;
}
.gx-seg button.active {
  background: var(--stone-900);
  color: var(--stone-50);
}

.gx-path-inputs {
  display: grid;
  gap: 4px;
}
.gx-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.gx-path {
  list-style: none;
  counter-reset: step;
  margin-top: 4px;
}
.gx-path li {
  counter-increment: step;
  position: relative;
  padding-left: 18px;
}
.gx-path li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--stone-500);
}

/* ---- search suggestions ---- */
.gx-search {
  position: relative;
}
.gx-suggest {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  background: #fff;
  border: 1px solid var(--stone-900);
  max-height: 320px;
  overflow-y: auto;
}
.gx-suggest button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: var(--stone-900);
}
.gx-suggest button.active,
.gx-suggest button:hover {
  background: var(--stone-100);
}
.gx-s-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- stage ---- */
.gx-stage {
  position: relative;
  min-width: 0;
  background-color: var(--stone-50);
  background-image: radial-gradient(
    rgba(28, 25, 23, 0.05) 1px,
    transparent 1px
  );
  background-size: 4px 4px;
}
#gxCanvas {
  position: absolute;
  inset: 0;
}
.gx-pointer #gxCanvas {
  cursor: pointer;
}
.gx-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--stone-500);
}
.gx-toolbar {
  position: absolute;
  top: 10px;
  display: flex;
  gap: 4px;
  z-index: 5;
}
.gx-toolbar-left {
  left: 10px;
}
.gx-toolbar-right {
  right: 10px;
}
.gx-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--stone-300);
  color: var(--stone-800);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.gx-icon:hover:not(:disabled) {
  border-color: var(--stone-900);
}
.gx-icon:disabled {
  opacity: 0.35;
  cursor: default;
}
.gx-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}
.gx-filter-toggle {
  display: none;
}
.gx-mode[hidden] { display: none; }
.gx-mode {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--stone-900);
  color: var(--stone-50);
  padding: 5px 6px 5px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  max-width: 60%;
}
.gx-mode span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gx-mode button {
  background: none;
  border: 1px solid var(--stone-600);
  color: var(--stone-50);
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.gx-legend {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  max-width: calc(100% - 20px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--stone-200);
  padding: 6px 10px;
  font-size: 11px;
  color: var(--stone-700);
}
.gx-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: -1px;
}

/* ---- details panel ---- */
.gx-panel {
  border-left: 1px solid var(--stone-200);
  overflow-y: auto;
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gx-panel[hidden] {
  display: none;
}
.gx-panel-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}
.gx-panel-head h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-top: 4px;
  word-break: break-word;
}
.gx-meta {
  font-size: 11px;
  color: var(--stone-500);
}
.gx-wide {
  justify-content: center;
}
.gx-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--stone-200);
}
.gx-stats > div {
  padding: 8px 10px;
  border-right: 1px solid var(--stone-200);
}
.gx-stats > div:last-child {
  border-right: 0;
}
.gx-stats .v {
  font-family: var(--font-mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.gx-stats .l {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--stone-500);
}
.gx-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gx-actions .btn {
  font-size: 11px;
  padding: 4px 9px;
}
.gx-group {
  display: flex;
  flex-direction: column;
}
.gx-group .label {
  margin-bottom: 4px;
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.gx-nb {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) 60px 34px;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 5px 0;
  border: 0;
  border-bottom: 1px solid var(--stone-100);
  background: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--stone-900);
}
.gx-nb:hover .gx-nb-label {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.gx-nb-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gx-nb-bar {
  height: 4px;
  background: var(--stone-100);
}
.gx-nb-bar span {
  display: block;
  height: 100%;
  background: var(--stone-700);
}
.gx-nb-w {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--stone-500);
  text-align: right;
}
.gx-path .gx-nb {
  grid-template-columns: 9px minmax(0, 1fr);
}
.gx-more {
  margin-top: 4px;
  align-self: flex-start;
  background: none;
  border: 0;
  padding: 2px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--stone-900);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .gx-has-panel .gx-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .gx-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(340px, 90%);
    z-index: 15;
    box-shadow: -1px 0 0 var(--stone-200);
  }
  .gx-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .gx {
    padding: 16px 0 24px;
  }
  .gx-intro {
    padding: 0 16px;
  }
  .gx-shell,
  .gx-has-panel .gx-shell {
    grid-template-columns: minmax(0, 1fr);
    height: 72vh;
    min-height: 480px;
    border-left: 0;
    border-right: 0;
  }
  .gx-side {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 88%);
    z-index: 16;
    transform: translateX(-102%);
    transition: transform 0.2s;
    box-shadow: 1px 0 0 var(--stone-200);
  }
  .gx-side-open .gx-side {
    transform: none;
  }
  .gx-filter-toggle {
    display: inline-flex;
  }
  .gx-panel {
    top: auto;
    left: 0;
    width: 100%;
    max-height: 62%;
    border-left: 0;
    border-top: 1px solid var(--stone-300);
  }
  .gx-mode {
    max-width: 70%;
    top: 50px;
  }
  .gx-legend {
    display: none;
  }
}

.gx-side-close { display: none; align-self: flex-end; }
@media (max-width: 760px) { .gx-side-close { display: inline-flex; } }
.gx-s-chat { font-family: var(--font-mono); font-size: 12px !important; color: var(--stone-700) !important; }
