* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 0% 0%, rgba(129, 140, 248, 0.14), transparent 45%),
    radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.12), transparent 42%),
    #f8fafc;
  color: #0f172a;
}
.site-banner {
  position: relative;
  margin: 20px 20px 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background:
    radial-gradient(circle at 12% 26%, rgba(59, 130, 246, 0.24), transparent 34%),
    radial-gradient(circle at 86% 22%, rgba(248, 113, 113, 0.4), transparent 46%),
    linear-gradient(100deg, #1d4ed8 0%, #3b82f6 28%, #a855f7 58%, #ef4444 100%);
  box-shadow: 0 22px 40px rgba(30, 64, 175, 0.22);
}
.site-banner__content {
  position: relative;
  z-index: 2;
  max-width: 100%;
  padding: 34px 28px;
  text-align: center;
}
.site-banner__title {
  margin: 0;
  font-size: clamp(1.45rem, 2.8vw, 2.35rem);
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.site-banner__glow {
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(244, 63, 94, 0.42), transparent 70%);
  filter: blur(3px);
  pointer-events: none;
}
.app {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  min-height: 100vh;
  padding: 20px;
}
.panel, .map-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(10px);
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  padding: 18px;
}
h1, h2, h3, p { margin: 0; }
h1 {
  font-size: 1.35rem;
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}
h2 {
  font-size: 1rem;
  margin-bottom: 12px;
}
.muted {
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.5;
}
.control-group {
  margin-top: 16px;
}
label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #334155;
}
select, input, button {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  padding: 12px 14px;
  font-size: 0.95rem;
  background: white;
}
button {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  margin-top: 12px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
button:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.2);
}
.legend-list {
  display: grid;
  gap: 10px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.88rem;
}
.swatch {
  width: 28px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  flex: 0 0 auto;
}
.pill {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #312e81;
  font-size: 0.84rem;
  font-weight: 600;
}
.small-note {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.5;
  margin-top: 6px;
}
.status {
  margin-top: 10px;
  font-size: 0.84rem;
  color: #475569;
}
.meta-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}
.meta-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  background: #f8fafc;
}
.meta-item h3 {
  font-size: 0.92rem;
  margin-bottom: 6px;
}
.map-panel {
  position: relative;
  overflow: hidden;
}
.map-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, rgba(129, 140, 248, 0.2), transparent 42%);
  pointer-events: none;
}
.map-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px 0;
}
.map-title-block {
  flex: 1;
  min-width: 0;
}
.map-title-block h1 {
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-wrap {
  position: relative;
  padding: 10px 16px 16px;
}
svg {
  width: 100%;
  height: 80vh;
  display: block;
  background: linear-gradient(to bottom, #fcfdff, #f8fafc);
  border-radius: 18px;
  border: 1px solid #e2e8f0;
}
.country {
  stroke: white;
  stroke-width: 0.6;
  transition: fill 0.2s ease, stroke 0.2s ease, opacity 0.2s ease;
}
.country:hover {
  stroke: #0f172a;
  stroke-width: 1.2;
  cursor: pointer;
}
.country.dimmed {
  opacity: 0.3;
}
.country.highlighted {
  stroke: #0f172a;
  stroke-width: 1.4;
}
.country.no-data {
  fill: #e5e7eb !important;
}
.tooltip {
  display: inline-block;
  margin: 0;
  width: min(360px, 100%);
  background: rgba(255,255,255,0.94);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(8px);
}
.hero-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.insight {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(145deg, rgba(238, 242, 255, 0.72), rgba(240, 249, 255, 0.72));
}
.insight-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}
.insight-value {
  display: block;
  margin-top: 4px;
  font-weight: 700;
  color: #0f172a;
}
.tooltip h3 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.tooltip .score {
  font-size: 0.9rem;
  color: #334155;
  margin-bottom: 2px;
}
.ranking-card .country-table-scroll {
  max-height: 340px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: white;
}
.country-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: fixed;
}
.country-table th,
.country-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid #e2e8f0;
  white-space: normal;
  word-break: break-word;
}
.country-table th:nth-child(1),
.country-table td:nth-child(1) {
  width: 44px;
}
.country-table th:nth-child(3),
.country-table td:nth-child(3) {
  width: 110px;
  text-align: right;
}
.country-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
}
.country-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}
.country-table tbody tr:hover {
  background: #f8fafc;
}
.country-table tbody tr.selected-row {
  background: #e0f2fe;
}
@media (max-width: 980px) {
  .site-banner { margin: 16px 16px 0; }
  .site-banner__content { padding: 24px 20px; }
  .app { grid-template-columns: 1fr; }
  svg { height: 62vh; }
  .map-top-row { flex-direction: column; }
  .hero-insights { grid-template-columns: 1fr; }
}
.seo-content {
  margin: 20px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
  line-height: 1.6;
}
.seo-content h2 {
  margin-bottom: 8px;
  margin-top: 14px;
}
.seo-content ul {
  margin: 8px 0 0 20px;
  padding: 0;
}
.seo-content a {
  color: #1d4ed8;
}
.seo-content--supplemental {
  margin-top: 0;
}
.seo-details summary {
  cursor: pointer;
  font-weight: 600;
  margin-top: 4px;
}
.seo-details[open] summary {
  margin-bottom: 8px;
}
