.weportal-petal-chart {
  position: relative;
  display: grid;
  width: min(100%, 440px);
  aspect-ratio: 1;
  place-items: center;
}

.weportal-petal-chart__tooltip {
  position: absolute;
  z-index: var(--layer-popover, 30);
  display: flex;
  width: max-content;
  max-width: min(260px, calc(100% - 16px));
  padding: 10px 12px;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  visibility: hidden;
  color: var(--foreground);
  background: var(--surface);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transition:
    opacity 90ms ease,
    visibility 90ms ease;
}

.weportal-petal-chart__tooltip.is-visible {
  visibility: visible;
  opacity: 1;
}

.weportal-petal-chart__tooltip-name {
  overflow: hidden;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weportal-petal-chart__tooltip-balance,
.weportal-petal-chart__tooltip-recent {
  color: var(--muted-foreground);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
  white-space: nowrap;
}

.weportal-petal-chart__svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.weportal-petal-chart__track {
  fill: var(--petal-used);
  cursor: pointer;
  stroke: none;
}

.weportal-petal-chart__rose {
  fill: var(--petal-remaining);
  pointer-events: none;
  stroke: none;
}

.weportal-petal-chart__rose.is-empty {
  opacity: 0;
}

.weportal-petal-chart__label-layer {
  pointer-events: none;
}

.weportal-petal-chart__value,
.weportal-petal-chart__name {
  fill: var(--petal-used-label);
  font-family: var(--font-sans, sans-serif);
  paint-order: stroke;
  stroke: var(--petal-used);
  stroke-linejoin: round;
  stroke-width: 3px;
  text-anchor: middle;
}

.weportal-petal-chart__name {
  font-size: 9.5px;
  font-weight: 600;
}

.weportal-petal-chart__value {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.weportal-petal-chart__label.is-on-fill .weportal-petal-chart__value,
.weportal-petal-chart__label.is-on-fill .weportal-petal-chart__name {
  fill: var(--petal-text);
  stroke: rgba(255, 255, 255, 0.86);
}

.weportal-petal-chart__label.is-compact .weportal-petal-chart__value {
  font-size: 13px;
}

.weportal-petal-chart__label.is-compact .weportal-petal-chart__name {
  font-size: 8px;
}

.weportal-petal-chart__label.is-narrow .weportal-petal-chart__value {
  font-size: 9px;
}

.weportal-petal-chart__label.is-narrow .weportal-petal-chart__name {
  font-size: 7px;
}

.weportal-petal-chart__track.is-active,
.weportal-petal-chart__rose.is-active {
  filter: saturate(1.08) brightness(0.97);
}

.weportal-petal-chart__track:focus {
  outline: none;
}

.weportal-petal-chart__track:focus-visible {
  filter: drop-shadow(0 0 2px var(--petal-used));
}

.weportal-petal-chart__empty {
  fill: var(--muted-foreground, #6b7280);
  font-family: var(--font-sans, sans-serif);
  font-size: 13px;
  text-anchor: middle;
}

@media (prefers-reduced-motion: reduce) {
  .weportal-petal-chart__tooltip {
    transition: none;
  }
}
