.bottom-nav {
  display: flex !important;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: flex-start;
  gap: 6px;
  grid-template-columns: none !important;
}

.bottom-nav::-webkit-scrollbar {
  display: none;
}

.bottom-nav button {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 4px;
  font-size: 12px;
}

.hidden {
  display: none !important;
}

.races-list {
  display: grid;
  gap: 16px;
}

.race-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(0, 56, 101, 0.05);
  transition: border-color 0.2s ease;
}

.race-card:hover {
  border-color: var(--accent-2);
}

.race-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.race-title {
  margin: 0;
  font-size: 18px;
}

.race-meta {
  color: var(--muted);
  font-size: 13px;
}

.candidates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.candidate-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--paper);
  border-radius: 6px;
  font-size: 14px;
}

.candidate-name {
  font-weight: 700;
}

.candidate-party {
  font-size: 12px;
  color: var(--muted);
  background: var(--soft);
  padding: 2px 6px;
  border-radius: 4px;
}

.polls-section, .forecast-section {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.polls-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.poll-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fbfdff;
  font-size: 13px;
}

.poll-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 8px;
}

.poll-stats {
  display: flex;
  gap: 16px;
  color: var(--muted);
  margin-bottom: 8px;
}

.poll-shares {
  display: flex;
  gap: 12px;
}

.poll-share {
  background: var(--soft);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.forecast-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  background: var(--paper);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-group label {
  margin-bottom: 0;
}

.control-group small {
  font-size: 11px;
  color: var(--muted);
}

.forecast-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.runs-grid {
  display: grid;
  gap: 16px;
}

.run-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: 0 4px 12px rgba(0, 56, 101, 0.05);
}

.run-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.run-title {
  margin: 0 0 4px 0;
  font-size: 16px;
}

.run-date {
  color: var(--muted);
  font-size: 12px;
}

.run-race {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
}

.run-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-box {
  background: var(--paper);
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
}

.stat-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.model-badge,
.uncalibrated-badge,
.benchmark-only-label {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.model-badge {
  margin: 0 6px 8px 0;
  color: var(--muted);
  background: var(--paper);
}

.model-badge-ai-population {
  color: #175b49;
  background: #e8f5ef;
  border-color: #b8dfcf;
}

.model-badge-fitted {
  background: #e8f4ea;
  color: #1f6b3a;
  border: 1px solid #b7dcc0;
}

.model-badge-ai-led {
  color: #624d15;
  background: #fff7dc;
  border-color: #ead79a;
}

.model-badge-stat {
  color: var(--muted);
}

.benchmark-only-label {
  color: #7a3218;
  background: #fff0e8;
  border-color: #e6b59a;
  margin-right: 4px;
}

.models-executed {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}

.model-executed-item {
  white-space: nowrap;
}

.model-executed-item code {
  color: var(--text);
  font-size: 11px;
}

.population-model-card {
  margin-top: 16px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-2);
  border-radius: 8px;
}

.population-model-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.population-model-heading h4 {
  margin: 0;
}

.uncalibrated-badge {
  flex: 0 0 auto;
  color: #7a3218;
  background: #fff0e8;
  border-color: #e6b59a;
}

.ai-warning {
  margin-top: 12px;
  padding: 10px 12px;
  color: #63330f;
  background: #fff8e7;
  border: 1px solid #ecd19a;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.45;
}

.population-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.stat-value-small {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.population-fingerprint {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.turnout-summary,
.population-county-output {
  margin-top: 14px;
}

.turnout-summary h5,
.population-county-output h5,
.ai-parameter-table-wrap h5 {
  margin: 0 0 8px;
  font-size: 13px;
}

.turnout-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.county-outcome-table,
.ai-parameter-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 12px;
}

.county-outcome-table th,
.county-outcome-table td,
.ai-parameter-table th,
.ai-parameter-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: top;
}

.county-outcome-table th:first-child,
.county-outcome-table td:first-child,
.ai-parameter-table th:first-child,
.ai-parameter-table td:first-child {
  text-align: left;
}

.county-outcome-table thead th,
.ai-parameter-table thead th {
  color: var(--muted);
  background: var(--paper);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.county-outcome-table tbody tr:last-child th,
.county-outcome-table tbody tr:last-child td,
.ai-parameter-table tbody tr:last-child th,
.ai-parameter-table tbody tr:last-child td {
  border-bottom: 0;
}

.ai-assumptions-details,
.ai-cells-details {
  margin-top: 14px;
  font-size: 12px;
}

.ai-assumptions-details > summary,
.ai-cells-details > summary {
  cursor: pointer;
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.summary-note {
  color: var(--muted);
  font-weight: 400;
}

.ai-assumption-tables {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.ai-parameter-table-wrap {
  overflow-x: auto;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.ai-cells-scroll {
  max-height: 320px;
  margin-top: 8px;
}

.actual-form {
  background: #fdfaf6;
  border: 1px solid #f0e1cf;
  padding: 16px;
  border-radius: 8px;
  margin-top: 16px;
}

.comparison-view {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding-bottom: 16px;
}

.compare-col {
  flex: 0 0 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.poll-form-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 56, 101, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.poll-form-content {
  background: var(--surface);
  padding: 24px;
  border-radius: 12px;
  width: min(90%, 500px);
  max-height: 90vh;
  overflow-y: auto;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.checkbox-row input {
  width: auto;
  min-height: auto;
}

@media (max-width: 620px) {
  .population-model-heading {
    flex-direction: column;
  }

  .uncalibrated-badge {
    align-self: flex-start;
  }

  .population-model-card {
    padding: 11px;
  }

  .models-executed {
    align-items: flex-start;
    flex-direction: column;
  }
}