* {
  font-family: "Arial", sans-serif;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  overflow: hidden;
  margin: 0;
  background-color: #f9f9f9;
  color: #333;
  font-size: 16px;
  line-height: 1.6;
}

h3 {
  text-align: center;
  margin-bottom: 5px;
  font-size: 23px;
}

.link {
  stroke: #888;
  stroke-opacity: 0.75;
  stroke-width: 2px;
  transition: stroke 0.2s, stroke-opacity 0.2s;
}

.node {
  stroke: #555;
  stroke-width: 1.5px;
  cursor: pointer;
  fill: #0077cc;
  transition: transform 0.2s, stroke-width 0.2s, fill 0.2s;
}

.node:hover {
  transform: scale(1.15);
  stroke-width: 2.5px;
  fill: #ff6600;
}

.dimmed {
  opacity: 0.2;
  transition: opacity 0.2s ease-in-out;
}

.highlight {
  opacity: 1;
  stroke: black;
  stroke-width: 2px;
}

svg {
  display: block;
  width: 100%;
  height: 100%;
  background-color: #f0f0f0;
}

.scorecard {
  padding: 20px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  min-width: 400px;
  min-height: 600px;
  max-height: 80vh;
  overflow-y: scroll;
  position: absolute;
  z-index: 100;
}

#scorecard {
  top: 20px;
  left: 20px;
}

#scorecard-right {
  top: 20px;
  right: 20px;
  font-size: 12px;
  max-height: 90vh;
  overflow-y: scroll;
}

#scorecard-list,
#tooltip-scorecard-list {
  list-style: none;
  padding: 0;
}

#claude-analysis-section {
  display: none;
  margin-top: 15px;
}

#analyze-node-button {
  display: block;
  margin: 0px auto 25px;
  padding: 4px 6px;
}

.legend-box {
  position: absolute;
  bottom: 20px;
  left: 20px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 10px 12px;
  font-size: 13px;
  width: 400px;
  z-index: 200;
}

.legend-box h4 {
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: bold;
  text-align: center;
}

.legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
}

.legend-list li {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 3px 0;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.legend-list li:hover {
  background-color: #f0f0f0;
}

.legend-list li.active {
  background-color: #0077cc;
  color: #fff;
  font-weight: bold;
}

.key-hint {
  display: inline-block;
  height: 22px;
  line-height: 22px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fafafa;
  color: #333;
  font-weight: bold;
  font-size: 12px;
  margin-right: 6px;
  padding: 0px 4px;
}

.legend-list li.active .key-hint {
  background-color: #fff;
  color: #0077cc;
  border-color: #fff;
}

.scorecard-search {
  display: flex;
  gap: 0.4rem;
  margin: 0.4rem 0 0.8rem 0;
}

#node-search {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #ffffff;
  color: #e2e8f0;
  outline: none;
}

#node-search::placeholder {
  color: black;
}

#node-search-clear {
  padding: 0 0.55rem;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #111827;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
#node-search-clear:hover {
  background: #1f2937;
}
