.forecast-history { margin-top: 40px; }
.forecast-history-header { padding-top: 18px; }
.forecast-history-header h2 { margin: 0; }
.forecast-history-chart-wrap {
  position: relative;
  width: 100%;
  margin-top: 14px;
  overflow: hidden;
}
.forecast-history-chart {
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  overflow: visible;
  color: var(--ink, #f4f4f4);
}
.forecast-history-chart[hidden] { display: none; }
.forecast-history-axis text,
.forecast-history-x-label {
  fill: var(--muted, #9ea4aa);
  font-family: Roboto, Arial, sans-serif;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.forecast-history-grid-line { stroke: var(--rule-faint, #373b3f); stroke-width: 1; }
.forecast-history-zero-line { stroke: var(--muted, #9ea4aa); stroke-dasharray: 3 4; stroke-width: 1; }
.forecast-history-axis-line { stroke: var(--rule, #555b60); stroke-width: 1; }
.forecast-history-series {
  fill: none;
  stroke: var(--blue, #2672a9);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.forecast-history-point { fill: var(--blue, #2672a9); stroke: var(--bg, #121212); stroke-width: 2; vector-effect: non-scaling-stroke; }
.forecast-history-point-hit { fill: transparent; stroke: transparent; stroke-width: 2; cursor: pointer; }
.forecast-history-point-hit:focus-visible { stroke: var(--ink, #f4f4f4); outline: none; }
.forecast-history-tooltip {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  width: max-content;
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--rule, #555b60);
  border-radius: 6px;
  background: var(--panel, #202326);
  box-shadow: 0 8px 24px rgb(0 0 0 / 35%);
  color: var(--ink, #f4f4f4);
  font-family: Roboto, Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  pointer-events: none;
}
.forecast-history-tooltip[hidden] { display: none; }
.forecast-history-tooltip > strong { display: block; margin-bottom: 7px; }
.forecast-history-tooltip dl { display: grid; grid-template-columns: minmax(120px, 1fr) auto; gap: 3px 12px; margin: 8px 0 0; }
.forecast-history-tooltip dt { color: var(--muted, #9ea4aa); }
.forecast-history-tooltip dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.forecast-history-weight-strip { display: flex; width: 100%; height: 7px; margin-top: 5px; overflow: hidden; border-radius: 4px; background: var(--rule-faint, #373b3f); }
.forecast-history-weight-strip span:first-child { background: var(--blue, #2672a9); }
.forecast-history-weight-strip span:last-child { background: var(--red, #c54a45); }
.forecast-history-details { margin-top: 6px; border-top: 1px solid var(--rule-faint, #373b3f); }
.forecast-history-details summary { width: fit-content; padding: 12px 0; color: var(--blue, #2672a9); cursor: pointer; font-size: 14px; font-weight: 700; }
.forecast-history-details summary:focus-visible,
.forecast-history-table-wrap:focus-visible { outline: 2px solid var(--blue, #2672a9); outline-offset: 3px; }
.forecast-history-table-wrap { max-width: 100%; overflow-x: auto; }
.forecast-history-table { width: 100%; min-width: 610px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.forecast-history-table th,
.forecast-history-table td { padding: 9px 12px; border-top: 1px solid var(--rule-faint, #373b3f); text-align: right; white-space: nowrap; }
.forecast-history-table th:first-child,
.forecast-history-table td:first-child { padding-left: 0; text-align: left; }
.forecast-history-table th { color: var(--muted, #9ea4aa); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.forecast-history-margin-dem { color: var(--blue, #2672a9); }
.forecast-history-margin-rep { color: var(--red, #c54a45); }
.forecast-history-margin-even { color: var(--muted, #9ea4aa); }
.win-probability { margin-bottom: 0; }
.win-probability + .forecast-history { margin-top: 24px; }
.win-probability-legend[hidden], .win-probability-chart-wrap[hidden] { display: none; }
.win-probability-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 0; padding: 0; color: var(--muted, #9ea4aa); font-size: 12px; list-style: none; }
.win-probability-legend li { display: inline-flex; align-items: center; gap: 7px; }
.win-probability-swatch { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.win-probability-swatch-dem { background: var(--blue, #2672a9); }
.win-probability-swatch-rep { background: var(--red, #c54a45); }
.win-probability-swatch-ind { background: var(--purple, #b58cff); }
.win-probability-chart { touch-action: manipulation; }
.win-probability-grid-line { stroke: var(--rule-faint, #373b3f); stroke-width: 1; }
.win-probability-half-line { stroke: var(--muted, #9ea4aa); stroke-width: 1.5; }
.win-probability-election-line { stroke: var(--muted, #9ea4aa); stroke-dasharray: 3 4; stroke-width: 1; }
.win-probability-election-label { fill: var(--muted, #9ea4aa); font-family: Roboto, Arial, sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.win-probability-series { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; vector-effect: non-scaling-stroke; }
.win-probability-series-dem { stroke: var(--blue, #2672a9); }
.win-probability-series-rep { stroke: var(--red, #c54a45); }
.win-probability-series-ind { stroke: var(--purple, #b58cff); }
.win-probability-series-other { stroke: var(--muted, #d0a868); }
.win-probability-point-dem { fill: var(--blue, #2672a9); }
.win-probability-point-rep { fill: var(--red, #c54a45); }
.win-probability-point-ind { fill: var(--purple, #b58cff); }
.win-probability-point-other { fill: var(--muted, #d0a868); }
.win-probability-point { stroke: var(--bg, #121212); stroke-width: 2; vector-effect: non-scaling-stroke; }
.win-probability-point-latest { stroke-width: 2.5; }
.win-probability-point-hit { fill: transparent; stroke: transparent; stroke-width: 2; cursor: pointer; }
.win-probability-point-hit:focus-visible { stroke: var(--ink, #f4f4f4); outline: none; }
.win-probability-latest-label { font-family: Roboto, Arial, sans-serif; font-size: 14px; font-weight: 700; paint-order: stroke; stroke: var(--bg, #121212); stroke-linejoin: round; stroke-width: 4px; }
.win-probability-label-dem { fill: var(--blue, #2672a9); }
.win-probability-label-rep { fill: var(--red, #c54a45); }
.win-probability-label-ind { fill: var(--purple, #b58cff); }
.win-probability-label-other { fill: var(--muted, #d0a868); }
.win-probability-tooltip { min-width: 240px; }
.win-probability-tooltip .win-probability-dem { color: var(--blue, #2672a9); font-weight: 700; }
.win-probability-tooltip .win-probability-rep { color: var(--red, #c54a45); font-weight: 700; }
.win-probability-tooltip .win-probability-ind { color: var(--purple, #b58cff); font-weight: 700; }
@media (max-width: 600px) {
  .forecast-history { margin-top: 32px; }
  .win-probability + .forecast-history { margin-top: 20px; }
  .forecast-history-chart-wrap { margin-top: 8px; }
  .win-probability-latest-label { font-size: 11px; }
  .win-probability-election-label { font-size: 8px; }
  .forecast-history-tooltip { max-width: min(320px, calc(100vw - 24px)); padding: 10px 12px; }
  .forecast-history-tooltip dl { grid-template-columns: minmax(108px, 1fr) auto; gap: 3px 8px; }
}


/* Compact, unified forecast-history panel. */
.forecast-history { margin-top: 20px; }
.forecast-history-header { padding: 10px 0 8px; }
.forecast-history-header .eyebrow { color: #ff923d; }
.forecast-history-chart-wrap { margin-top: 8px; }
.forecast-history-probability {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--rule-faint, #373b3f);
}
.win-probability-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.win-probability-status {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--muted, #9ea4aa);
  font-size: 12px;
}
.forecast-history-probability .win-probability-legend {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 6px 14px;
  margin: 0;
}
.forecast-history-probability .win-probability-chart-wrap { margin-top: 6px; }
.forecast-history-details { margin-top: 8px; }
.forecast-history-details summary { padding: 8px 0; }
@media (max-width: 600px) {
  .forecast-history { margin-top: 16px; }
  .forecast-history-header { padding-top: 8px; }
  .forecast-history-probability { margin-top: 8px; padding-top: 8px; }
  .win-probability-meta { align-items: flex-start; flex-direction: column; gap: 4px; }
  .forecast-history-probability .win-probability-legend { justify-content: flex-start; }
  .forecast-history-probability .win-probability-chart-wrap { margin-top: 2px; }
}
