.senate-map-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    font-family: 'Merriweather', serif;
}

.senate-map-svg {
    width: 100%;
    height: auto;
    display: block;
}

/* Ensure we override specific state classes if they exist in SVG */
.senate-map-svg g.state path {
    stroke: #ffffff;
    stroke-width: 1;
    transition: fill 0.2s ease, stroke 0.2s ease;
    cursor: pointer;
    fill: #e0e0e0; /* Default neutral */
}

.senate-map-svg g.state path:hover {
    stroke: #333;
    stroke-width: 2;
    z-index: 10;
    filter: brightness(0.95);
}

.senate-tooltip {
    position: absolute;
    display: none;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ccc;
    padding: 12px;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    font-family: 'Merriweather', serif;
    font-size: 13px;
    pointer-events: none;
    z-index: 100;
    min-width: 160px;
    text-align: left;
    color: #333;
}

.senate-tooltip h4 {
    margin: 0 0 8px;
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
    color: #121212;
}

.senate-tooltip .prob-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.dem-text { color: #0056b3; font-weight: bold; }
.rep-text { color: #c82333; font-weight: bold; }

.senate-controls {
    margin: 20px 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.senate-controls label {
    font-weight: bold;
    margin-right: 5px;
}

.senate-controls select {
    padding: 8px 12px;
    font-size: 16px;
    font-family: 'Merriweather', serif;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
}

.senate-legend {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    font-size: 12px;
    gap: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-color {
    width: 15px;
    height: 15px;
    display: inline-block;
    border-radius: 2px;
}

/* Senate Bar Chart Styles */
.senate-bar-chart-wrapper {
    width: 100%;
    margin-bottom: 20px;
    font-family: 'Merriweather', serif;
}

.senate-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: bold;
}

.party-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.party-name {
    font-size: 18px;
}

.dem .party-name { color: #0056b3; }
.rep .party-name { color: #c82333; }

.party-total {
    font-size: 24px;
    min-width: 30px;
    text-align: center;
}

.dem .party-total { color: #0056b3; }
.rep .party-total { color: #c82333; }

.party-breakdown {
    display: flex;
    gap: 4px;
    font-size: 14px;
}

.count-box {
    padding: 2px 6px;
    border-radius: 2px;
    color: #fff;
    min-width: 18px;
    text-align: center;
    font-weight: normal;
}

.count-box:empty {
    display: none;
}

.dem .count-box.solid { background-color: #0056b3; }
.dem .count-box.tilt { background-color: #5aa2d8; }
.dem .count-box.ind { background-color: #7b2cbf; }

.rep .count-box.solid { background-color: #c82333; }
.rep .count-box.tilt { background-color: #e66a6a; }


.senate-bar-chart {
    display: flex;
    width: 100%;
    height: 35px;
    background-color: #f0f0f0;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

.bar-segment {
    height: 100%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    overflow: hidden;
    white-space: nowrap;
}

/* Segment Colors */
.dem-not-up { background-color: #102b57; }
.dem-safe   { background-color: #1d4e9e; }
.dem-likely { background-color: #5aa2d8; }
.dem-lean   { background-color: #8ec3eb; color: #333; }
.dem-tilt   { background-color: #c1dcf5; color: #333; }
.ind-not-up { background-color: #7b2cbf; }

.tossup     { background-color: #C9C19B; color: #333; }

.rep-tilt   { background-color: #f4d2d2; color: #333; }
.rep-lean   { background-color: #f0a1a1; color: #333; }
.rep-likely { background-color: #e66a6a; }
.rep-safe   { background-color: #c82333; }
.rep-not-up { background-color: #8a101d; }

.majority-marker {
    position: absolute;
    left: 50%;
    top: -5px;
    bottom: -5px;
    width: 2px;
    background-color: #333;
    z-index: 10;
}

/* Triangle marker top/bottom */
.majority-marker::before {
    content: '';
    position: absolute;
    top: 0;
    left: -5px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #333;
}

.majority-marker::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -5px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #333;
}


.senate-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  transform: translateX(20px);
}
