/* Passport Fund design system (v4)
   Direction: the South African passport. Passport green for brand and action, security-paper
   off-white, crest gold reserved for progress, and visa-stamp inks that encode entry status.
   Type: Newsreader (display, editorial) + Public Sans (interface, tabular figures).
   Fonts are self-hosted (SIL Open Font License): no third-party font requests. */

@font-face { font-family: "Newsreader"; src: url("../fonts/newsreader-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../fonts/public-sans-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  --display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --ui: "Public Sans", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;

  /* palette */
  --passport: #0F3B2E;      /* brand + primary action */
  --passport-2: #1B5440;    /* hover/pressed */
  --on-passport: #FFFFFF;
  --paper: #F2F4F1;         /* page */
  --card: #FFFFFF;
  --sunk: #E8ECE8;          /* inputs, chips, tracks */
  --ink: #14211C;           /* headings */
  --text: #34443D;          /* body */
  --mut: #5F6F67;           /* secondary (≥4.5:1 on paper) */
  --line: #D6DDD8;
  --gold: #9C7414;          /* progress fill (graphic, ≥3:1 on --sunk) */
  --gold-ink: #7A5A08;      /* gold text on light */
  --gold-soft: #F4EBCF;
  --stamp-free: #1C7348;    /* visa-free */
  --stamp-easy: #2D4C9E;    /* visa on arrival / online before you go */
  --stamp-req: #A8302A;     /* embassy visa */
  --warn: #9A3F14; --warn-soft: #FBE9DF;
  --ok: #1C7348; --ok-soft: #E1F1E7;
  --focus: #0F3B2E;
  --link: #0F5A40;
  --scrim: rgba(10, 22, 17, .55);
  --shadow: 0 1px 2px rgba(15, 59, 46, .06), 0 8px 24px -12px rgba(15, 59, 46, .18);
  --radius: 12px; --radius-sm: 8px; --radius-lg: 18px;

  /* type scale: ~1.25 ratio */
  --t-xs: 12.5px; --t-sm: 14px; --t-md: 16px; --t-lg: 19px; --t-xl: 24px; --t-2xl: 30px; --t-3xl: 38px; --t-4xl: 48px;
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --passport: #236B4C; --passport-2: #2A7A57; --on-passport: #FFFFFF; --focus: #7FD0A8; --link: #8FDAB5;
    --paper: #0C1411; --card: #141F1A; --sunk: #1C2A24; --ink: #EBF2ED; --text: #C5D1CA; --mut: #93A39A; --line: #26362F;
    --gold: #D4AE47; --gold-ink: #E2C46E; --gold-soft: #2E2814;
    --stamp-free: #5CC38E; --stamp-easy: #8FA8F0; --stamp-req: #F08A80;
    --warn: #F0A27A; --warn-soft: #3A2116; --ok: #5CC38E; --ok-soft: #12301F;
    --scrim: rgba(0, 0, 0, .66); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --passport: #236B4C; --passport-2: #2A7A57; --on-passport: #FFFFFF; --focus: #7FD0A8; --link: #8FDAB5;
  --paper: #0C1411; --card: #141F1A; --sunk: #1C2A24; --ink: #EBF2ED; --text: #C5D1CA; --mut: #93A39A; --line: #26362F;
  --gold: #D4AE47; --gold-ink: #E2C46E; --gold-soft: #2E2814;
  --stamp-free: #5CC38E; --stamp-easy: #8FA8F0; --stamp-req: #F08A80;
  --warn: #F0A27A; --warn-soft: #3A2116; --ok: #5CC38E; --ok-soft: #12301F;
  --scrim: rgba(0, 0, 0, .66); --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -14px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 var(--t-md)/1.55 var(--ui); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -.01em; line-height: 1.12; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--link); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--passport); color: var(--on-passport); padding: 10px 14px; border-radius: var(--radius-sm); font-weight: 600; }
.skip:focus { top: 12px; }
.mut { color: var(--mut); }
.small { font-size: var(--t-sm); line-height: 1.5; }
.xs { font-size: var(--t-xs); line-height: 1.45; }

/* ---------- app shell ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.main { padding: 0 16px calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom, 0px)); max-width: 1160px; margin: 0 auto; }
.rail { display: none; }
.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar ul { list-style: none; margin: 0 auto; padding: 0 8px; display: grid; grid-template-columns: repeat(4, 1fr); max-width: 560px; }
.tab { width: 100%; min-height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--mut); font-size: var(--t-xs); font-weight: 600; text-decoration: none; }
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--passport); }
:root[data-theme="dark"] .tab[aria-current="page"] { color: var(--ink); }
.tab .dot { width: 4px; height: 4px; border-radius: 2px; background: transparent; }
.tab[aria-current="page"] .dot { background: currentColor; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 10px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 600; font-size: var(--t-lg); letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.page-title { font-size: var(--t-2xl); margin: 8px 0 4px; }
.page-lede { color: var(--text); max-width: 60ch; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 248px 1fr; }
  .rail { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line); background: var(--card); }
  .rail .brand { padding: 4px 10px 18px; }
  .rail a.navlink { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 600; }
  .rail a.navlink svg { width: 22px; height: 22px; }
  .rail a.navlink:hover { background: var(--sunk); }
  .rail a.navlink[aria-current="page"] { background: var(--passport); color: var(--on-passport); }
  .rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 10px; }
  .rail-foot a { color: var(--mut); font-size: var(--t-xs); display: inline-block; padding-block: 4px; }
  .tabbar { display: none; }
  .main { padding: 0 40px 64px; width: 100%; max-width: 1240px; margin: 0; }
  .topbar.mobile-only { display: none; }
  .page-title { font-size: var(--t-3xl); margin-top: 28px; }
}

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 650; font-size: 15.5px; text-decoration: none; transition: background-color .15s ease, transform .1s ease; white-space: nowrap; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--passport); color: var(--on-passport); }
.btn-primary:hover:not(:disabled) { background: var(--passport-2); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover:not(:disabled) { background: var(--sunk); }
.btn-quiet { background: var(--sunk); color: var(--ink); }
.btn-danger { background: transparent; color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.btn-danger.armed { background: var(--warn); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: var(--t-sm); }
.link-btn { background: none; border: 0; padding: 8px 0; min-height: 40px; color: var(--link); font-weight: 650; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: inline-grid; place-items: center; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.field-label { display: block; font-weight: 650; font-size: var(--t-sm); color: var(--ink); margin-bottom: 6px; }
.field-hint { font-size: var(--t-xs); color: var(--mut); margin-top: 6px; }
.input, .select { width: 100%; min-height: 48px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--card); color: var(--ink); padding: 0 14px; font-size: 16px; }
.input:focus, .select:focus { outline: none; border-color: var(--passport); box-shadow: 0 0 0 3px color-mix(in srgb, var(--passport) 22%, transparent); }
.input[aria-invalid="true"] { border-color: var(--warn); }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mut) 50%), linear-gradient(135deg, var(--mut) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.money-input { display: flex; align-items: center; gap: 4px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); background: var(--card); padding: 0 14px; }
.money-input:focus-within { border-color: var(--passport); box-shadow: 0 0 0 3px color-mix(in srgb, var(--passport) 22%, transparent); }
.money-input span { font-weight: 650; color: var(--mut); }
.money-input input { flex: 1; min-width: 0; border: 0; background: transparent; min-height: 48px; outline: none; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.money-input.big input { font-size: 30px; min-height: 64px; }
.money-input.big span { font-size: 24px; }
.error { color: var(--warn); font-weight: 600; font-size: var(--t-sm); margin-top: 6px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: var(--t-sm); line-height: 1.5; color: var(--ink); cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--passport); flex: none; }

/* segmented control + chips */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; padding: 3px; border-radius: 999px; background: var(--sunk); }
.seg button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; min-height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--text); font-weight: 650; font-size: var(--t-sm); padding: 0 10px; }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; scroll-padding: 16px; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 960px) { .chips { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; } }
.chip { flex: none; min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); color: var(--text); font-weight: 600; font-size: var(--t-sm); white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--card); }

/* stepper */
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); }
.stepper button { width: 44px; height: 44px; border: 0; background: none; color: var(--ink); font-size: 22px; line-height: 1; border-radius: 999px; }
.stepper output { min-width: 84px; text-align: center; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- surfaces ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card + .card { margin-top: 16px; }
.dest-main .card, .settings .card, .prose .card, .trips-aside .card { box-shadow: none; border: 1px solid var(--line); }
.section { margin-top: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: var(--t-xl); }
.section-head p { color: var(--mut); font-size: var(--t-sm); }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--sunk); border-left: 3px solid var(--ink); color: var(--ink); font-size: var(--t-sm); line-height: 1.5; }
.notice svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--ink); }
.notice.plain { background: var(--sunk); }
.notice.plain svg { color: var(--mut); }
.notice a { font-weight: 600; }
.empty { text-align: center; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty h2 { font-size: var(--t-xl); }
.empty p { max-width: 44ch; color: var(--text); }

/* ---------- photography ---------- */
.photo { position: relative; overflow: hidden; background: var(--sunk); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-missing { width: 100%; height: 100%; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--mut); font-size: var(--t-sm); background: repeating-linear-gradient(135deg, var(--sunk) 0 12px, var(--paper) 12px 24px); }

/* ---------- the signature: visa stamp ---------- */
.stamp { --ink-c: var(--stamp-req); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; padding: 5px 10px 6px; border: 2px solid var(--ink-c); outline: 1px solid var(--ink-c); outline-offset: 2px; border-radius: 6px; color: var(--ink-c); background: color-mix(in srgb, var(--card) 90%, transparent); transform: rotate(-4deg); line-height: 1.05; text-align: center; white-space: nowrap; }
.stamp b { font: 700 11.5px/1.1 var(--ui); letter-spacing: .09em; text-transform: uppercase; }
.stamp span { font: 600 11px/1.2 var(--ui); letter-spacing: .02em; opacity: .9; }
.stamp.free { --ink-c: var(--stamp-free); }
.stamp.easy { --ink-c: var(--stamp-easy); }
.stamp.req { --ink-c: var(--stamp-req); }
.stamp.flat { transform: none; }
.on-photo .stamp { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,.92); }
:root[data-theme="dark"] .on-photo .stamp { background: rgba(20,31,26,.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .on-photo .stamp { background: rgba(20,31,26,.9); } }
.visa-pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 650; color: var(--ink-c, var(--ink)); }
.visa-pill::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.visa-pill.free { color: var(--stamp-free); } .visa-pill.easy { color: var(--stamp-easy); } .visa-pill.req { color: var(--stamp-req); }
.reconfirm { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 650; color: var(--ink); background: var(--sunk); border: 1px solid var(--line); padding: 3px 10px; border-radius: 999px; }

/* ---------- discover ---------- */
.hero { position: relative; margin: 0 -16px; min-height: 64vh; min-height: 64svh; display: flex; align-items: flex-end; color: #fff; isolation: isolate; overflow: hidden; }
.hero .photo { position: absolute; inset: 0; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(6,18,13,.35) 0%, rgba(6,18,13,0) 30%, rgba(6,18,13,.15) 55%, rgba(6,18,13,.82) 100%); }
.hero-in { padding: 24px 20px 28px; width: 100%; max-width: 720px; }
.hero-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 0; display: flex; justify-content: space-between; align-items: center; }
.hero-top .brand { color: #fff; }
.hero h1 { color: #fff; font-size: clamp(36px, 9vw, 64px); font-weight: 600; line-height: 1.02; letter-spacing: -.02em; margin-bottom: 14px; }
.hero p { color: rgba(255,255,255,.92); font-size: var(--t-lg); line-height: 1.45; max-width: 46ch; margin-bottom: 22px; }
.hero .btn-primary { background: #fff; color: var(--passport); }
.hero .btn-primary:hover { background: #EAF2EC; }
.hero .btn-secondary { color: #fff; border-color: rgba(255,255,255,.55); }
.hero .btn-secondary:hover { background: rgba(255,255,255,.12); }
.hero-credit { position: absolute; right: 12px; bottom: 8px; font-size: 11px; color: rgba(255,255,255,.75); }
.hero-credit a { color: inherit; }
.hero-anim .hero-in > * { animation: rise .35s cubic-bezier(.2,.8,.2,1) both; }
.hero-anim .hero-in > *:nth-child(2) { animation-delay: .08s; }
.hero-anim .hero-in > *:nth-child(3) { animation-delay: .16s; }
.hero-top .brand-mark rect { fill: #fff; }
.hero-top .brand-mark path, .hero-top .brand-mark circle { stroke: var(--passport); }
.hero-postcard { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.hero-postcard .stamp { background: rgba(255,255,255,.92); }
.hero-postcard p { margin: 0; font-size: var(--t-sm); color: rgba(255,255,255,.95); font-weight: 600; }
.hero-postcard a { color: #fff; }
@media (min-width: 960px) {
  .hero { margin: 0 -40px; min-height: 620px; }
  .hero-in { padding: 48px 56px 56px; }
  .hero-top { display: none; }
}
.howit { display: grid; gap: 12px; margin-top: 24px; }
.howit li { list-style: none; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.howit ol { margin: 0; padding: 0; display: grid; gap: 14px; }
.step-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--passport); color: var(--passport); font-weight: 700; font-size: var(--t-sm); }
.howit b { color: var(--ink); display: block; }
@media (min-width: 760px) { .howit ol { grid-template-columns: repeat(3, 1fr); gap: 20px; } }

.finder { display: grid; gap: 16px; }
.finder-row { display: grid; gap: 8px; }
.budget-out { font-family: var(--display); font-size: var(--t-2xl); color: var(--ink); font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--passport); height: 36px; margin: 0; }
.searchbox { display: flex; align-items: center; gap: 10px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); padding: 0 16px; color: var(--mut); }
.searchbox:focus-within { border-color: var(--passport); box-shadow: 0 0 0 3px color-mix(in srgb, var(--passport) 22%, transparent); }
.searchbox svg { width: 20px; height: 20px; flex: none; }
.searchbox input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; min-height: 48px; color: var(--ink); font-size: 16px; }
@media (min-width: 960px) { .finder { grid-template-columns: 1.2fr 1fr; align-items: end; column-gap: 32px; } .finder .span2 { grid-column: 1 / -1; } }
.results-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 22px 0 12px; color: var(--mut); font-size: var(--t-sm); }

/* destination cards */
.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.dcard { display: flex; flex-direction: column; text-align: left; color: inherit; text-decoration: none; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.dcard .photo { aspect-ratio: 16 / 10; }
@media (min-width: 620px) { .dcard .photo { aspect-ratio: 4 / 3; } }
.dcard-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.dcard-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.dcard h3 { font-size: var(--t-xl); }
.dcard .country { color: var(--mut); font-size: var(--t-sm); font-weight: 500; }
.dcard .price { margin-top: 6px; color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.dcard .price small { color: var(--mut); font-weight: 500; font-size: var(--t-sm); }
.fit { font-size: var(--t-xs); font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.fit.yes { background: var(--ok-soft); color: var(--ok); }
.fit.no { background: var(--sunk); color: var(--mut); }
.in-plan { position: absolute; right: 12px; top: 12px; background: var(--passport); color: var(--on-passport); font-weight: 700; font-size: var(--t-xs); padding: 4px 10px; border-radius: 999px; }

/* next-trip strip on discover */
.nextstrip { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); text-decoration: none; color: inherit; margin-top: 16px; }
.nextstrip .photo { width: 96px; height: 96px; border-radius: var(--radius-sm); }
.nextstrip b { color: var(--ink); font-family: var(--display); font-size: var(--t-lg); font-weight: 600; }

/* ---------- destination page ---------- */
.dest-top { display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top, 0px)) 0 10px; gap: 12px; }
.gallery { display: grid; gap: 6px; margin: 0 -16px; grid-template-columns: 1fr; }
.gallery .photo { aspect-ratio: 4 / 3; }
.gallery .extra { display: none; }
.gallery-scroll { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; }
.gallery-scroll::-webkit-scrollbar { display: none; }
.gallery-scroll .photo { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 4 / 3; }
.gallery-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.gallery-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); }
.gallery-dots i.on { background: var(--ink); width: 16px; }
@media (min-width: 760px) {
  .gallery-scroll { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; margin: 0; height: 380px; overflow: visible; }
  .gallery-scroll .photo { aspect-ratio: auto; border-radius: var(--radius-sm); }
  .gallery-scroll .photo:first-child { grid-row: 1 / 3; border-radius: var(--radius) var(--radius-sm) var(--radius-sm) var(--radius); }
  .gallery-dots { display: none; }
}
.dest-head { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.dest-head h1 { font-size: clamp(34px, 7vw, 52px); letter-spacing: -.02em; }
.dest-head .where { color: var(--mut); font-weight: 600; }
.dest-head .lede { font-size: var(--t-lg); line-height: 1.5; color: var(--ink); max-width: 62ch; font-family: var(--display); }
/* Mobile order: title, then the estimate and main action, then the details. */
.dest-layout { display: flex; flex-direction: column; margin-top: 8px; }
@media (max-width: 1039px) {
  .dest-main { display: contents; }
  .dest-main .dest-head { order: -2; margin-top: 18px; }
  .dest-aside { order: -1; margin-top: 20px; }
  .dest-main .facts { margin-top: 24px; }
}
@media (min-width: 1040px) { .dest-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-items: start; margin-top: 20px; } .dest-aside { order: 0; position: sticky; top: 20px; } .dest-main .dest-head { margin-top: 0; } }
.dest-main .facts { margin-top: 24px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; margin: 0; }
.facts div { background: var(--card); padding: 12px 14px; }
.facts dt { font-size: var(--t-xs); color: var(--mut); font-weight: 600; }
.facts dd { margin: 2px 0 0; color: var(--ink); font-weight: 600; font-size: var(--t-sm); }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(4, 1fr); } }

/* estimate card */
.estimate h2 { font-size: var(--t-xl); margin-bottom: 4px; }
.est-controls { display: grid; gap: 14px; margin: 16px 0; }
.est-controls .ctl { display: grid; gap: 6px; }
.est-range .to { font-size: .6em; color: var(--mut); font-weight: 500; }
.est-range { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 4vw, 34px); color: var(--ink); letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; }
.est-sub { color: var(--mut); font-size: var(--t-sm); margin-top: 4px; }
.target-row { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 12px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 16px 0 12px; }
.target-row .field-label { margin: 0; }
.target-row .xs { grid-column: 1 / -1; }
.target-row b { font-size: var(--t-xl); color: var(--ink); font-variant-numeric: tabular-nums; }
.breakdown { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.breakdown th, .breakdown td { padding: 9px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.breakdown td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.breakdown th { font-weight: 500; color: var(--text); padding-right: 12px; }
.breakdown th small { display: block; color: var(--mut); font-size: var(--t-xs); margin-top: 1px; }
.breakdown tr.total th, .breakdown tr.total td { border-bottom: 0; font-weight: 700; color: var(--ink); }
.kind { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 999px; margin-right: 4px; line-height: 17px; }
.kind.estimate { background: var(--sunk); color: var(--text); }
.kind.fee { background: var(--ok-soft); color: var(--ok); }
.kind.assumption { background: var(--gold-soft); color: var(--gold-ink); }
details.more { margin-top: 12px; }
details.more summary { cursor: pointer; font-weight: 650; color: var(--link); min-height: 40px; display: flex; align-items: center; }

.prose { max-width: 66ch; }
.prose p + p { margin-top: 10px; }
.itin { list-style: none; margin: 0; padding: 0; }
.itin li { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.itin li:last-child { border-bottom: 0; }
.itin .d { font-weight: 700; color: var(--ink); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.itin .k-niche .t::after { content: "Local favourite"; display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--stamp-free); }
.itin .k-flex .t, .itin .k-travel .t { color: var(--mut); }
.gems { display: grid; gap: 12px; }
@media (min-width: 760px) { .gems { grid-template-columns: 1fr 1fr; } }
.gem { padding: 16px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--card); }
.gem h3 { font-size: var(--t-lg); margin-bottom: 4px; }
.gem .cost { margin-top: 8px; font-size: var(--t-sm); font-weight: 650; color: var(--ink); }
.kv { margin: 0; }
.kv div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--mut); font-size: var(--t-sm); font-weight: 600; }
.kv dd { margin: 0; color: var(--ink); font-size: var(--t-sm); }
.links { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: var(--t-sm); }
.links a { font-weight: 600; }
.credit-line { font-size: var(--t-xs); color: var(--mut); margin-top: 8px; }
.credit-line a { color: inherit; }

/* ---------- trips (savings) ---------- */
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.summary div { background: var(--card); padding: 16px; }
.summary .k { font-size: var(--t-xs); font-weight: 650; color: var(--mut); }
.summary .v { font-family: var(--display); font-size: var(--t-2xl); font-weight: 600; color: var(--ink); font-variant-numeric: lining-nums tabular-nums; line-height: 1.1; margin-top: 2px; }
.summary .v small { font-family: var(--ui); font-size: var(--t-sm); color: var(--mut); font-weight: 500; }
.goal { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.goal + .goal { margin-top: 14px; }
.goal-main { display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 12px; width: 100%; border: 0; background: none; text-align: left; color: inherit; align-items: center; }
.goal-main .photo { width: 88px; height: 88px; border-radius: var(--radius-sm); }
.goal-main h3 { font-size: var(--t-lg); }
.goal-meta { font-size: var(--t-sm); color: var(--mut); }
.goal-line { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: var(--t-sm); margin-top: 6px; color: var(--text); font-variant-numeric: tabular-nums; }
.goal-line b { color: var(--ink); }
.goal-line span { white-space: nowrap; }
.bar { height: 8px; border-radius: 99px; background: var(--sunk); overflow: hidden; margin-top: 8px; }
.bar { box-shadow: inset 0 0 0 1px var(--line); }
.bar i { display: block; height: 100%; width: 100%; border-radius: 99px; background: var(--gold); transform-origin: left center; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.goal-panel { padding: 4px 16px 18px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.pace { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: var(--t-sm); }
.pace::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; flex: none; }
.pace.ok { color: var(--ok); } .pace.behind { color: var(--warn); } .pace.neutral { color: var(--mut); }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ledger li:last-child { border-bottom: 0; }
.ledger .amt { font-weight: 700; color: var(--ok); min-width: 92px; font-variant-numeric: tabular-nums; }
.ledger .meta { flex: 1; min-width: 0; font-size: var(--t-sm); color: var(--ink); }
.ledger .meta small { display: block; color: var(--mut); }
.ledger .icon-btn { border: 0; background: transparent; color: var(--mut); }
@media (min-width: 960px) { .trips-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; } .trips-aside { position: sticky; top: 20px; } }

/* ---------- visas ---------- */
.vlist { list-style: none; margin: 0; padding: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.vlist li + li { border-top: 1px solid var(--line); }
.vrow { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 14px 16px; text-decoration: none; color: inherit; }
.vrow b { color: var(--ink); font-weight: 650; }
.vrow .sub { grid-column: 1 / -1; font-size: var(--t-sm); color: var(--mut); }
.vrow .fee { font-weight: 650; color: var(--ink); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }

/* ---------- settings ---------- */
.settings { display: grid; gap: 16px; }
@media (min-width: 960px) { .settings { grid-template-columns: 1fr 1fr; align-items: start; } }
.setting + .setting { margin-top: 18px; }
.list-links { list-style: none; margin: 0; padding: 0; }
.list-links li + li { border-top: 1px solid var(--line); }
.list-links a { display: flex; justify-content: space-between; align-items: center; min-height: 52px; color: var(--ink); text-decoration: none; font-weight: 600; }
.list-links svg { width: 18px; height: 18px; color: var(--mut); }

/* ---------- sheets, toasts ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); animation: fade .2s ease both; }
.sheet { position: relative; width: 100%; max-width: 560px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; background: var(--card); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; animation: up .32s cubic-bezier(.2,.8,.2,1) both; }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 2px auto 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet-head h2 { font-size: var(--t-xl); }
@media (min-width: 760px) { .sheet-wrap { align-items: center; } .sheet { border-radius: var(--radius-lg); padding-bottom: 24px; } .sheet-grip { display: none; } }
.welcome .sheet { gap: 14px; }
.welcome ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: var(--t-sm); }
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: calc(100% - 32px); max-width: 460px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 16px; border-radius: var(--radius); background: var(--ink); color: var(--card); font-weight: 600; font-size: var(--t-sm); box-shadow: var(--shadow); animation: toast .25s ease both; }
.toast button { border: 0; background: var(--paper); color: var(--ink); font-weight: 700; border-radius: 999px; padding: 8px 14px; min-height: 36px; }
@media (min-width: 960px) { .toast { bottom: 24px; left: calc(50% + 124px); } }

/* ---------- footer ---------- */
.foot { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--mut); display: grid; gap: 10px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--mut); font-weight: 600; display: inline-block; padding-block: 6px; }

/* boot + crash */
.boot { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.boot p { color: var(--mut); font-weight: 600; max-width: 34ch; }
.boot .err { color: var(--warn); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(32px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes toast { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes settle { from { transform: scale(1.06); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.card-title { font-size: var(--t-xl); margin-bottom: 12px; }
.gallery-wrap { position: relative; }
.gallery-wrap > .stamp { position: absolute; z-index: 2; top: 14px; left: 14px; background: rgba(255,255,255,.92); }
:root[data-theme="dark"] .gallery-wrap > .stamp { background: rgba(20,31,26,.92); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gallery-wrap > .stamp { background: rgba(20,31,26,.92); } }
.goal-name { display: block; font-family: var(--display); font-weight: 600; font-size: var(--t-lg); color: var(--ink); line-height: 1.15; }
@media (max-width: 380px) { .seg button { font-size: var(--t-xs); padding: 0 4px; } .chip { padding: 0 12px; } }
