#screen-graph {
  padding: 0;
}
#screen-graph.active {
  display: flex;
  flex-direction: column;
}
.graph-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-input);
}
.graph-hint {
  font-size: 12px;
  color: var(--text-tertiary);
}
.graph-legend {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.graph-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.graph-legend .gl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.graph-controls {
  display: flex;
  gap: 4px;
}
.graph-btn {
  background: none;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.graph-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
#graph-canvas {
  flex: 1 1 auto;
  width: 100%;
  min-height: 320px;
  display: block;
  touch-action: none;
  cursor: grab;
}
.graph-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
}
.view-related {
  margin-top: 14px;
  border-top: 1px solid var(--border-input);
  padding-top: 12px;
}
.view-related-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.related-item {
  display: flex;
  align-items: stretch;
  width: 100%;
  background: var(--accent-soft);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-primary);
}
.related-open {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  font-family: inherit;
}
.related-unlink {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0 10px;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 14px;
}
.related-unlink:hover {
  color: var(--danger);
}
.related-item:hover {
  background: rgba(253, 84, 10, 0.12);
}
.related-type {
  font-weight: 600;
  color: var(--accent);
  margin-right: 6px;
}
