:root {
  --purple-900: #3b0764;
  --purple-800: #4c1d95;
  --purple-700: #5b21b6;
  --purple-600: #6d28d9;
  --purple-100: #ede9fe;
  --purple-50: #f5f3ff;
  --gold-600: #d97706;
  --gold-500: #f59e0b;
  --gold-100: #fef3c7;
  --bg: #f6f5fb;
  --card: #ffffff;
  --text: #1c1917;
  --muted: #57534e;
  --border: #e7e5e4;
  --shadow: 0 1px 2px rgb(28 25 23 / 0.04), 0 10px 28px rgb(91 33 182 / 0.07);
  --radius: 16px;
  --font: ui-sans-serif, system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --max: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; }
a { color: var(--purple-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; color: var(--text); }
.wrap { width: min(100% - 1.5rem, var(--max)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 20; }
.skip-link:focus { left: 1rem; top: 1rem; }

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: .04em; color: var(--text); text-decoration: none; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: conic-gradient(from 210deg, var(--purple-700), var(--gold-500), var(--purple-600));
  box-shadow: inset 0 0 0 2px #fff;
}
.logo-word { font-size: 1.15rem; }
.site-nav { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.site-nav a { color: var(--muted); font-weight: 600; text-decoration: none; }
.site-nav a:hover { color: var(--purple-700); }
.header-search input, .input, select, textarea {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .7rem .9rem;
  font: inherit;
  background: #fff;
  color: var(--text);
  width: 100%;
}
.header-search input { min-width: 180px; }
.nav-toggle { display: none; margin-left: auto; border: 1px solid var(--border); background: #fff; border-radius: 10px; padding: .45rem .7rem; font-weight: 600; }

.site-main { padding: 1.25rem 0 3.5rem; }
.hero {
  background: linear-gradient(160deg, var(--purple-50), #fff 55%, var(--gold-100));
  border: 1px solid #ede9fe;
  border-radius: 24px;
  padding: 2rem 1.25rem;
  margin-bottom: 2rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin: 0 0 .35rem; }
.hero .lede { font-size: 1.2rem; font-weight: 650; margin: 0 0 .5rem; color: var(--purple-800); }
.hero .sub { color: var(--muted); max-width: 42rem; }
.hero-search { display: flex; gap: .6rem; margin-top: 1.25rem; max-width: 36rem; }
.hero-search input { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 0; border-radius: 12px; padding: .75rem 1.1rem; font: inherit; font-weight: 700;
  cursor: pointer; background: var(--purple-700); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--purple-800); text-decoration: none; }
.btn-accent { background: var(--gold-600); color: #1c1917; }
.btn-accent:hover { background: var(--gold-500); }
.btn-ghost { background: #fff; color: var(--purple-700); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--purple-50); }

.section { margin: 2rem 0; }
.section h2 { margin-bottom: .85rem; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.tool-card, .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
}
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  height: 100%;
  min-height: 8.75rem;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tool-card:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 12px 30px rgb(91 33 182 / 0.12); }
.tool-card h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.tool-card .flag { margin-bottom: .6rem; }
.kicker { color: var(--purple-700); font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }

.why {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.why article {
  background: #fff;
  border-radius: var(--radius);
  padding: 1rem;
  border: 1px solid var(--border);
  height: 100%;
}
.pill { display: inline-block; background: var(--gold-100); color: #92400e; font-weight: 700; font-size: .78rem; padding: .2rem .5rem; border-radius: 999px; margin-bottom: .45rem; }

.tool-panel { background: #fff; border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow); padding: 1.25rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .85rem; align-items: end; }
label { display: block; font-weight: 650; font-size: .9rem; margin-bottom: .35rem; }
.result {
  margin-top: 1.25rem; padding: 1.1rem; border-radius: 16px;
  background: var(--purple-50); border: 1px solid var(--purple-100);
}
.result .big { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; margin: 0; }
.muted { color: var(--muted); }
.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; padding: .8rem 1rem; border-radius: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: .65rem .75rem; border-bottom: 1px solid var(--border); }
th { font-size: .85rem; color: var(--muted); }
.chart { width: 100%; height: 220px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 1rem; color: var(--muted); font-size: .9rem; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: .4rem; color: #a8a29a; }

.ad-slot { margin: 1rem auto; max-width: var(--max); padding: 0 .75rem; }
.ad-label { display: block; font-size: .7rem; color: #a8a29a; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .3rem; }
.ad-box { min-height: 90px; border: 1px dashed #d6d3d1; border-radius: 12px; display: grid; place-items: center; background: #fafaf9; }
.ad-placeholder { color: #a8a29a; font-size: .85rem; }

.country-hero { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: center; }
.flag { width: 88px; height: 58px; object-fit: cover; border-radius: 8px; box-shadow: var(--shadow); background: #eee; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.stat { background: #fff; border-radius: 14px; padding: .9rem; border: 1px solid var(--border); }
.stat span { display: block; color: var(--muted); font-size: .8rem; }
.stat strong { font-size: 1.05rem; }
.compare-winner { color: var(--purple-700); font-weight: 800; }
.bar { height: 10px; background: var(--purple-100); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--purple-600); }
.map-frame { width: 100%; height: 280px; border: 0; border-radius: 16px; }

.faq details { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: .85rem 1rem; margin-bottom: .6rem; }
.faq summary { cursor: pointer; font-weight: 700; }
.site-footer { background: #1c1917; color: #e7e5e4; padding: 2.5rem 0 1.25rem; }
.site-footer a { color: #e9d5ff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.site-footer h2 { font-size: .9rem; color: #fde68a; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .35rem 0; }
.footer-bottom { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; border-top: 1px solid #44403c; padding-top: 1rem; font-size: .9rem; }

.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a, .tabs button { border-radius: 999px; padding: .4rem .8rem; border: 1px solid var(--border); background: #fff; font-weight: 650; }
.tabs .is-active { background: var(--purple-700); color: #fff; border-color: var(--purple-700); }
.stack { display: grid; gap: 1rem; }
.prose { max-width: 48rem; }
.prose p { color: var(--muted); }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
code, .mono { font-family: ui-monospace, Consolas, monospace; font-size: .92em; }
.cite-box { white-space: pre-wrap; background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: 12px; }
.list-reset { list-style: none; padding: 0; }
.author-card, .paper-card { display: block; }

@media (max-width: 1020px) {
  .card-grid, .why { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    background: #fff; border-bottom: 1px solid var(--border); padding: 1rem;
    flex-direction: column; align-items: stretch;
  }
  .site-nav.is-open { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 1.4rem 1rem; }
  .card-grid, .why { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .footer-grid, .footer-bottom { grid-template-columns: 1fr; }
  .country-hero { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .card-grid, .why { grid-template-columns: 1fr; }
}
