:root {
  --bg:        #f4f1eb;
  --panel-bg:  #faf8f4;
  --border:    #d6d0c4;
  --accent:    #2d6a4f;
  --text:      #1a1a18;
  --muted:     #7a756a;
  --header-bg: #1a1a18;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'IBM Plex Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  height: 52px;
  background: var(--header-bg);
  color: #f4f1eb;
  flex-shrink: 0;
  border-bottom: 2px solid var(--accent);
    justify-content: space-between;
  position: relative;
}



header .logo {
  display: flex;
  align-items: center;
  gap: 8px;
    flex: 0 0 auto;
}

header .logo img {
  height: 26px !important;
  width: 26px !important;
  display: block;
  object-fit: contain;
}

header h1 {
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #c8c3b8;
}

header .count-badge {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: bold;
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
    position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.country-nav {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-left: 16px;
  flex-wrap: wrap;
}

.country-link {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  font-weight: 400;
}

.country-link.active {
  font-weight: 700;
}

.country-link:hover {
  text-decoration: underline;
}
#container {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#filterPane,
#sidebar {
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  background: var(--panel-bg);
  display: flex;
  flex-direction: column;
}

#filterPane {
  border-right: 1px solid var(--border);
  padding: 28px;
  overflow-y: auto;
}

#sidebar {
  border-left: 1px solid var(--border);
}

#sidebarScroll {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

#filterPane h2,
#sidebar h2 {
  margin-bottom: 18px;
  font-size: 1.2rem;
}

#filterPane h3,
#sidebar h3 {
  margin-bottom: 12px;
  font-size: 1rem;
}

#filterPane p,
#sidebar p {
  line-height: 1.6;
  color: var(--text);
}

#filterPane form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#filterPane label {
  font-weight: 600;
}

#filterPane select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  font: inherit;
}

.pane-section {
  margin-top: 22px;
}

/* Main pane now split vertically */
#mainPane {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #e9e5dd;
}

/* Map takes upper space */
.map-shell {
  position: relative;
  flex: 1;
  min-height: 0;
}

#chartPanel {
  background: var(--panel-bg);
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  height: 340px;
  min-height: 70px;
  transition: height 0.25s ease;
}

#chartPanel.collapsed {
  height: 70px;
}

#chartPanel.expanded {
  height: 480px;
}

#chartPanelHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

#chartPanel h3 {
  margin: 0 0 4px 0;
}

.chart-help {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

#btnChartToggle {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

#chart_div {
  flex: 1;
  width: 100%;
  min-height: 0;
}

.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-style: italic;
}

#mapdiv {
  width: 100%;
  height: 100%;
}

.map-buttons {
  position: absolute;
  bottom: 25px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.map-buttons button {
  background: white;
  border: 1px solid #aaa;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.legend {
  background: white;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #333;
  border-radius: 4px;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
}