:root {
  --bg: #f4f7f2;
  --panel: #ffffff;
  --ink: #1a2b1f;
  --muted: #6b7f70;
  --accent: #2e8b4a;
  --accent-light: #e6f4ec;
  --border: #d6e3d6;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(30, 60, 40, 0.07);
  --shadow-lg: 0 8px 32px rgba(30, 60, 40, 0.10);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 32px 0 48px;
}

/* ── Hero ─────────────────────────────────────────── */
.hero {
  margin-bottom: 28px;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
}

/* ── Cards ────────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.big-number {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}

#all-visit-count {
  color: #a0582a;
}

/* ── Stats grid ───────────────────────────────────── */
.stats {
  margin: 16px 0;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
}

@media (max-width: 600px) {
  .stats {
    grid-template-columns: 1fr;
  }
}

/* ── Country list ─────────────────────────────────── */
.country-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
}

.country-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--accent-light);
  transition: transform 0.12s;
}

.country-chip:hover {
  transform: translateY(-1px);
}

.country-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.country-count {
  flex-shrink: 0;
  min-width: 26px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: #d0ebd8;
  border-radius: 999px;
  padding: 2px 8px;
}

/* ── Landing page ─────────────────────────────────── */
.landing-card {
  max-width: 420px;
  text-align: center;
  padding: 36px 28px;
}

.landing-icon {
  font-size: 2.6rem;
  margin-bottom: 10px;
}

.landing-card h2 {
  font-size: 1.15rem;
  text-transform: none;
  color: var(--ink);
  letter-spacing: 0;
}

.landing-card p {
  color: var(--muted);
  margin-bottom: 18px;
  font-size: 0.95rem;
}

.btn {
  display: inline-block;
  padding: 10px 28px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.btn:hover {
  background: #257040;
  transform: translateY(-1px);
}

/* ── Map ──────────────────────────────────────────── */
.map-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow-lg);
}

#map,
#all-map {
  width: 100%;
  height: 58vh;
  min-height: 340px;
  border-radius: 10px;
}

.map-section {
  margin-top: 14px;
}

.map-section.hidden {
  display: none;
}

/* ── Toggle ───────────────────────────────────────── */
.map-toggle {
  display: inline-flex;
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.toggle-btn {
  padding: 10px 24px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toggle-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.toggle-btn:hover {
  background: var(--accent-light);
}

.toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ── Recent visits table ──────────────────────────── */
.recent-table-wrap {
  max-height: 320px;
  overflow-y: auto;
}

.recent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.recent-table th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 6px 8px 8px;
  border-bottom: 2px solid var(--border);
}

.recent-table td {
  padding: 8px 8px;
  border-bottom: 1px solid #edf2ed;
}

.recent-table tbody tr:hover {
  background: var(--accent-light);
}

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

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 760px) {
  .container {
    padding: 20px 0 32px;
  }

  #map,
  #all-map {
    height: 48vh;
    min-height: 280px;
  }
}
