.tooltip {
  position: absolute; 
  background-color: rgba(255, 255, 255, 0.98);
  border: 1px solid #ddd;
  padding: 12px;
  border-radius: 6px;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  z-index: 100;
  min-width: 140px;

  pointer-events: none;
}

#polling-chart .y-axis .tick:first-of-type line {
    display: none;
}

#polling-chart .x-axis .domain {
    display: block;
    stroke: #181818 !important;
    stroke-width: 2px;
}

.line {
  fill: none;
  stroke-width: 2.5px;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.party-fdi { stroke: #042356; color: #042356; }    
.party-pd  { stroke: #e31e24; color: #e31e24; }  
.party-m5s { stroke: #eec422; color: #eec422; } 
.party-lega { stroke: #008f39; color: #008f39; } 
.party-fi  { stroke: #0087dc; color: #0087dc; } 
.party-a  { stroke: #0047AB; color: #0047AB; } 
.party-iv  { stroke: #E91E63; color: #E91E63; }
.party-avs { stroke: #a70505; color: #a70505; }
.party-peu { stroke: #f19f35; color: #f19f35; }
.party-fn { stroke: #1d1f1d; color: #1d1f1d; }
.party-nm { stroke: #7ccdff; color: #7ccdff; }

.party-dx { stroke: #397a94; color: #397a94; } 
.party-csx { stroke: #d73129; color: #d73129; } 

.party-card.fdi { background: #042356; color:white }
.party-card.pd  { background: #e31e24; }
.party-card.m5s { background: #eec422; }
.party-card.lega { background: #008f39; }
.party-card.fi  { background: #0087dc; }
.party-card.avs { background: #a70505; }
.party-card.a  { background: #0047AB; }  
.party-card.iv  { background: #E91E63; }
.party-card.avs { background: #a70505; }
.party-card.peu { background: #f19f35; }
.party-card.fn { background: #1d1f1d; }
.party-card.nm { background: #7ccdff; }

#polling-chart-container {
  width: 100%;
  max-width: 100%; 
  position: relative;
}

#polling-chart {
  width: 100%;
  height: auto;
  display: block;
}

@media (max-width: 600px) {
  .tooltip {
    font-size: 16px;
    padding: 8px;
  }
}

.guide-line {
  stroke: #999;
  stroke-width: 1px;
  stroke-dasharray: 4,4;
  pointer-events: none;
}

.party-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  justify-content: center;
}

.party-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 8px 4px;
  min-width: 60px;
  flex: 1 1 calc(15% - 12px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  text-align: center;
  flex-grow: 0;
}

.party-card .party-name {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--parian-marble);
  margin-bottom: 4px;
  text-transform: uppercase;
  border-bottom: 1px;
  height: 30%;
}

.party-card .party-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--parian-marble);
  height: 40%;
}

@media (max-width: 600px) {
  .party-card {
    flex: 0 1 calc(30% - 10px);
  }
}

.party-trend {
  display: block;
  font-size: 0.85rem;
  margin-top: 4px;
  font-weight: 600;
}

.change {
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 5px
}

.trend-up { color: var(--parian-marble); }
.trend-down { color: var(--parian-marble); } 
.trend-equal { color: var(--parian-marble); }

.trend-up::before { content: '▲ '; font-size: 0.7rem; }
.trend-down::before { content: '▼ '; font-size: 0.7rem; }