* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #222;
  background: #f7f8f5;
}

.app-header {
  padding: 1rem 1.5rem 0.75rem;
  border-bottom: 1px solid #ddd;
  background: #fff;
}

.app-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
  color: #1f4e3d;
}

.app-subtitle {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
}

.app-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
  align-items: flex-start;
}

.map-panel {
  flex: 1 1 480px;
  min-width: 320px;
}

#map {
  /* clamp(min, voorkeur, max): schaalt mee met de viewporthoogte i.p.v. een
     vaste 640px, zodat een kort/liggend scherm (bv. telefoon in landscape)
     niet de hele zichtbare ruimte met alleen de kaart vult - de ondergrens
     (280px) houdt de kaart wel altijd bruikbaar. */
  height: clamp(280px, 60vh, 640px);
  border-radius: 8px;
  border: 1px solid #ccc;
}

.info-panel {
  flex: 1 1 420px;
  min-width: 320px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.25rem;
  min-height: 640px;
}

.panel-placeholder {
  color: #767676;
  font-style: italic;
  padding: 2rem 0;
  text-align: center;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #1f4e3d;
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #1f4e3d;
}

#topic-select {
  font-size: 0.95rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #bbb;
  max-width: 260px;
}

.topic-explanation, .conclusion-box {
  margin-bottom: 1.1rem;
}

.topic-explanation h3, .conclusion-box h3 {
  margin: 0 0 0.3rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #6a6a6a;
}

.topic-explanation p {
  margin: 0;
  color: #333;
  line-height: 1.45;
}

.conclusion-box {
  background: #eef5ee;
  border-left: 4px solid #4a8f5c;
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
}

.conclusion-box p {
  margin: 0;
  line-height: 1.45;
}

.conclusion-subblock {
  margin-bottom: 0.75rem;
}

.conclusion-subblock:last-child {
  margin-bottom: 0;
}

.conclusion-subblock h4 {
  margin: 0 0 0.15rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #4a8f5c;
}

.conclusion-subblock p {
  margin: 0;
  line-height: 1.45;
}

.extra-visual-box {
  border-top: 1px solid #e5e5e5;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

.extra-visual-title {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: #555;
  text-align: center;
}

.extra-visual-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.detail-dropdown {
  margin-top: 0.6rem;
}

.detail-dropdown summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: #1f4e3d;
  font-weight: 600;
}

.detail-dropdown summary:hover {
  text-decoration: underline;
}

.detail-dropdown p {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #444;
  line-height: 1.5;
}

.chart-box {
  border-top: 1px solid #e5e5e5;
  padding-top: 0.75rem;
}

.chart {
  width: 100%;
  min-height: 320px;
}

.dual-chart-container {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dual-chart-panel {
  flex: 1 1 260px;
  min-width: 240px;
}

.dual-chart-panel h4 {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  text-align: center;
  color: #555;
}

.location-select-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.location-select-row label {
  font-size: 0.9rem;
  color: #555;
}

.location-select-row select {
  flex: 1 1 auto;
  font-size: 0.95rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #bbb;
  min-height: 44px;
}

.element-select-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.element-select-row[hidden] {
  display: none;  /* zonder deze regel wint .element-select-row's display:flex van [hidden] */
}

.element-select-row label {
  font-size: 0.9rem;
  color: #555;
}

.element-select-row select {
  font-size: 0.9rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #bbb;
}

.chart-empty-message {
  color: #767676;
  font-style: italic;
  text-align: center;
  padding: 2rem 0;
}

.leaflet-popup-content {
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  #map { height: clamp(240px, 50vh, 420px); }
  .info-panel { min-height: unset; }
}

/* Kleine telefoons: minder padding overal, kleinere titel, en de kaart nog
   compacter (60vh op een smal EN kort scherm kan nog steeds te veel ruimte
   opeisen boven de inhoud van het infopaneel). */
@media (max-width: 480px) {
  .app-header { padding: 0.75rem 1rem 0.6rem; }
  .app-header h1 { font-size: 1.15rem; }
  .app-subtitle { font-size: 0.85rem; }
  .app-layout { padding: 0.6rem; gap: 0.6rem; }
  #map { height: clamp(200px, 40vh, 320px); }
  .info-panel { padding: 0.85rem; }
  .dual-chart-panel { flex-basis: 100%; }
}
