:root {
  color-scheme: light;
  --bg: #f6f3ed;
  --surface: #fffaf1;
  --surface-strong: #ffffff;
  --text: #20201d;
  --muted: #6f6a60;
  --line: #dfd7ca;
  --accent: #2e7d6d;
  --accent-soft: #dcebe5;
  --accent-strong: #174f45;
  --danger: #9b3a30;
  --shadow: 0 18px 40px rgba(54, 47, 35, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(46, 125, 109, 0.13), transparent 30rem),
    linear-gradient(180deg, #fbf7ef 0%, var(--bg) 45%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 18px 14px 36px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 2px 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.02em;
}

h1 {
  max-width: 11ch;
  font-size: clamp(2.2rem, 11vw, 5.7rem);
  line-height: 0.92;
}

h2 {
  font-size: 1rem;
}

.stats {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 54px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.72);
  box-shadow: 0 8px 20px rgba(54, 47, 35, 0.08);
}

.stats span {
  display: inline-block;
  color: var(--muted);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  will-change: transform, opacity;
}

.stats span.is-ticking {
  animation: count-roll 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes count-roll {
  0% {
    transform: scale(0.98);
  }

  62% {
    transform: scale(1.035);
  }

  100% {
    transform: scale(1);
  }
}

.controls,
.selected-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 241, 0.86);
  box-shadow: var(--shadow);
}

.controls {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  gap: 14px;
  margin-top: 32px;
  padding: 14px;
  backdrop-filter: blur(18px);
}

.search-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.search-box input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 44px 0 16px;
  color: var(--text);
  background: var(--surface-strong);
  outline-color: var(--accent);
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.search-input-wrap {
  position: relative;
  display: block;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  background: rgba(223, 215, 202, 0.72);
  transform: translateY(-50%);
}

.search-clear[hidden] {
  display: none;
}

.country-card,
.chip,
.ghost-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-strong);
}

.country-card.is-selected {
  border-color: rgba(186, 139, 51, 0.34);
  color: #6a4d17;
  background: rgba(199, 155, 62, 0.2);
}

.selected-panel {
  margin-top: 14px;
  padding: 14px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ghost-button {
  min-height: 36px;
  padding: 0 13px;
  color: var(--danger);
}

.ghost-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px 0 12px;
  background: var(--surface-strong);
}

.country-flag {
  flex: 0 0 auto;
  font-size: 1.1rem;
  line-height: 1;
}

.chip.is-featured {
  border-color: rgba(186, 139, 51, 0.28);
  background: rgba(199, 155, 62, 0.16);
}

.country-detail-link {
  color: #6a4d17;
  font-weight: 800;
  text-decoration: none;
}

.country-detail-link:hover {
  text-decoration: underline;
}

.country-activity-count {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1;
  background: rgba(255, 250, 241, 0.72);
  box-shadow: 0 6px 14px rgba(54, 47, 35, 0.07);
}

.chip button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}

.empty-state {
  align-self: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.map-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: transparent;
  box-shadow: var(--shadow);
}

.map-stats {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
}

.map-tooltip {
  position: absolute;
  z-index: 3;
  max-width: min(220px, calc(100% - 20px));
  padding: 7px 10px;
  border: 1px solid rgba(223, 215, 202, 0.84);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  background: rgba(255, 250, 241, 0.92);
  box-shadow: 0 10px 22px rgba(54, 47, 35, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(3px);
  transition: opacity 90ms ease, transform 120ms ease;
}

.map-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.world-map {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 230px;
  aspect-ratio: 2000 / 857;
  border: 0;
  opacity: 0;
  transition: opacity 180ms ease;
}

.world-map.is-ready {
  opacity: 1;
}

.country-grid {
  display: grid;
  gap: 18px;
  margin-top: 14px;
}

.country-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.country-section + .country-section {
  margin-top: 14px;
}

.country-section-title {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.country-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  padding: 0 14px;
  text-align: left;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(54, 47, 35, 0.06);
}

.country-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.country-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-code {
  display: none;
}

.no-results {
  grid-column: 1 / -1;
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
}

.country-page {
  max-width: 880px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 4px;
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.country-hero h1 {
  max-width: none;
}

.country-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.country-title-row h1 {
  max-width: none;
}

.country-stats {
  margin-top: 4px;
}

.country-checklists {
  display: grid;
  gap: 14px;
}

.country-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.country-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(54, 47, 35, 0.08);
}

.checklist-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 241, 0.86);
  box-shadow: var(--shadow);
}

.checklist-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.checklist-note {
  color: var(--muted);
}

.checklist-heading h2 {
  font-size: 1.58rem;
  line-height: 1.02;
}

.section-progress {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.96rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1;
  background: rgba(255, 250, 241, 0.72);
  box-shadow: 0 8px 20px rgba(54, 47, 35, 0.08);
}

.section-progress[hidden] {
  display: none;
}

.checklist-note {
  margin: 0 0 4px;
  font-size: 0.94rem;
}

.checklist-item {
  display: block;
  padding: 0 0 12px;
  color: var(--text);
  cursor: pointer;
}

.checklist-heading + .checklist-item,
.checklist-note + .checklist-item {
  border-top: 0;
}

.checklist-checkbox {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  opacity: 0;
}

.checklist-item.has-image,
.checklist-item.has-placeholder {
  min-height: 0;
}

.checklist-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 18px;
  background: var(--bg);
  box-shadow: 0 8px 20px rgba(54, 47, 35, 0.08);
  clip-path: inset(0 round 18px);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.checklist-image,
.checklist-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  clip-path: inset(0 round 18px);
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  transition: filter 4200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.checklist-image {
  object-fit: cover;
  filter: grayscale(0.78) brightness(1.28) saturate(0.36) blur(1.6px);
}

.checklist-placeholder {
  display: block;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 250, 241, 0.9), rgba(236, 231, 223, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  filter: brightness(0.86) blur(0.7px);
}

.checklist-item.is-checked .checklist-image,
.checklist-item.is-checked .checklist-placeholder {
  filter: grayscale(0) brightness(1) saturate(1) blur(0);
}

.checklist-checkmark {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 0;
  height: 26px;
  border-radius: 999px;
  color: var(--surface);
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 5px rgba(32, 32, 29, 0.48);
  background: rgba(46, 125, 109, 0.7);
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(4px) scale(0.9);
  transition: opacity 180ms ease, transform 180ms ease, width 180ms ease;
}

.checklist-item.is-checked .checklist-checkmark {
  width: 26px;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.checklist-text {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  display: block;
  color: var(--surface);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.18;
  text-shadow: 0 1px 7px rgba(32, 32, 29, 0.62);
  transition: left 180ms ease;
}

.checklist-text::before {
  position: absolute;
  inset: -7px -9px;
  z-index: -1;
  content: "";
  border-radius: 12px;
  background: rgba(32, 32, 29, 0.48);
  filter: blur(3px);
  pointer-events: none;
}

.checklist-media::after {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 58%;
  content: "";
  background: linear-gradient(180deg, rgba(32, 32, 29, 0), rgba(32, 32, 29, 0.78));
  pointer-events: none;
}

.checklist-item.is-checked .checklist-text {
  left: 14px;
}

@media (min-width: 720px) {
  .app-shell {
    padding: 34px 28px 56px;
  }

  .hero {
    padding-bottom: 28px;
  }

  h1 {
    max-width: none;
  }

  .stats {
    width: 60px;
  }

  .stats span {
    font-size: 1.5rem;
  }

  .controls {
    align-items: end;
    border-radius: 28px;
    padding: 16px;
  }

  .country-section-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .country-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

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

  .checklist-heading,
  .checklist-note {
    grid-column: 1 / -1;
  }

  .checklist-heading h2 {
    font-size: 1.82rem;
  }

  .section-progress {
    width: 38px;
    font-size: 1.02rem;
  }

  .checklist-heading + .checklist-item,
  .checklist-note + .checklist-item {
    border-top: 0;
  }
}

@media (min-width: 1040px) {
  .country-section-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (min-width: 1320px) {
  .country-page {
    width: min(1648px, 100%);
    max-width: none;
  }

  .country-page .checklist-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
