/* Visa to Passport: shared stylesheet. Tokens first; dark mode redefines them. */
:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --surface-2: #fbf9f4;
  --ink: #1b2230;
  --ink-2: #3a4352;
  --muted: #646d7b;
  --line: #e3ddd0;
  --accent: #0f6b5c;
  --accent-strong: #0a5246;
  --accent-soft: #e2f0ec;
  --accent-ink: #ffffff;
  --warn: #8a5300;
  --warn-soft: #fcf1d8;
  --opt: #5a5f8a;
  --opt-soft: #eceefa;
  --code-bg: #f1ede3;
  --shadow: 0 1px 2px rgba(27, 34, 48, .06), 0 4px 16px rgba(27, 34, 48, .05);
  --radius: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10141a; --surface: #171c24; --surface-2: #1b212a; --ink: #e9e6df; --ink-2: #c9c6bf; --muted: #98a1ad;
    --line: #2a313c; --accent: #56c4ab; --accent-strong: #7bd6c1; --accent-soft: #17332d; --accent-ink: #0d1a17;
    --warn: #f1c46c; --warn-soft: #3a2d12; --opt: #b4b9ea; --opt-soft: #262a45; --code-bg: #20262f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #10141a; --surface: #171c24; --surface-2: #1b212a; --ink: #e9e6df; --ink-2: #c9c6bf; --muted: #98a1ad;
  --line: #2a313c; --accent: #56c4ab; --accent-strong: #7bd6c1; --accent-soft: #17332d; --accent-ink: #0d1a17;
  --warn: #f1c46c; --warn-soft: #3a2d12; --opt: #b4b9ea; --opt-soft: #262a45; --code-bg: #20262f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25); color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.65 var(--sans); }
a { color: var(--accent); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }
code { font: 0.88em var(--mono); background: var(--code-bg); padding: .1em .35em; border-radius: 5px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; font-size: .85em; overflow-wrap: normal; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bar { max-width: 1480px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 650 20px/1 var(--serif); letter-spacing: -.01em; }
.tag { color: var(--muted); font-size: 14px; border-left: 1px solid var(--line); padding-left: 16px; }

/* layout */
.layout { max-width: 1480px; margin: 0 auto; padding: 32px 24px 56px; display: grid; grid-template-columns: 250px minmax(0, 1fr) 220px; gap: 40px; align-items: start; }
.layout.wide { grid-template-columns: minmax(0, 1fr); max-width: 1080px; }
.sidebar, .toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; font-size: 14px; }
.nav-head { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-list { list-style: none; margin: 0 0 24px; padding: 0; }
.nav-list a { display: flex; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; line-height: 1.35; }
.nav-list a:hover { background: var(--surface); color: var(--ink); }
.nav-list a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.step { font: 600 12px/1.6 var(--mono); color: var(--muted); min-width: 1.6em; }
.nav-list a[aria-current="page"] .step { color: var(--accent); }
.nav-toggle { display: none; }
.toc ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 4px 0; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--accent); }

/* document pages */
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 48px 48px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
h1, h2, h3 { font-family: var(--serif); font-weight: 650; letter-spacing: -.015em; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(30px, 4.2vw, 44px); margin: 0 0 12px; }
.doc h2 { font-size: 26px; margin: 48px 0 14px; padding-top: 24px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 19px; margin: 32px 0 10px; }
.doc h2 + h3 { margin-top: 18px; }
.lede { font-size: 19px; color: var(--ink-2); margin: 0 0 20px; max-width: 62ch; }
.doc p, .doc li { max-width: 78ch; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin: 6px 0; }
.doc li > ul { margin-top: 4px; }
.doc blockquote { margin: 0 0 24px; padding: 12px 16px; background: var(--warn-soft); border-left: 4px solid var(--warn); border-radius: 0 10px 10px 0; color: var(--ink); }
.doc blockquote p { margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 28px; }
.checked { font-size: 13px; color: var(--accent-strong); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; font-weight: 500; }
.print { font: 500 13px var(--sans); color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.print:hover { border-color: var(--accent); color: var(--accent); }
strong.check { color: var(--warn); background: var(--warn-soft); padding: 0 .3em; border-radius: 4px; }

/* tables */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
th { background: var(--surface-2); font-weight: 600; font-size: 13px; color: var(--ink-2); white-space: nowrap; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; white-space: nowrap; }
td a { overflow-wrap: anywhere; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; margin-right: 2px; white-space: nowrap; }
.pill-mandatory { background: var(--accent-soft); color: var(--accent-strong); }
.pill-if { background: var(--warn-soft); color: var(--warn); }
.pill-optional { background: var(--opt-soft); color: var(--opt); }

/* pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.pager a { display: block; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.pager .next { text-align: right; }

/* home */
.hero { padding: 40px 0 24px; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); max-width: 16ch; line-height: 1.05; }
.hero .lede { font-size: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; border: 1px solid var(--accent); }
.btn:hover { background: var(--accent-strong); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent-strong); }
.section { margin-top: 56px; }
.section h2 { font-size: 30px; margin: 0 0 8px; }
.section-lede { color: var(--ink-2); max-width: 70ch; margin: 0 0 24px; }
.journey { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.stage { position: relative; padding: 0 0 28px 28px; border-left: 2px solid var(--line); margin-left: 8px; }
.stage::before { content: ""; position: absolute; left: -8px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.stage:last-child { border-left-color: transparent; }
.stage-label { margin: 0 0 12px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stage-note { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.cards + .cards { margin-top: 14px; }
.card a { display: flex; gap: 16px; height: 100%; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.card a:hover { border-color: var(--accent); transform: translateY(-1px); }
.card-step { font: 650 28px/1 var(--serif); color: var(--accent); min-width: 1.4em; }
.card-body { display: flex; flex-direction: column; gap: 6px; }
.card-title { font-weight: 600; font-size: 17px; }
.card-text { color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.card-where { align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.card-where.out { background: var(--opt-soft); color: var(--opt); }
.card-where.in { background: var(--accent-soft); color: var(--accent-strong); }
.steps { padding-left: 1.3em; max-width: 75ch; }
.steps li { margin: 10px 0; color: var(--ink-2); }
.steps strong { color: var(--ink); }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 28px; }
.note ul { margin: 12px 0 0; padding-left: 1.2em; }
.note li { margin: 8px 0; max-width: 80ch; }

/* footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 24px 40px; color: var(--muted); font-size: 14px; }
.site-footer p { max-width: 1080px; margin: 0 auto 8px; }

/* responsive */
@media (max-width: 1499px) {
  .layout { grid-template-columns: 230px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 20px 16px 40px; gap: 16px; }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .nav-full { display: none; }
  .nav-toggle { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
  .nav-toggle summary { cursor: pointer; font-weight: 600; }
  .nav-toggle[open] summary { margin-bottom: 12px; }
  .doc { padding: 24px 18px 28px; border-radius: 12px; }
  .doc h2 { font-size: 22px; }
  .bar { padding: 10px 16px; }
  .tag { display: none; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  td:first-child { white-space: normal; }
}

/* print */
@media print {
  :root { --bg: #fff; --surface: #fff; --line: #ccc; }
  .site-header, .sidebar, .toc, .pager, .page-actions, .skip { display: none !important; }
  .layout { display: block; padding: 0; max-width: none; }
  .doc { border: 0; box-shadow: none; padding: 0; }
  .table-wrap { overflow: visible; border: 0; }
  th { position: static; }
  a { color: inherit; }
  tr, pre, blockquote { break-inside: avoid; }
}

/* checklist tables: keep columns readable on desktop, stack as cards on phones */
table.checklist { min-width: 760px; }
table.checklist td:nth-child(2) { min-width: 180px; }
@media (max-width: 860px) {
  .table-wrap { border: 0; background: none; overflow: visible; }
  table, table.checklist { min-width: 0; display: block; }
  thead { display: none; }
  tbody { display: grid; gap: 12px; }
  tr { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 0; }
  td { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 10px; border: 0; padding: 6px 14px; white-space: normal; }
  td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 2px; }
  td[data-label=""]::before { content: none; }
  td[data-label=""] { display: block; }
  td:first-child { font-weight: 600; color: var(--accent-strong); }
}
@media print { table, table.checklist { min-width: 0; } }

/* long links and references never push the page wider than the screen */
main { min-width: 0; }
.doc { overflow-wrap: break-word; }
.doc a { overflow-wrap: anywhere; }
.cell { min-width: 0; }
