:root {
  --ww-blue: #2f6f9f;
  --ww-orange-light: #f2b36f;
  --ww-orange-dark: #c95f18;
  --ww-light-gray: #CCCCCC;
  --ww-text: #222222;
  --ww-muted: #666666;
  --ww-background: #ffffff;
  --ww-axis: #bcbcbc;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: var(--ww-background);
}

body {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: var(--ww-background);
  color: var(--ww-text);
  font-family: "Heebo", sans-serif;
}

button,
input,
select,
textarea,
svg text {
  font-family: "Heebo", sans-serif;
}

.page {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 60px;
}

.header {
  max-width: 820px;
  margin-bottom: 28px;
  text-align: left;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dek {
  max-width: 780px;
  margin: 0;
  color: var(--ww-muted);
  font-size: 17px;
  line-height: 1.5;
}

.legend {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin: 24px 0 36px;
  font-size: 14px;
  font-weight: 500;
}

.legend-item {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  min-width: 14px;
  border-radius: 2px;
}

.legend-swatch.granted {
  background: var(--ww-blue);
}

.legend-swatch.dismissed {
  background: var(--ww-orange-light);
}

.legend-swatch.denied {
  background: var(--ww-orange-dark);
}

.legend-swatch.open {
  background: var(--ww-light-gray);
}

.chart-section {
  width: 100%;
  margin-top: 48px;
}

.chart-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.chart-subtitle {
  max-width: 760px;
  margin: 5px 0 18px;
  color: var(--ww-muted);
  font-size: 14px;
  line-height: 1.45;
}

.chart-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.chart-container svg {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.axis text {
  fill: var(--ww-muted);
  font-family: "Heebo", sans-serif;
  font-size: 12px;
}

.axis path,
.axis line {
  stroke: var(--ww-axis);
}

.axis-title {
  fill: var(--ww-muted);
  font-family: "Heebo", sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.judge-label {
  fill: #333333;
  font-family: "Heebo", sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.bar-segment {
  pointer-events: none;
  transition:
    opacity 120ms ease,
    filter 120ms ease;
}

.interaction-rect {
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
}

.chart-container.has-hover .bar-segment {
  opacity: 0.42;
}

.chart-container.has-hover .bar-segment.is-hovered-segment {
  opacity: 1;
  filter: brightness(0.96);
}

.tooltip {
  position: fixed;
  z-index: 1000;
  min-width: 210px;
  max-width: min(260px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 14px));
  transition: opacity 80ms linear;
  font-family: "Heebo", sans-serif;
}

.tooltip.visible {
  opacity: 1;
}

.tooltip-title {
  margin-bottom: 7px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.tooltip-court {
  margin-bottom: 9px;
  color: var(--ww-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 13px;
  line-height: 1.55;
}

.tooltip-row.total {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #dedede;
  font-weight: 700;
}

.tooltip-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.source {
  margin-top: 46px;
  color: var(--ww-muted);
  font-size: 12px;
  line-height: 1.4;
}

.error-message {
  margin-top: 20px;
  padding: 14px;
  border-left: 4px solid var(--ww-orange-dark);
  background: #fff5e9;
  color: #5f3b13;
  font-size: 14px;
}

@media (max-width: 700px) {
  .page {
    width: calc(100% - 20px);
    padding: 24px 0 36px;
  }

  h1 {
    font-size: 29px;
  }

  .dek {
    font-size: 16px;
  }

  .legend {
    gap: 8px 14px;
    margin-bottom: 32px;
  }

  .chart-section {
    margin-top: 40px;
  }

  .chart-title {
    font-size: 21px;
  }

  .chart-subtitle {
    margin-bottom: 14px;
  }

  .judge-label {
    font-size: 11px;
  }

  .axis text {
    font-size: 11px;
  }

  .tooltip {
    min-width: 195px;
  }
}

@media (max-width: 420px) {
  .page {
    width: calc(100% - 16px);
  }

  h1 {
    font-size: 27px;
  }

  .legend {
    font-size: 13px;
  }

  .chart-title {
    font-size: 20px;
  }
}