:root {
  --ink: #101828;
  --ink-soft: #475467;
  --ink-faint: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --bg: #fbfcfd;
  --surface: #ffffff;
  --brand: #1b4d7a;
  --brand-dark: #143a5c;
  --brand-soft: #eaf2f8;
  --ok: #15803d;
  --ok-soft: #ecfdf3;
  --ok-line: #abefc6;
  --warn: #b45309;
  --warn-soft: #fffaeb;
  --warn-line: #fedf89;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --danger-line: #fecdca;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px -12px rgba(16, 24, 40, 0.12);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { line-height: 1.25; letter-spacing: -0.015em; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }

.wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- header ---------- */

.site-head {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  font-weight: 650;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 18px;
  font-size: 0.875rem;
}

.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover { color: var(--brand); }

/* ---------- hero ---------- */

.hero { padding: 44px 0 28px; }

.hero h1 {
  font-size: clamp(1.75rem, 5.2vw, 2.5rem);
  font-weight: 700;
}

.hero .lede {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

.stamp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--ink-faint);
  background: var(--brand-soft);
  border: 1px solid #cfe1ef;
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  margin-bottom: 18px;
}

.stamp .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* ---------- form ---------- */

.field { margin-bottom: 20px; }
.field:last-of-type { margin-bottom: 24px; }

.field > label,
.field > .field-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

.field .hint {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  font-weight: 400;
  margin: 6px 0 0;
}

select, input[type="number"] {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 11px 12px;
  appearance: none;
  min-height: 46px;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23475467' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 38px;
}

select:focus-visible,
input:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* segmented radio pills */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

fieldset legend {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0;
  margin-bottom: 8px;
}

.seg {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.seg label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 0.9375rem;
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}

.seg input {
  appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  flex: none;
  position: relative;
}

.seg input:checked {
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: inset 0 0 0 3px var(--surface);
}

.seg label:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  font-weight: 550;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 12px 20px;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover { background: var(--brand-dark); }

/* ---------- result ---------- */

.result {
  margin-top: 20px;
  border-left: 4px solid var(--line-strong);
  scroll-margin-top: 20px;
}

.result[data-status="visa-free"] { border-left-color: var(--ok); background: var(--ok-soft); }
.result[data-status="transit"] { border-left-color: var(--warn); background: var(--warn-soft); }
.result[data-status="visa-required"] { border-left-color: var(--danger); background: var(--danger-soft); }
.result[data-status="invalid"] { border-left-color: var(--line-strong); }

.result-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  margin: 0 0 12px;
}

.result[data-status="visa-free"] .result-badge { background: #d1fadf; color: #05603a; }
.result[data-status="transit"] .result-badge { background: #fef0c7; color: #93370d; }
.result[data-status="visa-required"] .result-badge { background: #fee4e2; color: #912018; }
.result[data-status="invalid"] .result-badge { background: #f2f4f7; color: var(--ink-soft); }

.result-title {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  margin-bottom: 8px;
}

.result-summary { color: var(--ink-soft); }

.result-limits {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  margin: 20px 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(16, 24, 40, 0.06);
  border-radius: 10px;
  font-size: 0.9375rem;
}

.result-limits dt { color: var(--ink-faint); }
.result-limits dd { margin: 0; font-weight: 600; }

.result-hint {
  font-size: 0.9375rem;
  font-weight: 550;
  padding: 12px 14px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed var(--line-strong);
}

.result-notes {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  padding-left: 20px;
  margin: 0 0 16px;
}

.result-notes li { margin-bottom: 10px; }

.result-foot {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
}

/* ---------- reference sections ---------- */

section.block { padding: 40px 0 0; }

section.block > h2 {
  font-size: clamp(1.25rem, 3.6vw, 1.5rem);
  margin-bottom: 6px;
}

section.block > .sub {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  margin-bottom: 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.chips li {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 9px;
}

details {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 0 16px;
  margin-bottom: 10px;
}

details summary {
  cursor: pointer;
  padding: 15px 0;
  font-weight: 600;
  font-size: 0.9375rem;
  list-style: none;
}

details summary::-webkit-details-marker { display: none; }

details summary::after {
  content: "+";
  float: right;
  color: var(--ink-faint);
  font-weight: 400;
}

details[open] summary::after { content: "–"; }

details p:last-child { margin-bottom: 16px; }

.codeblock {
  margin: 0 0 14px;
  padding: 16px 18px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.65;
}

.codeblock code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  white-space: pre;
}

.sources {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.sources ol { padding-left: 20px; }
.sources li { margin-bottom: 10px; }

/* ---------- footer ---------- */

.site-foot {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 28px 0 40px;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.site-foot p { margin-bottom: 8px; }

[hidden] { display: none !important; }

@media (max-width: 520px) {
  .card { padding: 18px; }
  .hero { padding: 32px 0 22px; }
  .result-limits { grid-template-columns: 1fr; gap: 2px 0; }
  .result-limits dt { font-size: 0.8125rem; margin-top: 8px; }
  .site-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
