:root {
  --ink: #0b1220;
  --ink-2: #1f2a3d;
  --muted: #5d6b82;
  --line: #e3e8f0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --accent: #0aa5c8;
  --accent-ink: #067a95;
  --ok: #1e7b45;
  --ok-bg: #e8f6ee;
  --warn: #8a5a00;
  --warn-bg: #fff5dc;
  --error: #b03a3a;
  --error-bg: #fdeeee;
  --info: #23508f;
  --info-bg: #e9f1fc;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 18, 32, 0.06), 0 4px 16px rgba(11, 18, 32, 0.04);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); line-height: 1.5; font-size: 15px; }
a { color: var(--accent-ink); }
h1 { font-size: 1.6rem; margin: 0 0 0.25rem; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
h3 { font-size: 1rem; margin: 0 0 0.5rem; }
p { margin: 0 0 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.topbar { background: var(--ink); color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.brand b { color: #3fd2f2; font-weight: 600; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #fff; color: var(--ink); font-size: 0.95rem; }
.nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a, .nav button.link { color: #c9d4e6; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 0.93rem; }
.nav a:hover, .nav button.link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav a.active { color: #fff; background: rgba(63, 210, 242, 0.16); }
form.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; cursor: pointer; font: inherit; }

.banner { padding: 10px 16px; text-align: center; font-size: 0.93rem; }
.banner.demo { background: #fff0c2; color: #5c4300; }
.banner.warn { background: var(--error-bg); color: var(--error); }

main.wrap { padding-top: 28px; padding-bottom: 40px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.big { font-size: 1.35rem; font-weight: 600; margin-bottom: 4px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.error { background: var(--error-bg); color: var(--error); }
.badge.info { background: var(--info-bg); color: var(--info); }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 0.95rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }
.flash.error { background: var(--error-bg); color: var(--error); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--accent); color: #fff; }
.btn:hover { background: var(--accent-ink); }
.btn.secondary { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.secondary:hover { background: #f0f3f8; }
.btn.danger { background: #fff; color: var(--error); border-color: #f1caca; }
.btn.danger:hover { background: var(--error-bg); }
.btn.small { padding: 6px 10px; font-size: 0.86rem; border-radius: 8px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

progress { width: 100%; height: 10px; border-radius: 999px; overflow: hidden; appearance: none; border: 0; background: #e6ecf4; }
progress::-webkit-progress-bar { background: #e6ecf4; }
progress::-webkit-progress-value { background: var(--accent); }
progress::-moz-progress-bar { background: var(--accent); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 500; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #eef3f9; border: 1px solid var(--line); border-radius: 999px; padding: 3px 4px 3px 12px; font-size: 0.9rem; }
.chip.plain { padding: 3px 12px; }
.chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px 8px; border-radius: 999px; }
.chip button:hover { background: var(--error-bg); color: var(--error); }

label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 4px; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.84rem; }
input[type="text"], input[type="password"], input[type="number"], select { width: 100%; padding: 9px 12px; border: 1px solid #cfd7e4; border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(10, 165, 200, 0.35); outline-offset: 1px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.row > .grow { flex: 1 1 200px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.checkbox input { width: 18px; height: 18px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #f0f4fa; color: var(--ink-2); font-weight: 600; position: sticky; top: 0; white-space: normal; }
tr:last-child td { border-bottom: 0; }
td.wrap-text { white-space: normal; min-width: 200px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.login-box { max-width: 400px; margin: 48px auto; }
.login-box .card { padding: 28px; }
.error-text { color: var(--error); font-weight: 600; margin-bottom: 12px; }
.footer { color: var(--muted); font-size: 0.82rem; padding-bottom: 24px; }
.stack > * + * { margin-top: 10px; }
.country-card h3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mt { margin-top: 16px; }
.mt-sm { margin-top: 12px; }

/* Destinations grouped by continent / region */
.group-title { font-size: 1.15rem; margin: 24px 0 4px; }
.group-subtitle { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 12px 0 8px; }

/* Results grouped by continent / region */
table.results th.num { text-align: right; }
table.results tr.group-row th { background: #e6eef8; color: var(--ink); text-align: left; position: static; font-size: 0.86rem; letter-spacing: 0.02em; }
table.results td a { font-weight: 600; }
table.results td.wrap-text { min-width: 160px; }
code { background: rgba(0, 0, 0, 0.06); padding: 1px 6px; border-radius: 6px; font-size: 0.88em; }

@media (max-width: 640px) {
  main.wrap { padding-top: 18px; }
  h1 { font-size: 1.35rem; }
  .card { padding: 16px; }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  table.results, table.results tbody, table.results tr, table.results td { display: block; width: 100%; }
  table.results thead { display: none; }
  table.results tr.group-row { display: block; }
  table.results tr.group-row th { display: block; border-radius: 8px; margin-top: 12px; }
  table.results tbody tr:not(.group-row) { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; padding: 6px 0; }
  table.results td { border: 0; padding: 4px 12px; white-space: normal; text-align: left; }
  table.results td.num { text-align: left; }
  table.results td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.82rem; }
}
