* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}

body {
  background: #ffffff;
  color: #231f20;
  font-family: 'Utopia Std', serif;
  overflow: hidden;
}

.page {
  width: min(1180px, 94vw);
  height: 100vh;
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.intro {
  max-width: 820px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 4.4rem);
  line-height: 0.9;
  font-family: 'Utopia Std Bold', serif;
  letter-spacing: -0.06em;
}

h3 {
  margin: 8px 0 0;
  font-size: clamp(0.9rem, 1.45vw, 1.25rem);
  line-height: 1.25;
  font-weight: 400;
  color: #3d342d;
}

.dek {
  max-width: 720px;
  margin: 10px 0 0;
  font-size: clamp(0.7rem, 1.2vw, 0.9rem);
  line-height: 1.4;
  color: #4a4038;
}

.viz-card {
  flex: 1;
  min-height: 0;
  background: #fffaf2;
  border: 1px solid rgba(35, 31, 32, 0.16);
  border-radius: 20px;
  padding: 16px 18px 14px;
  box-shadow: 0 18px 45px rgba(35, 31, 32, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 9px 20px;
  background: #231f20;
  color: #fcfcfc;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #e75303;
}

.slider-wrap {
  width: 100%;
}

input[type="range"] {
  width: 100%;
  accent-color: #e75303;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  font-family: Arial, Helvetica, sans-serif;
  color: #5f554c;
  font-size: 0.82rem;
}

#currentYear {
  color: #231f20;
  font-size: 1.15rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.stats div {
  border-top: 1px solid rgba(35, 31, 32, 0.18);
  padding-top: 7px;
}

.stat-label {
  display: block;
  margin-bottom: 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e75303;
}

.stats strong {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(0.9rem, 1.6vw, 1.25rem);
}

.chart-subtitle {
  width: 100%;
  margin: 2px 0 5px;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  line-height: 1.25;
  color: #5f554c;
  flex-shrink: 0;
}

#chart {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

svg {
  display: block;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.rep-fixed-label {
  position: absolute;
  left: 50%;
  top: calc(50% + 44px);
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  line-height: 1.25;
  color: #5f554c;
  white-space: nowrap;
}

.rep-icon {
  fill: #231f20;
}

.citizen-dot {
  fill: #e75303;
  opacity: 0.1;
}

.year-title {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  fill: #231f20;
}

.subtitle {
  font-family: Arial, Helvetica, sans-serif;
  fill: #5f554c;
}

.note {
  margin: 6px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  color: #6c6258;
  line-height: 1.25;
  flex-shrink: 0;
}

.dot-number {
  color: #e75303;
  font-weight: 700;
}

@media (max-width: 900px) {
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  h3 {
    font-size: 1rem;
  }
}

@media (max-width: 760px) {
  .page {
    width: 96vw;
    padding: 8px 0;
  }

  .intro {
    margin-bottom: 8px;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  h3 {
    margin: 6px 0 0;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .viz-card {
    padding: 10px;
    border-radius: 14px;
  }

  .controls {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-bottom: 8px;
  }

  button {
    width: 100%;
    padding: 7px 14px;
    font-size: 0.78rem;
  }

  .slider-labels {
    margin-top: 3px;
    font-size: 0.72rem;
  }

  #currentYear {
    font-size: 1rem;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
    margin-bottom: 5px;
  }

  .stats div {
    padding-top: 5px;
  }

  .stat-label {
    font-size: 0.54rem;
    margin-bottom: 2px;
  }

  .stats strong {
    font-size: 0.78rem;
  }

  .chart-subtitle {
    margin: 2px 0 4px;
    font-size: 0.72rem;
  }

  .rep-fixed-label {
    top: calc(50% + 36px);
    font-size: 0.72rem;
  }

  .note {
    margin: 5px 0 0;
    font-size: 0.62rem;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 1.9rem;
  }

  h3 {
    font-size: 0.75rem;
  }

  .stats strong {
    font-size: 0.72rem;
  }

  .note {
    font-size: 0.58rem;
  }
}