: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; }
}

/* ---------- guide pages ---------- */

.crumbs {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  padding: 22px 0 0;
  margin: 0;
}

.crumbs a { color: var(--ink-faint); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.crumbs span { margin: 0 4px; }

.guide-head { padding: 14px 0 26px; }

.guide-head h1 {
  font-size: clamp(1.65rem, 4.8vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.guide-head .lede {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  margin: 0;
}

.guide h2 {
  font-size: clamp(1.25rem, 3.4vw, 1.5rem);
  margin: 44px 0 12px;
  padding-top: 4px;
}

.guide h3 { font-size: 1.0625rem; margin: 0 0 8px; }

.guide > p,
.guide > ul,
.guide > ol { color: var(--ink); }

.guide > p { margin: 0 0 14px; }

.guide .sub {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  margin: -4px 0 18px;
}

/* verdict card */

.verdict {
  background: var(--brand-soft);
  border: 1px solid #cfe1ef;
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 4px 0 8px;
}

.verdict-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 10px;
}

.verdict ul { margin: 0; padding-left: 18px; }

.verdict li { font-size: 0.9375rem; margin-bottom: 9px; }
.verdict li:last-child { margin-bottom: 0; }

/* two-route comparison */

.routes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 20px 0 16px;
}

.route {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.route--good { border-top: 3px solid var(--ok); }
.route--bad { border-top: 3px solid var(--warn); }

.route-sub {
  font-size: 0.8125rem;
  color: var(--ink-faint);
  margin: 0 0 12px;
}

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

.route li { margin-bottom: 9px; }
.route li:last-child { margin-bottom: 0; }

/* callout */

.callout {
  background: var(--warn-soft);
  border: 1px solid var(--warn-line);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.9375rem;
  color: #7a4a09;
  margin: 18px 0;
}

/* question list */

.ask {
  list-style: none;
  counter-reset: ask;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.ask > li {
  counter-increment: ask;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px 4px 52px;
  position: relative;
}

.ask > li::before {
  content: counter(ask);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.ask-q {
  font-weight: 600;
  font-size: 0.9375rem;
  margin: 0 0 6px;
}

.ask li > p:last-child {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

/* evidence badges */

.grade {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.grade--claimed { background: var(--brand-soft); color: var(--brand); }
.grade--contested { background: var(--warn-soft); color: var(--warn); }
.grade--denied { background: var(--danger-soft); color: var(--danger); }
.grade--local { background: #f2f4f7; color: var(--ink-soft); }

.grade-legend {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 9px;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.grade-legend li { display: flex; gap: 9px; align-items: baseline; }
.grade-legend .grade { flex: none; }

/* provider cards */

.p-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 0 16px;
}

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

.p-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.p-head h3 { margin: 0; font-size: 1rem; }

.p-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 14px;
  font-size: 0.8125rem;
  margin: 0 0 13px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.p-facts dt { color: var(--ink-faint); }
.p-facts dd { margin: 0; font-weight: 550; }

.p-note {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
}

/* pitfalls */

.pitfall {
  border-left: 2px solid var(--line-strong);
  padding: 0 0 0 18px;
  margin-bottom: 22px;
}

.pitfall h3 { font-size: 1rem; margin-bottom: 6px; }

.pitfall p {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: 0;
}

/* steps */

.steps { padding-left: 20px; margin: 0 0 16px; }

.steps li {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
  padding-left: 4px;
}

.steps strong { color: var(--ink); }

/* back-link block */

.crosslink {
  margin: 44px 0 0;
  padding: 22px;
  background: var(--brand-soft);
  border: 1px solid #cfe1ef;
  border-radius: var(--radius);
}

.crosslink p {
  font-size: 0.9375rem;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.crosslink strong { color: var(--ink); }

.btn--inline {
  width: auto;
  min-height: 44px;
  font-size: 0.9375rem;
  padding: 10px 20px;
  text-decoration: none;
}

@media (max-width: 640px) {
  .routes,
  .p-grid { grid-template-columns: 1fr; }
  .ask > li { padding: 16px 16px 4px 48px; }
  .guide h2 { margin-top: 34px; }
}

/* In-page nav for narrow screens: the header nav is hidden there, and a
   four-thousand-pixel article with no way to jump around is unusable. */
.toc { display: none; }

@media (max-width: 640px) {
  .toc {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0 4px;
    margin: 0 0 6px;
    scrollbar-width: none;
  }

  .toc::-webkit-scrollbar { display: none; }

  .toc a {
    flex: none;
    font-size: 0.8125rem;
    color: var(--brand);
    background: var(--brand-soft);
    border: 1px solid #cfe1ef;
    border-radius: 999px;
    padding: 6px 12px;
    text-decoration: none;
    white-space: nowrap;
  }
}

/* In-page nav for narrow screens: the header nav is hidden there, and a
   four-thousand-pixel article with no way to jump around is unusable. */
.toc { display: none; }

@media (max-width: 640px) {
  .toc {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 0 4px;
    margin: 0 0 6px;
    scrollbar-width: none;
  }

  .toc::-webkit-scrollbar { display: none; }

  .toc a {
    flex: none;
    font-size: 0.8125rem;
    color: var(--brand);
    background: var(--brand-soft);
    border: 1px solid #cfe1ef;
    border-radius: 999px;
    padding: 6px 12px;
    text-decoration: none;
    white-space: nowrap;
  }
}

/* ---------------------------------------------------- payment guide */

.grade--official { background: var(--ok-soft); color: var(--ok); }
.grade--consistent { background: var(--brand-soft); color: var(--brand); }
.grade--promo { background: var(--warn-soft); color: var(--warn); }

.p-note--warn {
  color: var(--warn);
  border-top: 1px dashed var(--warn-line);
  padding-top: 9px;
  margin-top: 9px;
}

/* Tables are the right shape for money, and the wrong shape for a 320px
   screen. Scroll the table, never the page. */
.tbl-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  min-width: 500px;
}

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

.tbl thead th {
  background: #f8fafc;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.tbl tbody tr:last-child td { border-bottom: 0; }

.tbl .num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}

.tbl-note td {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-faint);
  padding-top: 0;
  padding-bottom: 14px;
  background: #fcfcfd;
}

.tbl-note:last-child td { border-bottom: 0; }

/* Symptom → cause → fix. The keys sit in a narrow gutter so the three lines
   read as a stack rather than as three unrelated sentences. */
.fixes {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
}

.fix {
  padding: 15px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
}

.fix-symptom {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
}

.fix-line {
  position: relative;
  margin: 0 0 8px;
  padding-left: 58px;
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

.fix-line:last-child { margin-bottom: 0; }

.fix-key {
  position: absolute;
  left: 0;
  top: 1px;
  width: 50px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

@media (max-width: 520px) {
  .fix { padding: 14px 15px; }
  .fix-line { padding-left: 0; }
  .fix-key { position: static; display: block; margin-bottom: 2px; }
}

/* Body links inside prose: brand-coloured rather than browser blue, underlined
   because a callout's background makes a subtle colour shift easy to miss. */
.guide p a,
.guide li a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: #a8c4da;
}

.guide p a:hover,
.guide li a:hover { text-decoration-color: var(--brand); }
