html,
body {
  min-height: 100%;
  margin: 0;
  color: #202020;
  background: #f6f6f4;
  font-family: Arial, Helvetica, sans-serif;
}

.page {
  box-sizing: border-box;
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.top-nav {
  margin-bottom: 28px;
}

.top-nav a {
  display: inline-block;
  padding: 9px 13px;
  color: #333;
  background: #fff;
  border: 1px solid #cfcfcb;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.top-nav a:hover {
  color: #111;
  background: #f7f7f5;
  border-color: #b7b7b2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.about-button {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2;
  min-height: 34px;
  padding: 7px 12px;
  color: #222;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #cfcfcb;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.12);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.about-button:hover {
  background: #fff;
  border-color: #b7b7b2;
}

.about-modal {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 24px;
  background: rgba(32, 32, 32, 0.42);
}

.about-modal[hidden] {
  display: none;
}

.about-card {
  position: relative;
  box-sizing: border-box;
  width: min(680px, 100%);
  max-height: min(82vh, 720px);
  overflow-y: auto;
  padding: 24px;
  color: #202020;
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.about-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  color: #444;
  background: #f7f7f5;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.about-close:hover {
  color: #111;
  background: #fff;
}

.about-card h2 {
  margin: 0;
  padding-right: 36px;
  color: #111;
  font-size: 22px;
  line-height: 1.15;
}

.paper-section {
  margin-top: 20px;
}

.paper-section h3 {
  margin: 0 0 12px;
  color: #222;
  font-size: 14px;
  line-height: 1.2;
}

.paper-details {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 9px 14px;
  margin: 0;
}

.paper-details dt {
  color: #555;
  font-weight: 700;
}

.paper-details dd {
  margin: 0;
  color: #222;
  line-height: 1.45;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e0e0dc;
}

.logo-row img {
  display: block;
  max-width: 170px;
  max-height: 58px;
  object-fit: contain;
}

.page-header {
  max-width: 760px;
}

.page-header h1 {
  margin: 0;
  color: #111;
  font-size: 30px;
  line-height: 1.15;
}

.page-header p {
  margin: 10px 0 0;
  color: #555;
  font-size: 15px;
  line-height: 1.45;
}

.summary-section {
  margin-top: 32px;
}

.summary-section h2 {
  margin: 0 0 14px;
  color: #222;
  font-size: 16px;
  line-height: 1.2;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  min-height: 92px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.summary-card span {
  display: block;
  color: #555;
  font-size: 12px;
  line-height: 1.35;
}

.summary-card strong {
  display: block;
  margin-top: 12px;
  color: #111;
  font-size: 24px;
  line-height: 1.1;
}

.chart-section {
  margin-top: 32px;
}

.chart-section h2 {
  margin: 0 0 14px;
  color: #222;
  font-size: 16px;
  line-height: 1.2;
}

.chart-card {
  position: relative;
  min-height: 170px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.chart-card h3 {
  margin: 0 0 14px;
  color: #333;
  font-size: 13px;
  line-height: 1.3;
}

.chart-card canvas {
  width: 100%;
  height: 150px;
}

.chart-note {
  margin: 10px 0 0;
  color: #666;
  font-size: 12px;
  line-height: 1.35;
}

.section-helper {
  margin: -6px 0 14px;
  color: #555;
  font-size: 13px;
  line-height: 1.4;
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.region-tab {
  min-height: 32px;
  padding: 5px 12px;
  color: #444;
  background: #fff;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.region-tab.active {
  color: #fff;
  background: #7f2928;
  border-color: #7f2928;
}

.subregional-chart-stack {
  display: grid;
  gap: 12px;
}

.subregional-chart-card {
  height: 330px;
}

.subregional-chart-card canvas {
  height: 260px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 12px;
  margin-bottom: 12px;
}

.filter-row label {
  color: #444;
  font-size: 12px;
  font-weight: 700;
}

.filter-row select {
  box-sizing: border-box;
  width: 100%;
  min-height: 34px;
  margin-top: 5px;
  padding: 6px 8px;
  color: #222;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 4px;
  font: inherit;
  font-size: 13px;
}

.country-contribution-card {
  height: 520px;
}

.country-contribution-card canvas {
  height: 450px;
}

.secondary-country-chart {
  margin-top: 12px;
}

.regional-chart-card {
  height: 320px;
}

.regional-chart-card canvas {
  height: 250px;
}

@media (max-width: 800px) {
  .about-button {
    position: static;
    margin: 18px 18px 0;
  }

  .summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .filter-row {
    grid-template-columns: 1fr;
  }

  .paper-details {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .paper-details dd {
    margin-bottom: 8px;
  }

  .logo-row {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .page {
    padding: 18px;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }
}
