/* ---- Experimental / Structural Map panel ---- */

#xp-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.xp-card {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 10px 12px;
}

.xp-card-title {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #555;
  margin-bottom: 8px;
}

/* County summary KPI row */
.xp-kpi-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.xp-kpi {
  flex: 1 1 80px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 6px 8px;
  text-align: center;
}

.xp-kpi-value {
  font-size: 1rem;
  font-weight: 700;
  color: #222;
}

.xp-kpi-label {
  font-size: 0.7rem;
  color: #777;
  margin-top: 2px;
}

/* Structural class breakdown rows */
.xp-class-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.82rem;
}

.xp-class-row:last-child {
  border-bottom: none;
}

.xp-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.15);
}

.xp-class-name {
  flex: 1;
  color: #333;
}

.xp-class-count {
  color: #777;
  font-size: 0.78rem;
}

/* Tract detail */
.xp-tract-placeholder {
  color: #999;
  font-size: 0.82rem;
  font-style: italic;
}

.xp-tract-header {
  margin-bottom: 8px;
}

.xp-tract-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #222;
}

.xp-class-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  margin-top: 3px;
}

.xp-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 0.82rem;
  border-bottom: 1px solid #f5f5f5;
}

.xp-detail-row:last-child {
  border-bottom: none;
}

.xp-detail-label {
  color: #666;
}

.xp-detail-value {
  font-weight: 500;
  color: #222;
}

/* Pressure score bar */
.xp-pressure-bar {
  flex: 1;
  height: 6px;
  background: #eee;
  border-radius: 3px;
  margin: 0 8px;
  overflow: hidden;
}

.xp-pressure-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(to right, #fee08b, #d73027);
}

/* Income distribution stacked bar */
.xp-income-bar {
  display: flex;
  height: 14px;
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0 4px;
}

.xp-income-seg {
  height: 100%;
  transition: opacity 0.1s;
}

.xp-income-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 4px;
}

.xp-income-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: #555;
}

.xp-income-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Party shift + ANOVA table */
.xp-shift-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.xp-shift-table th {
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #ddd;
  padding: 3px 4px;
}

.xp-shift-table td {
  padding: 3px 4px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

.xp-shift-table tr:last-child td {
  border-bottom: none;
}
.xp-precinct-row:hover td {
  background: #e8f4ff;
}
.xp-precinct-row.is-highlighted td {
  background: #00e5ff18;
  font-weight: 700;
  outline: 2px solid #00e5ff;
}

/* Accordion sections */
.xp-accordion-header {
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.xp-accordion-header:hover {
  color: #333;
}

.xp-chevron {
  font-size: 0.65rem;
  color: #aaa;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.xp-accordion.collapsed .xp-accordion-body {
  display: none;
}

.xp-accordion.collapsed .xp-chevron {
  transform: rotate(-90deg);
}
