:root {
  --ink: #17211f;
  --muted: #68736f;
  --line: #dbe2de;
  --paper: #f7f8f5;
  --panel: #ffffff;
  --sage: #6f8f82;
  --sage-dark: #425f55;
  --clay: #b77a61;
  --gold: #b99a55;
  --blue: #5f7893;
  --danger: #a65f5b;
  --shadow: 0 18px 50px rgba(23, 33, 31, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(247, 248, 245, 0.92), rgba(247, 248, 245, 1)),
    radial-gradient(circle at 12% 0%, rgba(111, 143, 130, 0.16), transparent 36%),
    radial-gradient(circle at 84% 8%, rgba(185, 154, 85, 0.12), transparent 30%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 28px 22px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 36px;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: conic-gradient(from 140deg, var(--sage), var(--gold), var(--clay), var(--sage));
  box-shadow: inset 0 0 0 7px #fff;
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  font-size: 18px;
  line-height: 1.05;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

.nav-item.active {
  color: var(--ink);
  background: #eef2ed;
  font-weight: 650;
}

.nav-icon {
  width: 18px;
  height: 18px;
  border: 1.5px solid currentColor;
  border-radius: 5px;
  opacity: 0.88;
}

.main {
  padding: 24px;
  min-width: 0;
}

.topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.search {
  width: min(560px, 100%);
  height: 44px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  box-shadow: 0 6px 24px rgba(23, 33, 31, 0.04);
}

.search input {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  outline: 0;
  color: var(--ink);
  padding: 0 14px;
}

.search input::placeholder {
  color: #77837f;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn {
  border: 0;
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn.primary {
  background: var(--ink);
  color: #fff;
  font-weight: 650;
}

.btn.icon {
  width: 40px;
  padding: 0;
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

.hero-copy,
.map-panel,
.section,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.hero-copy {
  min-height: 330px;
  padding: 38px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.eyebrow {
  color: var(--sage-dark);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  margin: 16px 0 14px;
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 52px;
  line-height: 1.02;
  letter-spacing: 0;
  font-weight: 500;
}

.lead {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.quick-filters,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-filters {
  margin-top: 26px;
}

.chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fbfcfa;
  color: #40514b;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 620;
}

button.chip.active {
  background: #e7eee9;
  border-color: #c8d6ce;
  color: var(--ink);
}

.map-panel {
  min-height: 330px;
  background: #eef2ed;
  overflow: hidden;
  position: relative;
}

.map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(104, 115, 111, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(104, 115, 111, 0.1) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.7;
}

.route {
  position: absolute;
  inset: 48px 36px;
  border: 1px solid rgba(66, 95, 85, 0.24);
  border-radius: 50%;
  transform: rotate(-14deg);
}

.country-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 7px rgba(111, 143, 130, 0.18);
}

.dot-1 { left: 58%; top: 25%; }
.dot-2 { left: 43%; top: 44%; background: var(--gold); box-shadow: 0 0 0 7px rgba(185, 154, 85, 0.18); }
.dot-3 { left: 68%; top: 55%; background: var(--blue); box-shadow: 0 0 0 7px rgba(95, 120, 147, 0.16); }
.dot-4 { left: 32%; top: 63%; background: var(--clay); box-shadow: 0 0 0 7px rgba(183, 122, 97, 0.16); }

.map-card {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 245px;
  border: 1px solid rgba(219, 226, 222, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 16px;
  box-shadow: 0 18px 42px rgba(23, 33, 31, 0.14);
}

.map-card small {
  color: var(--muted);
  font-weight: 650;
}

.map-card h2 {
  margin: 6px 0 12px;
  font-size: 22px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.score-row strong {
  color: var(--ink);
  font-size: 20px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
}

.section {
  overflow: hidden;
}

.section-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.country-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.country {
  min-height: 214px;
  padding: 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.country-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.country h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.country p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.badge {
  border: 1px solid #cfd9d3;
  border-radius: 999px;
  color: var(--sage-dark);
  padding: 5px 9px;
  font-size: 12px;
  white-space: nowrap;
  background: #f5f8f5;
}

.metric {
  display: grid;
  gap: 8px;
}

.metric-line {
  display: grid;
  grid-template-columns: 64px 1fr 34px;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.bar {
  height: 6px;
  border-radius: 999px;
  background: #e9ede9;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--sage);
}

.card-actions {
  display: flex;
  gap: 8px;
}

.mini-btn {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
}

.mini-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.resources {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.resource {
  min-height: 88px;
  padding: 16px;
  background: #fff;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
}

.resource-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #edf3ef;
  display: grid;
  place-items: center;
  color: var(--sage-dark);
  font-weight: 800;
}

.resource h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.resource p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.page-title {
  margin-bottom: 20px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.page-title h1 {
  margin: 8px 0;
  font-size: 42px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
}

.detail-panel {
  padding: 22px;
  margin-bottom: 20px;
}

.detail-panel h2 {
  margin: 0 0 12px;
  font-size: 19px;
}

.detail-panel p {
  color: var(--muted);
  line-height: 1.68;
}

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

.fact {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.fact span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.fact strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

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

.analysis-list li {
  position: relative;
  padding: 12px 12px 12px 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: #40514b;
  line-height: 1.55;
}

.analysis-list li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 19px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
}

.analysis-list.caution li::before {
  background: var(--clay);
}

.visa-routes {
  display: grid;
  gap: 10px;
}

.visa-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.visa-route h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.visa-route p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.visa-route span {
  align-self: start;
  justify-self: end;
  max-width: 180px;
  padding: 6px 10px;
  border: 1px solid #cfd9d3;
  border-radius: 999px;
  background: #f5f8f5;
  color: var(--sage-dark);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.fineprint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.compare-table th,
.compare-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px;
  text-align: left;
  vertical-align: top;
}

.compare-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.empty {
  padding: 30px;
  color: var(--muted);
  text-align: center;
  background: #fff;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 10;
}

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

  .sidebar {
    display: none;
  }

  .main {
    padding: 16px;
  }

  .hero,
  .content-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

  h1 {
    font-size: 42px;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

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

  .hero-copy {
    padding: 24px;
    min-height: auto;
  }

  h1,
  .page-title h1 {
    font-size: 34px;
  }

  .country-list,
  .fact-grid {
    grid-template-columns: 1fr;
  }

  .map-card {
    width: auto;
    left: 18px;
  }

  .resource {
    grid-template-columns: 36px 1fr;
  }

  .resource .mini-btn {
    grid-column: 2;
    justify-self: start;
  }

  .visa-route {
    grid-template-columns: 1fr;
  }

  .visa-route span {
    justify-self: start;
    max-width: 100%;
  }
}
