html,
body {
  height: 100%;
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  color: #111;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 5;
}

.tab-btn {
  border: 1px solid #ccc;
  background: #f9f9f9;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.tab-btn[aria-selected='true'] {
  background: #111;
  color: #fff;
  border-color: #111;
}

.panels {
  height: calc(100% - 48px);
}

.panel {
  display: none;
  height: 100%;
}

.panel.active {
  display: block;
}

/* Reaction */
.reaction-wrap {
  height: 100%;
  position: relative;
}

.reaction-search {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.reaction-search input {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 220px;
}

.reaction-legend {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 14px;
}

#reactionSvg {
  width: 100%;
  height: 100%;
  display: block;
  background: #fff;
}

.edge {
  fill: none;
  stroke: #999;
  stroke-width: 1.2;
}

.edge-label {
  font-size: 11px;
  fill: #111;
  paint-order: stroke fill;
  stroke: #fff;
  stroke-width: 2px;
}

.node .label {
  font-size: 12px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke fill;
  stroke: #fff;
  stroke-width: 3px;
  fill: #111;
}

.highlight circle,
.highlight rect {
  stroke: #ff4081 !important;
  stroke-width: 3 !important;
}

.edge.edge-highlight {
  stroke: #ff4081 !important;
  stroke-width: 2.4 !important;
}

/* DAG */
.dag-topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e5e5;
}

.dag-wrap {
  height: calc(100% - 52px);
  position: relative;
}

#dagSvg {
  width: 100%;
  height: 100%;
  display: block;
  background: #fff;
}

.link {
  fill: none;
  stroke: #888;
  stroke-width: 1.4;
}

.link.back {
  stroke-dasharray: 4 3;
  stroke: #aaa;
}

.node circle,
.node rect,
.node polygon {
  stroke: #222;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.notice {
  color: #b00;
  font-size: 12px;
}

/* Specimens legend */
.dag-legend {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 14px;
}

/* Tooltip */
.tip {
  position: fixed;
  pointer-events: none;
  background: rgba(30, 30, 30, 0.96);
  color: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.12s ease;
  max-width: 320px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.pill {
  display: inline-block;
  font-size: 11px;
  background: #222;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}
