*{ box-sizing:border-box; }

html, body{
  margin:0;
  padding:0;
  overflow-y:hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background:#fff;
  color:#111;
  height: auto;
}

.viz{
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 14px 28px;
}

.page-title{
  font-size: 28px;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
}

.rule{
  height: 4px;
  background:#111;
  margin-bottom: 14px;
}

.controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom: 14px;
}

button{
  border:1px solid #c5caca;
  background:#E2E9E9;
  color:#495050;
  padding:10px 12px;
  border-radius:10px;
  font:300 14px Roboto, sans-serif;
  cursor:pointer;
}

button:hover{
  background:#8F9797;
  color:#fff;
  transition:0.12s;
}

.layout{
  display:block;
}

.copy{
  max-width: 520px;
}

.title{
  font-family:'Roboto Slab', serif;
  font-weight:700;
  font-size: 26px;
  line-height: 1.15;
  margin: 6px 0 10px;
}

.text{
  font-family:'Roboto Slab', serif;
  font-weight:300;
  font-size: 15px;
  line-height:1.45;
  margin:0 0 18px;
}

.legend{
  margin-top: 8px;
}

.legend-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom: 10px;
}

.dot{
  width: 14px;
  height: 14px;
  border-radius:50%;
  background:#bbb;
  border:1px solid #333;
  display:inline-block;
}

.legend-dot{ background:#bbb; }

.legend-label{ color:#444; }

.legend-scale{
  display:flex;
  gap:14px;
  margin: 8px 0 6px;
}

.swatch{
  width: 120px;
  height: 14px;
  display:inline-block;
}

.green{ background:#2ca02c; }
.orange{ background:#f0ad1a; }
.red{ background:#ff3b1f; }

.legend-caption{
  color:#444;
}

.chart svg{
  width: 100%;
  height: auto;
  display:block;
}

/* desktop: two columns like your screenshots */
@media (min-width: 980px){
  .layout{
    display:flex;
    gap: 26px;
    align-items:flex-start;
  }
  .chart{
    flex: 1;
    min-width: 0;
  }
}

/* tooltip */
.tooltip{
  position: fixed;
  pointer-events:none;
  padding: 6px 8px;
  font: 12px Roboto, sans-serif;
  color:#E2E9E9;
  border:1px solid #8F9797;
  border-radius:10px;
  opacity:0;
  max-width: 280px;
  transform: translate(10px, -10px);
}
.chart{
  display: flex;
  justify-content: center;
}

.chart svg{
  margin: 0 auto;
}
button.active{
  background: #8F9797;
  color: #fff;
}
