:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --ink: #10211a;
  --muted: #24795b;
  --line: rgba(0, 214, 144, 0.26);
  --panel: #ffffff;
  --panel-alpha: rgba(255, 255, 255, 0.88);
  --panel-soft-alpha: rgba(236, 255, 247, 0.72);
  --control-alpha: rgba(232, 255, 246, 0.92);
  --shadow: rgba(0, 214, 144, 0.12);
  --map-grid: rgba(0, 214, 166, 0.14);
  --map-glow: rgba(25, 255, 178, 0.2);
  --country-stroke: rgba(255, 255, 255, 0.86);
  --ocean: #e8fff8;
  --like: #00d084;
  --like-soft: #d8fff0;
  --dislike: #ff3b5f;
  --dislike-soft: #ffe0e7;
  --neutral: #d8efe7;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --ink: #f4fff9;
    --muted: #8fffd1;
    --line: rgba(52, 255, 171, 0.34);
    --panel: #030806;
    --panel-alpha: rgba(3, 8, 6, 0.9);
    --panel-soft-alpha: rgba(29, 255, 166, 0.08);
    --control-alpha: rgba(12, 29, 22, 0.95);
    --shadow: rgba(0, 255, 163, 0.14);
    --map-grid: rgba(0, 255, 186, 0.12);
    --map-glow: rgba(0, 255, 186, 0.16);
    --country-stroke: rgba(0, 0, 0, 0.72);
    --ocean: #00120f;
    --like: #19ff95;
    --like-soft: rgba(25, 255, 149, 0.18);
    --dislike: #ff3b5f;
    --dislike-soft: rgba(255, 59, 95, 0.2);
    --neutral: #1b2b25;
  }
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button {
  border: 0;
  font: inherit;
}

.instruction-help {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2147483646;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--control-alpha);
  box-shadow: 0 16px 38px var(--shadow);
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.instruction-help:hover,
.instruction-help:focus-visible {
  transform: translateY(-2px);
  background: var(--panel);
  box-shadow:
    0 18px 44px var(--shadow),
    0 0 24px rgba(25, 255, 149, 0.18);
}

.instruction-help:focus-visible,
.visitor-guide button:focus-visible {
  outline: 2px solid var(--like);
  outline-offset: 3px;
}

.visitor-guide {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(10px);
}

.visitor-guide[hidden] {
  display: none;
}

.visitor-guide-card {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  max-height: min(620px, calc(100svh - 36px));
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 18%, rgba(25, 255, 149, 0.14), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(255, 59, 95, 0.12), transparent 30%),
    var(--panel);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.22),
    0 0 38px var(--shadow);
}

.visitor-guide-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--control-alpha);
  cursor: pointer;
}

.visitor-guide-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.visitor-guide-kicker {
  margin: 0 44px 8px 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.visitor-guide h2 {
  margin: 0 44px 10px 0;
  font-size: clamp(1.55rem, 6vw, 2.1rem);
  line-height: 1;
}

.visitor-guide p {
  margin-bottom: 0;
}

.visitor-guide-card > p:not(.visitor-guide-kicker) {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.45;
}

.visitor-guide-visual {
  position: relative;
  min-height: 108px;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(var(--map-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--map-grid) 1px, transparent 1px),
    radial-gradient(circle at 30% 42%, var(--like-soft), transparent 28%),
    radial-gradient(circle at 72% 52%, var(--dislike-soft), transparent 28%),
    var(--panel-soft-alpha);
  background-size:
    42px 42px,
    42px 42px,
    auto,
    auto,
    auto;
}

.visitor-guide-visual::before,
.visitor-guide-visual::after {
  content: "";
  position: absolute;
}

.visitor-guide-visual::before {
  content: "Chi";
  left: 11%;
  top: 24%;
  width: 54%;
  height: 38px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 10px 24px var(--shadow);
  font-weight: 850;
  white-space: nowrap;
  animation: guideTyping 2.6s steps(5, end) infinite;
}

.visitor-guide-visual::after {
  right: 17%;
  bottom: 24%;
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 999px 999px 999px 3px;
  background: var(--panel);
  box-shadow: 0 0 0 5px rgba(25, 255, 149, 0.15);
  transform: rotate(-22deg);
  animation: guidePointer 2.6s ease-in-out infinite;
}

.visitor-guide-visual[data-step="vote"]::before {
  content: "Like";
  left: 10%;
  top: 31%;
  width: 36%;
  height: 44px;
  border-radius: 8px;
  padding: 10px 0;
  color: #04140d;
  background: var(--like);
  box-shadow: 0 12px 28px rgba(25, 255, 149, 0.24);
  text-align: center;
  animation: guideVoteLike 2.4s ease-in-out infinite;
}

.visitor-guide-visual[data-step="vote"]::after {
  content: "Dislike";
  right: 10%;
  top: 31%;
  width: 36%;
  height: 44px;
  border-radius: 8px;
  padding: 10px 0;
  color: #26030a;
  background: var(--dislike);
  box-shadow: 0 12px 28px rgba(255, 59, 95, 0.22);
  text-align: center;
  transform: none;
  animation: guideVoteDislike 2.4s ease-in-out infinite;
}

.visitor-guide-visual[data-step="results"]::before {
  content: "";
  left: 16%;
  top: 22%;
  width: 0;
  height: 16px;
  border-radius: 999px;
  background: var(--like);
  transform: none;
  padding: 0;
  animation: guideResultLike 2.4s ease-in-out infinite;
}

.visitor-guide-visual[data-step="results"]::after {
  content: "";
  left: 22%;
  top: 56%;
  width: 0;
  height: 14px;
  border-radius: 999px;
  background: var(--dislike);
  transform: none;
  animation: guideResultDislike 2.4s ease-in-out infinite;
}

.visitor-guide-visual.has-demo::before,
.visitor-guide-visual.has-demo::after {
  display: none;
}

.guide-demo {
  position: absolute;
  inset: 0;
}

.guide-search-control {
  position: absolute;
  left: 10%;
  top: 22%;
  width: 56%;
  margin: 0;
}

.guide-search-control .selected-country-flag {
  display: none;
}

.guide-search-text {
  display: inline-flex;
  min-width: 0;
  color: var(--ink);
  font-size: clamp(1.05rem, 1.7vw, 1.42rem);
  font-weight: 850;
  line-height: 1.16;
}

.guide-typing-text {
  display: inline-block;
  width: 0;
  overflow: hidden;
  white-space: nowrap;
  animation: guideTypeReveal 2.8s steps(5, end) infinite;
}

.guide-caret {
  display: inline-block;
  width: 2px;
  height: 20px;
  margin-left: 2px;
  border-radius: 999px;
  background: var(--like);
  animation: guideCaret 600ms steps(2, start) infinite;
}

.guide-map-dot {
  position: absolute;
  right: 26%;
  bottom: 27%;
  width: 32px;
  height: 24px;
  border-radius: 999px;
  background: var(--like);
  box-shadow: 0 0 18px rgba(25, 255, 149, 0.24);
  transform: rotate(-18deg);
}

.guide-search-result {
  position: absolute;
  left: 13%;
  top: 62%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 12px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 8px 20px var(--shadow);
  font-size: 0.78rem;
  font-weight: 850;
  opacity: 0;
  transform: translateY(-6px);
  animation: guideSearchResult 2.8s ease-in-out infinite;
}

.guide-pointer {
  position: absolute;
  right: 18%;
  bottom: 21%;
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: 999px 999px 999px 3px;
  background: var(--panel);
  box-shadow: 0 0 0 5px rgba(25, 255, 149, 0.15);
  transform: rotate(-22deg);
  animation: guidePointer 2.8s ease-in-out infinite;
}

.guide-demo-map {
  overflow: hidden;
  --guide-map-pointer-start-x: -220px;
  --guide-map-pointer-start-y: -48px;
}

.guide-mini-map {
  position: absolute;
  inset: 8px 10px;
  width: calc(100% - 20px);
  height: calc(100% - 16px);
}

.guide-land,
.guide-island {
  stroke: rgba(255, 255, 255, 0.32);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.guide-land-muted,
.guide-island {
  fill: rgba(216, 239, 231, 0.16);
}

.guide-land-target {
  fill: var(--like);
  stroke: rgba(255, 255, 255, 0.54);
  animation: guideMapTarget 2.8s ease-in-out infinite;
}

.guide-map-pointer {
  left: calc(76% - 13px);
  right: auto;
  bottom: auto;
  top: calc(64% - 13px);
  animation: guideMapPointer 2.8s ease-in-out infinite;
}

.guide-selection-ring {
  position: absolute;
  left: 76%;
  top: 64%;
  width: 36px;
  height: 36px;
  border: 3px solid var(--like);
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  animation: guideSelectionRing 2.8s ease-in-out infinite;
}

.guide-demo-vote {
  position: absolute;
  inset: 0;
  align-content: center;
  gap: 12px;
  padding: 0 10%;
}

.guide-demo-vote button {
  min-height: 48px;
  pointer-events: none;
}

.guide-demo-vote .like {
  animation: guideVoteLike 2.4s ease-in-out infinite;
}

.guide-demo-vote .dislike {
  animation: guideVoteDislike 2.4s ease-in-out infinite;
}

.guide-demo-results {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 0 12%;
}

.guide-result-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
}

.guide-result-bar {
  display: block;
  width: 0;
  height: 13px;
  border-radius: 999px;
}

.guide-result-bar.like {
  background: var(--like);
  animation: guideResultLike 2.4s ease-in-out infinite;
}

.guide-result-bar.dislike {
  background: var(--dislike);
  animation: guideResultDislike 2.4s ease-in-out infinite;
}

.visitor-guide-progress {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.visitor-guide-progress span {
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: var(--neutral);
}

.visitor-guide-progress .active {
  background: var(--like);
  box-shadow: 0 0 16px rgba(25, 255, 149, 0.28);
}

.visitor-guide-actions {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
}

.visitor-guide-actions button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 850;
  min-width: 0;
  cursor: pointer;
}

.visitor-guide-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--control-alpha);
}

.visitor-guide-primary {
  justify-self: stretch;
  color: #04140d;
  background: var(--like);
  box-shadow: 0 10px 26px rgba(25, 255, 149, 0.22);
}

.visitor-guide-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

@keyframes guideTyping {
  0%,
  20% {
    content: "";
  }
  35% {
    content: "Ch";
  }
  50% {
    content: "Chin";
  }
  65%,
  100% {
    content: "China";
  }
}

@keyframes guideTypeReveal {
  0%,
  18% {
    width: 0;
  }
  64%,
  100% {
    width: 46px;
  }
}

@keyframes guideCaret {
  50% {
    opacity: 0;
  }
}

@keyframes guidePointer {
  0%,
  18% {
    transform: translate(-76px, -20px) rotate(-22deg) scale(0.92);
  }
  46%,
  72% {
    transform: translate(0, 0) rotate(-22deg) scale(1);
  }
  82%,
  100% {
    transform: translate(0, 0) rotate(-22deg) scale(0.86);
  }
}

@keyframes guideSearchResult {
  0%,
  50% {
    opacity: 0;
    transform: translateY(-6px);
  }
  64%,
  88% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(2px);
  }
}

@keyframes guideMapPointer {
  0%,
  18% {
    transform: translate(var(--guide-map-pointer-start-x), var(--guide-map-pointer-start-y)) rotate(-22deg) scale(0.92);
  }
  48%,
  70% {
    transform: translate(0, 0) rotate(-22deg) scale(1);
  }
  82%,
  100% {
    transform: translate(0, 0) rotate(-22deg) scale(0.86);
  }
}

@keyframes guideMapTarget {
  0%,
  46% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
  }
  58%,
  88% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.36),
      0 0 18px rgba(25, 255, 149, 0.32);
  }
  100% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
  }
}

@keyframes guideSelectionRing {
  0%,
  46% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  58%,
  82% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.25);
  }
}

@keyframes guideVoteLike {
  0%,
  20%,
  100% {
    transform: scale(1);
  }
  34%,
  48% {
    transform: scale(1.06);
  }
}

@keyframes guideVoteDislike {
  0%,
  52%,
  100% {
    transform: scale(1);
  }
  66%,
  80% {
    transform: scale(1.06);
  }
}

@keyframes guideResultLike {
  0%,
  24% {
    width: 0;
  }
  62%,
  100% {
    width: 64%;
  }
}

@keyframes guideResultDislike {
  0%,
  36% {
    width: 0;
  }
  72%,
  100% {
    width: 42%;
  }
}

.app-shell {
  width: min(1500px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

.toolbar,
.ad-slot,
.map-workspace,
.insights,
.legend {
  border: 1px solid var(--line);
  background: var(--panel-alpha);
  box-shadow: 0 20px 60px var(--shadow);
}

.toolbar,
.map-workspace,
.insights,
.legend,
.country-vote-overlay,
.map-controls {
  box-shadow:
    0 0 0 1px rgba(0, 214, 144, 0.05),
    0 12px 34px rgba(0, 214, 144, 0.12);
}

@media (prefers-color-scheme: dark) {
  .toolbar,
  .ad-slot,
  .map-workspace,
  .insights,
  .legend,
  .country-vote-overlay,
  .map-controls {
    box-shadow:
      0 0 0 1px rgba(25, 255, 149, 0.08),
      0 0 28px rgba(25, 255, 149, 0.12);
  }
}

.ad-slot {
  min-height: 68px;
  border-radius: 8px;
  padding: 8px 14px;
  display: grid;
  justify-items: center;
  gap: 5px;
}

.ad-label {
  width: min(100%, 728px);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 820;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
}

.ad-frame {
  width: min(100%, 728px);
  min-height: 50px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: var(--panel-soft-alpha);
  font-size: 0.82rem;
  font-weight: 760;
}

.ad-frame-live {
  min-height: 90px;
  border-style: solid;
  background: transparent;
}

.ad-frame-live iframe {
  display: block;
  max-width: 100%;
  border: 0;
}

.toolbar {
  min-height: 86px;
  border-radius: 8px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
}

.eyebrow,
.panel-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 3.6vw, 3.25rem);
  line-height: 1;
}

.title-row {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.info-tip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--muted);
  background: var(--control-alpha);
  box-shadow:
    inset 0 0 0 1px var(--line),
    0 0 18px rgba(0, 214, 144, 0.1);
  cursor: help;
}

.info-tip svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.info-tip span {
  position: absolute;
  z-index: 20;
  top: calc(100% + 12px);
  left: 50%;
  width: min(320px, calc(100vw - 44px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 16px 38px var(--shadow);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.42;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.info-tip:hover span,
.info-tip:focus-visible span {
  opacity: 1;
  transform: translate(-50%, 0);
}

.info-tip:focus-visible {
  outline: 2px solid var(--like);
  outline-offset: 3px;
}

@media (prefers-color-scheme: dark) {
  .info-tip {
    color: var(--like);
    box-shadow:
      inset 0 0 0 1px rgba(25, 255, 149, 0.34),
      0 0 22px rgba(25, 255, 149, 0.18);
  }

  .info-tip span {
    background: #020705;
    box-shadow:
      0 0 0 1px rgba(25, 255, 149, 0.08),
      0 0 28px rgba(25, 255, 149, 0.18);
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 10px;
  min-width: min(560px, 50vw);
}

.stats-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft-alpha);
  padding: 10px 12px;
}

.stats-grid span {
  display: block;
  color: var(--ink);
  font-size: 1.42rem;
  font-weight: 820;
  line-height: 1.1;
  white-space: nowrap;
}

.stats-grid small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 680;
}

.total-votes-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.total-votes-card .refresh-action {
  width: 34px;
  height: 34px;
}

.total-votes-card .refresh-action svg {
  width: 18px;
  height: 18px;
}

.mobile-global-card {
  display: none;
}

.mobile-refresh {
  display: none;
}

.refresh-action {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--control-alpha);
  cursor: pointer;
  transition:
    transform 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.refresh-action:hover {
  transform: translateY(-1px);
  background: var(--panel);
  box-shadow: 0 8px 20px var(--shadow);
}

.refresh-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.map-workspace {
  min-height: min(720px, calc(100svh - 252px));
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(260px, 326px);
  overflow: hidden;
}

.country-panel {
  border-right: 1px solid var(--line);
  padding: 18px;
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.country-panel h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 2.7vw, 2.1rem);
  line-height: 1.02;
}

.name-with-flag,
#voterCountryName {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

#voterCountryName span,
.name-with-flag span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-flag {
  flex: 0 0 auto;
  width: 24px;
  height: 18px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(28, 35, 32, 0.12);
  object-fit: cover;
}

.selected-country {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
  min-height: 112px;
  background:
    var(--panel);
}

.country-vote-overlay {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 3;
  width: min(720px, calc(100% - 96px));
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-alpha);
  box-shadow: 0 18px 44px var(--shadow);
  backdrop-filter: blur(10px);
}

.country-vote-overlay .selected-country {
  min-height: 88px;
  padding: 12px;
}

.country-vote-overlay #countryName,
.country-vote-overlay .country-name-display {
  font-size: clamp(1.05rem, 1.7vw, 1.42rem);
}

.selected-country-picker {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: calc(100% - 42px);
  margin-top: 4px;
  border: 1px solid rgba(0, 214, 144, 0.42);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--control-alpha);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.38),
    0 8px 22px rgba(0, 214, 144, 0.08);
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

.selected-country:focus-within .selected-country-picker {
  border-color: var(--like);
  background: var(--panel);
  box-shadow:
    0 0 0 3px rgba(25, 255, 149, 0.16),
    0 10px 28px rgba(0, 214, 144, 0.12);
}

.selected-country-flag {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.country-search-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--muted);
}

.country-search-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.3;
}

#countryName {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: clamp(1.18rem, 2.2vw, 1.72rem);
  font-weight: 850;
  line-height: 1.16;
}

#countryName::placeholder {
  color: var(--muted);
  opacity: 0.84;
}

#countryName:focus {
  outline: none;
}

.country-name-display {
  min-width: 0;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: clamp(1.05rem, 1.7vw, 1.42rem);
  font-weight: 850;
  line-height: 1.16;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.country-code {
  position: absolute;
  top: 14px;
  right: 14px;
  margin: 0;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--like);
  background: var(--like-soft);
  font-size: 0.78rem;
  font-weight: 850;
}

.search-box {
  display: grid;
  gap: 7px;
}

.voter-search {
  margin-top: 2px;
}

.search-box span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.search-box input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  font: inherit;
  font-weight: 650;
}

.search-box input:focus {
  border-color: rgba(21, 127, 79, 0.55);
  outline: 3px solid rgba(21, 127, 79, 0.12);
}

.search-results {
  display: grid;
  gap: 6px;
}

.search-results button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--ink);
  background: var(--control-alpha);
  cursor: pointer;
  text-align: left;
  font-weight: 720;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.voter-chip {
  display: grid;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--panel-soft-alpha);
}

.voter-chip strong {
  display: flex;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.voter-chip small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.vote-meter {
  display: flex;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--neutral);
  box-shadow: inset 0 0 0 1px rgba(28, 35, 32, 0.08);
}

.meter-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: -5px;
}

.meter-caption span {
  font-weight: 850;
}

.meter-caption small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 740;
}

.vote-meter span {
  width: 50%;
  transition: width 180ms ease;
}

#meterDislike {
  background: var(--dislike);
}

#meterLike {
  background: var(--like);
}

.vote-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vote-actions button,
.secondary-action {
  min-height: 48px;
  border-radius: 8px;
  font-weight: 760;
  cursor: pointer;
  transition:
    transform 140ms ease,
    opacity 140ms ease,
    box-shadow 140ms ease;
}

.vote-actions button:hover,
.secondary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(28, 35, 32, 0.14);
}

.vote-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
  box-shadow: none;
}

.vote-actions .vote-icon {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  position: relative;
  z-index: 0;
}

.vote-actions .vote-icon::before {
  content: "";
  position: absolute;
  inset: -10px;
  z-index: -1;
  border-radius: 999px;
  opacity: 0;
}

.vote-actions button {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto;
  align-content: center;
  justify-content: center;
  column-gap: 12px;
}

.vote-actions .vote-icon {
  align-self: center;
}

.vote-actions .vote-icon svg {
  width: 24px;
  height: 24px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.like .vote-icon {
  color: #005f3d;
}

.dislike .vote-icon {
  color: #9d1026;
}

@media (prefers-color-scheme: dark) {
  .like .vote-icon {
    color: #006b40;
  }

  .dislike .vote-icon {
    color: #a11422;
  }

  .like .vote-icon::before {
    opacity: 0.98;
    background: radial-gradient(circle, rgba(25, 255, 149, 0.86), rgba(25, 255, 149, 0.28) 46%, transparent 74%);
  }

  .dislike .vote-icon::before {
    opacity: 0.98;
    background: radial-gradient(circle, rgba(255, 59, 95, 0.82), rgba(255, 59, 95, 0.3) 46%, transparent 74%);
  }

  .like .vote-icon svg {
    filter:
      drop-shadow(0 0 2px rgba(255, 255, 255, 0.9))
      drop-shadow(0 0 9px rgba(25, 255, 149, 1))
      drop-shadow(0 0 18px rgba(25, 255, 149, 0.72));
  }

  .dislike .vote-icon svg {
    filter:
      drop-shadow(0 0 2px rgba(255, 255, 255, 0.85))
      drop-shadow(0 0 9px rgba(255, 59, 95, 1))
      drop-shadow(0 0 18px rgba(255, 59, 95, 0.72));
  }
}

.vote-actions button small {
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
}

.share-votes-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.share-votes-button,
.share-votes-links button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--control-alpha);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 820;
}

.share-votes-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
}

.share-votes-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.share-votes-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.share-votes-links button {
  width: 42px;
  min-width: 42px;
  padding: 0 8px;
  display: grid;
  place-items: center;
}

.share-votes-links svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.share-votes-links [data-share-map="line"] svg,
.share-votes-links [data-share-map="whatsapp"] svg,
.share-votes-links [data-share-map="instagram"] svg,
.share-votes-links [data-share-map="tiktok"] svg,
.share-votes-links [data-share-map="download"] svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.share-votes-links [data-share-map="line"] svg path:first-child,
.share-votes-links [data-share-map="whatsapp"] svg path:first-child {
  fill: currentColor;
  stroke: none;
  opacity: 0.14;
}

.share-votes-button:hover,
.share-votes-button:focus-visible,
.share-votes-links button:hover,
.share-votes-links button:focus-visible {
  background: var(--panel);
  box-shadow: 0 8px 18px var(--shadow);
  outline: none;
}

.vote-notice {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.vote-notice[data-tone="success"] {
  color: var(--like);
}

.vote-notice[data-tone="duplicate"] {
  color: #8a5b16;
}

.like {
  color: #005f3d;
  background: linear-gradient(180deg, #7dffc5, #1ff59d);
  box-shadow:
    inset 0 0 0 1px rgba(0, 95, 61, 0.18),
    0 0 18px rgba(0, 208, 132, 0.2);
}

.dislike {
  color: #9d1026;
  background: linear-gradient(180deg, #ff9aad, #ff5270);
  box-shadow:
    inset 0 0 0 1px rgba(157, 16, 38, 0.18),
    0 0 18px rgba(255, 59, 95, 0.2);
}

@media (prefers-color-scheme: dark) {
  .like {
    color: #001b10;
    background: var(--like);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.22),
      0 0 18px rgba(25, 255, 149, 0.32);
  }

  .dislike {
    color: #260006;
    background: var(--dislike);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.18),
      0 0 18px rgba(255, 59, 95, 0.32);
  }
}

.secondary-action {
  color: var(--ink);
  background: var(--control-alpha);
}

.map-panel {
  position: relative;
  min-height: 100%;
  background:
    linear-gradient(var(--map-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--map-grid) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, var(--map-glow), transparent 58%),
    var(--ocean);
  background-size: 56px 56px;
}

.map-controls {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px;
  background: var(--panel-alpha);
  box-shadow: 0 10px 24px var(--shadow);
}

.map-controls button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  padding: 0;
  color: var(--ink);
  background: var(--control-alpha);
  cursor: pointer;
  font-weight: 850;
}

.map-controls button:hover {
  background: var(--panel);
}

.map-controls svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

#worldMap {
  width: 100%;
  height: 100%;
  min-height: min(720px, calc(100svh - 172px));
  display: block;
  filter: drop-shadow(0 18px 24px var(--shadow));
  cursor: grab;
  touch-action: none;
}

#worldMap:active {
  cursor: grabbing;
}

.country {
  stroke: var(--country-stroke);
  stroke-width: 0.45;
  cursor: pointer;
  transition:
    fill 160ms ease,
    opacity 160ms ease,
    stroke-width 160ms ease;
}

.country:hover,
.country:focus-visible,
.country.selected {
  opacity: 0.92;
  stroke: var(--country-hover-color, var(--like));
  stroke-width: 1.15;
  outline: none;
  filter: drop-shadow(0 0 4px var(--country-hover-color, var(--like)));
}

@media (prefers-color-scheme: dark) {
  .country:hover,
  .country:focus-visible,
  .country.selected {
    stroke: var(--country-hover-color, var(--like));
    filter: drop-shadow(0 0 5px var(--country-hover-color, var(--like)));
  }
}

.tooltip {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 14px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--panel-alpha);
  box-shadow: 0 12px 28px var(--shadow);
  font-size: 0.86rem;
  font-weight: 720;
  white-space: nowrap;
}

.legend {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 2;
  width: min(560px, calc(100% - 32px));
  transform: translateX(-50%);
  border-radius: 8px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto minmax(140px, 380px) auto;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.insights {
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 18px;
  display: grid;
  align-content: start;
  grid-template-columns: 1fr;
  gap: 18px;
  background: var(--panel-alpha);
  box-shadow: none;
  overflow-y: auto;
  scrollbar-width: thin;
}

.insights h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.insight-label {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.paired-insight {
  display: grid;
  gap: 0;
}

.paired-insight h2 {
  grid-column: 1 / -1;
}

.voter-insight {
  margin-top: 4px;
}

.voter-insight h2 {
  margin: 0;
  font-size: 1rem;
}

.voter-insight .ranking-list li {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.voter-insight .ranking-list li > span {
  justify-self: start;
}

.ranking-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--panel-soft-alpha);
}

.compact-list {
  gap: 6px;
}

.compact-list li {
  padding: 7px 9px;
}

.empty-ranking {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.ranking-list button {
  padding: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.ranking-list strong,
.ranking-list small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-list .rank-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
}

.ranking-list .rank-index {
  min-width: max-content;
}

.ranking-list .name-with-flag {
  width: 100%;
}

.ranking-list .rank-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.ranking-list small,
.ranking-list li > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.legend-bar {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--like), var(--neutral), var(--dislike));
  box-shadow: 0 0 12px rgba(0, 214, 144, 0.16);
}

@media (prefers-color-scheme: dark) {
  #meterLike,
  #meterDislike,
  #mobileGlobalLikeMeter,
  #mobileGlobalDislikeMeter,
  .legend-bar {
    box-shadow: 0 0 14px rgba(25, 255, 149, 0.22);
  }

  #meterDislike,
  #mobileGlobalDislikeMeter {
    box-shadow: 0 0 14px rgba(255, 59, 95, 0.22);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .app-shell {
    padding: 10px;
    gap: 10px;
  }

  .toolbar {
    align-items: stretch;
    min-height: 0;
    padding: 14px;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ad-slot {
    min-height: 66px;
    padding: 7px 10px;
  }

  .ad-frame {
    width: min(100%, 320px);
  }

  .ad-frame-live {
    min-height: 50px;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  .toolbar > .stats-grid,
  .toolbar > .mobile-global-card {
    grid-column: 1 / -1;
  }

  .refresh-action {
    align-self: start;
    width: 40px;
    height: 40px;
  }

  .stats-grid {
    min-width: 0;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .stats-grid div {
    min-width: 0;
    padding: 9px;
  }

  .stats-grid span {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: clamp(1rem, 5vw, 1.28rem);
  }

  .stats-grid small {
    font-size: 0.7rem;
  }

  .map-workspace {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .map-panel {
    order: 1;
  }

  .insights {
    order: 2;
    border-left: 0;
    border-top: 1px solid var(--line);
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insights > div:nth-child(n + 3) {
    grid-column: 1 / -1;
  }

  .country-panel {
    order: 3;
    border-right: 0;
    border-bottom: 0;
    overflow: visible;
  }

  .country-vote-overlay {
    position: static;
    width: auto;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    background: var(--panel-alpha);
  }

  .country-vote-overlay #countryName,
  .country-vote-overlay .country-name-display {
    font-size: clamp(1.45rem, 9vw, 2rem);
  }

  .map-panel {
    display: flex;
    flex-direction: column;
  }

  .map-panel #worldMap {
    order: 2;
  }

  .country-vote-overlay {
    order: 1;
  }

  #worldMap {
    min-height: min(74vw, 460px);
  }

  .map-panel .legend {
    order: 3;
    left: 50%;
    bottom: 10px;
    width: min(360px, calc(100% - 24px));
    padding: 8px 10px;
    grid-template-columns: auto minmax(90px, 1fr) auto;
    gap: 8px;
    font-size: 0.68rem;
    pointer-events: none;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 8px;
  }

  .instruction-help {
    right: 12px;
    bottom: 12px;
    width: 40px;
    height: 40px;
  }

  .visitor-guide {
    padding: 10px;
  }

  .visitor-guide-card {
    width: min(360px, calc(100vw - 20px));
    max-height: calc(100svh - 24px);
    padding: 14px;
  }

  .visitor-guide-close {
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
  }

  .visitor-guide-kicker {
    margin-right: 36px;
    margin-bottom: 6px;
    font-size: 0.66rem;
  }

  .visitor-guide h2 {
    margin-right: 36px;
    margin-bottom: 8px;
    font-size: clamp(1.35rem, 7vw, 1.75rem);
  }

  .visitor-guide-card > p:not(.visitor-guide-kicker) {
    font-size: 0.86rem;
    line-height: 1.38;
  }

  .visitor-guide-visual {
    min-height: 84px;
    margin: 10px 0;
    background-size:
      34px 34px,
      34px 34px,
      auto,
      auto,
      auto;
  }

  .visitor-guide-progress {
    margin-bottom: 10px;
  }

  .visitor-guide-progress span {
    width: 28px;
  }

  .guide-search-control {
    width: 64%;
    padding: 7px 9px;
  }

  .guide-search-text {
    font-size: 0.86rem;
  }

  .guide-map-dot {
    width: 26px;
    height: 20px;
  }

  .guide-demo-map {
    --guide-map-pointer-start-x: -162px;
    --guide-map-pointer-start-y: -36px;
  }

  .guide-pointer {
    width: 22px;
    height: 22px;
  }

  .guide-demo-vote {
    gap: 8px;
    padding: 0 8%;
  }

  .guide-demo-vote button {
    min-height: 38px;
    font-size: 0.82rem;
  }

  .guide-demo-results {
    gap: 10px;
    padding: 0 9%;
  }

  .guide-result-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
    font-size: 0.68rem;
  }

  .visitor-guide-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .visitor-guide-actions button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .visitor-guide-primary {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .toolbar,
  .ad-slot,
  .map-workspace,
  .legend {
    border-radius: 7px;
  }

  .eyebrow,
  .panel-label {
    font-size: 0.68rem;
  }

  .vote-actions {
    grid-template-columns: 1fr;
  }

  .share-votes-panel {
    grid-template-columns: 1fr;
  }

  .share-votes-links {
    justify-content: stretch;
  }

  .share-votes-links button {
    flex: 1 1 48px;
    width: auto;
  }

  .stats-grid {
    display: none;
  }

  .mobile-global-card {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--panel-soft-alpha);
  }

  .mobile-global-top {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 10px;
  }

  .mobile-global-top > div {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .desktop-refresh {
    display: none;
  }

  .mobile-refresh {
    display: inline-grid;
    width: 32px;
    height: 32px;
  }

  .mobile-refresh svg {
    width: 17px;
    height: 17px;
  }

  .mobile-global-top small,
  .mobile-global-counts {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 740;
  }

  .mobile-global-top small strong {
    color: var(--ink);
    font-weight: 850;
  }

  .mobile-global-meter {
    display: flex;
    width: min(360px, 100%);
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--neutral);
    box-shadow: inset 0 0 0 1px rgba(28, 35, 32, 0.08);
  }

  .mobile-global-meter span {
    width: 50%;
  }

  #mobileGlobalDislikeMeter {
    background: var(--dislike);
  }

  #mobileGlobalLikeMeter {
    background: var(--like);
  }

  .mobile-global-counts {
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }

  .mobile-global-counts strong {
    color: var(--ink);
    font-weight: 850;
  }

  .country-panel,
  .insights {
    padding: 14px;
  }

  .insights {
    gap: 14px 10px;
  }

  .insights > div:nth-child(-n + 2) h2 {
    font-size: 0.94rem;
  }

  .insights > div:nth-child(-n + 2) .ranking-list {
    gap: 7px;
  }

  .paired-insight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 10px;
  }

  .paired-insight h2 {
    margin-bottom: 0;
  }

  .paired-insight .insight-label {
    margin-top: 10px;
  }

  .selected-country,
  .country-vote-overlay {
    padding: 14px;
  }

  .country-panel h2 {
    padding-right: 44px;
    font-size: clamp(1.45rem, 9vw, 2rem);
  }

  .vote-actions {
    grid-template-columns: 1fr 1fr;
  }

  .vote-actions button,
  .secondary-action,
  .search-box input {
    min-height: 48px;
  }

  #worldMap {
    min-height: 330px;
  }

  .map-controls {
    top: 10px;
    right: 10px;
  }

  .map-controls button {
    width: 32px;
    height: 32px;
  }

  .ranking-list li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 8px;
  }

  .ranking-list li > span {
    justify-self: start;
  }

  .insights > div:nth-child(-n + 2) .ranking-list strong {
    font-size: 0.86rem;
  }

  .insights > div:nth-child(-n + 2) .ranking-list small,
  .insights > div:nth-child(-n + 2) .ranking-list li > span {
    font-size: 0.7rem;
  }

  .map-panel .legend {
    width: min(320px, calc(100% - 18px));
    padding: 7px 8px;
    gap: 6px;
  }
}

@media (min-width: 901px) {
  .country-panel,
  .insights {
    max-height: min(720px, calc(100svh - 172px));
  }
}
