:host {
  display: block;
}

.ph-controls {
  display: inline-flex;
  gap: 0.375rem;
  margin-bottom: 1rem;
  padding: 0.3rem;
  border: 2px solid #e2e8f0;
  border-radius: 4px;
  background-color: #f1f5f9;
}

button {
  white-space: nowrap;
  padding: 0.3rem 0.6rem;
  border: 2px solid transparent;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: inherit;
  background-color: transparent;
  color: #314258;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.1s;
}

button.active {
  background-color: #0f172c;
  color: #fff;
  border-color: #0f172c;
}

button:hover:not(.active) {
  background: #f3f4f6;
}

.ph-wrap {
  position: relative;
  width: 100%;
}

.ph-no-data {
  padding: 1.5rem 0;
  color: #6b7280;
  font-size: inherit;
  text-align: center;
}

.ph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.875rem;
  margin-top: 0.5rem;
  justify-content: center;
}

.ph-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 1rem;
  color: #6b7280;
}

.ph-tooltip {
  position: absolute;
  background: #111827;
  color: #fff;
  font-size: 0.75rem;
  border-radius: 4px;
  padding: 0.3rem 0.55rem;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  transform: translate(-50%, calc(-100% - 10px));
}

.ph-tooltip-date {
  font-weight: 500;
  margin-bottom: 0.1rem;
}

.ph-tooltip-row {
  color: #d1d5db;
}

svg {
  display: block;
  overflow: visible;
}

circle {
  cursor: default;
}
