.view-screen {
  display: none;
}

.view-screen.active {
  display: block;
}

#map-view.view-screen.active {
  display: block;
}

#controls-view.view-screen.active {
  display: flex;
}

.analysis-view {
  grid-column: 1 / -1;
  grid-row: 2;
  display: none;
  padding: 24px;
  background: #f8fafc;
  overflow-y: auto;
}

.analysis-view.active {
  display: block;
}

.analysis-hero,
.stat-card,
.chart-card {
  background: #ffffff;
  border: 1px solid #dbe4f0;
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.analysis-hero {
  padding: 28px 32px;
  margin-bottom: 24px;
}

.analysis-hero h2 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.2;
  color: #172033;
}

.analysis-hero p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  color: #6f82a3;
}

.analysis-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 22px 24px;
}

.stat-card h3 {
  margin: 8px 0 6px;
  font-size: 20px;
  line-height: 1.2;
  color: #172033;
}

.stat-label,
.stat-card span {
  margin: 0;
  color: #6f82a3;
  font-size: 14px;
  line-height: 1.4;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin: 40px 0;
}

.chart-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.chart-card__image {
  width: 100%;
  height: 280px;
  display: block;
  border-radius: 14px;
  object-fit: contain;
  object-position: center;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.chart-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: #172033;
}
/* Correlation Visualizations */
.chart-container {
  width: 100%;
  min-height: 450px;
  background: #fafbfc;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #e2e8f0;
}

.chart-narrative {
  padding: 0 0 16px 0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 0;
}

.chart-narrative h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: #172033;
  font-weight: 600;
}

.chart-narrative p {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #475569;
}

.chart-note {
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
  margin-top: 8px;
}

.correlation-stats {
  margin-top: 16px;
  padding: 12px 16px;
  background: #f0f4f8;
  border-radius: 6px;
  font-size: 13px;
  color: #475569;
  border-left: 3px solid #06a77d;
}

.tooltip {
  position: absolute;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1000;
  pointer-events: none;
}

.facet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

/* Canton selector styling */
#canton-selector {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 14px;
  font-weight: 500;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
  color: #172033;
}

#canton-selector:hover {
  border-color: #06a77d;
  box-shadow: 0 0 0 2px rgba(6, 168, 125, 0.1);
}

#canton-selector:focus {
  outline: none;
  border-color: #06a77d;
  box-shadow: 0 0 0 3px rgba(6, 168, 125, 0.2);
}

.facet-cell {
  background: #ffffff;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.facet-cell h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #172033;
}

.facet-svg {
  width: 100%;
  height: auto;
}

.methodology-box {
  background: #f8fafc;
  border-left: 6px solid #2563eb;
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 4px;
  font-size: 14px;
  color: #475569;
}

.methodology-box p {
  margin: 0;
}

.analysis-conclusion {
  margin-top: 50px;
  padding: 30px;
  background: #ffffff;
  border: 1px solid #dbe4f0;
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  border-left: 6px solid #2563eb;
  line-height: 1.7;
  color: #334155;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.analysis-conclusion h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #1e293b;
  font-size: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .analysis-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .facet-grid {
    grid-template-columns: 1fr;
  }
  
  .chart-container {
    min-height: 350px;
  }
}

