/* AbroadCost — deep forest, parchment, brass. Country budget planner. */

@font-face {
  font-family: Syne;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/syne-500.woff2") format("woff2");
}
@font-face {
  font-family: Syne;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/syne-600.woff2") format("woff2");
}
@font-face {
  font-family: Syne;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/syne-700.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("fonts/dm-sans-300.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/dm-sans-400.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/dm-sans-500.woff2") format("woff2");
}

:root,
html[data-theme="light"] {
  --bg: #f3e7d3;
  --bg-deep: #e6d5b8;
  --surface: #faf4e8;
  --ink: #0b3d2e;
  --muted: #3d5c4f;
  --line: #d4c4a8;
  --line-strong: #c9a27a;
  --accent: #0b3d2e;
  --accent-ink: #f3e7d3;
  --sand: #c9a27a;
  --sand-deep: #a67c52;
  --mint: #1f6b4a;
  --field: #fffaf2;
  --soft: #ebe0cc;
  --accent-soft: #d8e8df;
  --danger: #9b2c3a;
  --focus: #0b3d2e;
  --shadow: 0 28px 60px -36px rgba(11, 61, 46, 0.42);
  --drop: 0 18px 40px -24px rgba(11, 61, 46, 0.5);
  --c1: #0b3d2e;
  --c2: #1f6b4a;
  --c3: #c9a27a;
  --c4: #3d5c4f;
  --c5: #7c4a52;
  --c6: #5a7a68;
  --c7: #b08968;
  --bar-hi: #0b3d2e;
  --bar-muted: #a89478;
  --track: #e0d2b8;
  --hover: #ebe0cc;
  --globe-hi: #3d9a6e;
  --globe-mid: #0b3d2e;
  --globe-lo: #062820;
  --display: Syne, "Avenir Next Condensed", "Segoe UI", sans-serif;
  --sans: "DM Sans", "Avenir Next", "Segoe UI", sans-serif;
  --color-scheme: light;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #061f18;
  --bg-deep: #041410;
  --surface: #0a2a20;
  --ink: #f3e7d3;
  --muted: #c9b89a;
  --line: #1e4034;
  --line-strong: #3a5c4c;
  --accent: #c9a27a;
  --accent-ink: #0b3d2e;
  --sand: #c9a27a;
  --sand-deep: #e8d4b4;
  --mint: #4aad7a;
  --field: #082018;
  --soft: #0f3026;
  --accent-soft: #163628;
  --danger: #f0b4b8;
  --focus: #c9a27a;
  --shadow: 0 30px 70px -32px rgba(0, 0, 0, 0.75);
  --drop: 0 22px 44px -20px rgba(0, 0, 0, 0.8);
  --c1: #c9a27a;
  --c2: #4aad7a;
  --c3: #e8d4b4;
  --c4: #8fb9a4;
  --c5: #c4a090;
  --c6: #a9c4b4;
  --c7: #6ea58c;
  --bar-hi: #c9a27a;
  --bar-muted: #4a6460;
  --track: #163028;
  --hover: #123028;
  --globe-hi: #5ec49a;
  --globe-mid: #1a5c42;
  --globe-lo: #061f18;
  --color-scheme: dark;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  font-size: 100%;
  background: var(--bg);
  color-scheme: var(--color-scheme);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1rem, 0.96rem + 0.18vw, 1.1rem);
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--mint) 18%, transparent), transparent 65%),
    radial-gradient(700px 380px at 10% 20%, color-mix(in srgb, var(--sand) 22%, transparent), transparent 60%),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-deep) 100%);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 12%, transparent) 1px, transparent 0);
  background-size: 22px 22px;
}

html[data-theme="dark"] body::before { opacity: 0.18; }

::selection {
  background: color-mix(in srgb, var(--sand) 55%, white);
  color: #0b3d2e;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.65rem 1rem;
  text-decoration: none;
  border-radius: 0.35rem;
  font-weight: 500;
}
.skip:focus { top: 0.75rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Top bar —— */
.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(72rem, calc(100% - clamp(1.25rem, 4vw, 4rem)));
  margin-inline: auto;
  padding: max(0.85rem, env(safe-area-inset-top)) 0 0.5rem;
}

.topbar-brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.fx-pill {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  max-width: 12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-switch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 0.45rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
}

.theme-switch button {
  min-width: 3.6rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.7rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.theme-switch button + button { border-left: 1px solid var(--line); }
.theme-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

/* —— Hero (full-bleed plane) —— */
.hero {
  --arn-accent: var(--accent);
  --arn-accent-2: var(--sand);
  position: relative;
  z-index: 1;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  min-height: 100svh;
  min-height: 100dvh;
  width: 100%;
  margin: 0;
  padding:
    clamp(1.5rem, 4vw, 3rem)
    max(clamp(1.25rem, 4vw, 4rem), env(safe-area-inset-right))
    clamp(2.5rem, 6vw, 4.5rem)
    max(clamp(1.25rem, 4vw, 4rem), env(safe-area-inset-left));
  overflow: hidden;
}
.hero > * {
  width: min(72rem, 100%);
  margin-inline: auto;
}
.hero-copy,
.hero-visual {
  width: 100%;
  max-width: min(36rem, 100%);
  justify-self: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 80% at 88% 8%, color-mix(in srgb, var(--mint) 28%, transparent), transparent 55%),
    radial-gradient(90% 70% at 8% 92%, color-mix(in srgb, var(--sand) 18%, transparent), transparent 50%),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-deep) 100%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.22;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.5rem;
    padding-inline: max(clamp(2rem, 6vw, 5rem), env(safe-area-inset-left))
      max(clamp(2rem, 6vw, 5rem), env(safe-area-inset-right));
  }
  .hero > * { width: 100%; max-width: none; }
  .hero-copy { justify-self: start; max-width: 34rem; }
  .hero-visual { justify-self: end; max-width: 28rem; }
}

.hero-copy { max-width: 34rem; }

.brand-mark {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 1.6rem + 3.2vw, 4.5rem);
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: var(--ink);
}

.hero h1 {
  margin: 0;
  max-width: 16ch;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.55rem, 1.15rem + 1.5vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--muted);
  text-wrap: balance;
}

.hero-support {
  margin: 1.15rem 0 0;
  max-width: 34rem;
  font-weight: 300;
  font-size: clamp(1.02rem, 0.95rem + 0.3vw, 1.2rem);
  line-height: 1.55;
  color: var(--muted);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.7rem 1.35rem;
  border-radius: 0.45rem;
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.22s ease, background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(16rem, 42vw, 26rem);
}

.globe-orb {
  position: relative;
  width: min(100%, 26rem);
  aspect-ratio: 1;
  animation: orb-float 7s ease-in-out infinite;
}

.globe-svg {
  width: 100%;
  height: 100%;
  color: color-mix(in srgb, var(--ink) 35%, var(--mint));
  filter: drop-shadow(0 24px 48px color-mix(in srgb, var(--accent) 35%, transparent));
}

.globe-grid {
  transform-origin: 210px 210px;
  animation: grid-drift 48s linear infinite;
}

.globe-disk {
  animation: disk-breathe 6s ease-in-out infinite;
  transform-origin: 210px 210px;
}

.globe-glow {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--mint) 40%, transparent), transparent 70%);
  z-index: -1;
  animation: glow-pulse 5.5s ease-in-out infinite;
}

.globe-orbit {
  transform-origin: 210px 210px;
  animation: orbit-spin 22s linear infinite;
  stroke-dasharray: 8 10;
}

.globe-dots circle {
  animation: dot-breathe 4s ease-in-out infinite;
}
.globe-dots circle:nth-child(odd) { animation-delay: -1.2s; }
.globe-dots circle:nth-child(3n) { animation-delay: -2.4s; }
.globe-dots circle:nth-child(4n) { animation-delay: -0.6s; }

.hero-copy .brand-mark {
  animation: rise-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.hero-copy h1 {
  animation: rise-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}
.hero-copy .hero-support {
  animation: rise-in 0.95s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}
.hero-copy .hero-cta {
  animation: rise-in 1s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}
.hero-visual {
  animation: rise-in 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.btn-primary:hover {
  box-shadow: 0 12px 28px -14px color-mix(in srgb, var(--accent) 70%, transparent);
}
.tabs button:hover:not(.on) {
  background: var(--hover);
  color: var(--ink);
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.08); }
}
@keyframes orbit-spin {
  to { transform: rotate(360deg); }
}
@keyframes grid-drift {
  to { transform: rotate(-360deg); }
}
@keyframes disk-breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.018); }
}
@keyframes orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes dot-breathe {
  0%, 100% { opacity: 0.45; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .globe-glow, .globe-orbit, .globe-dots circle,
  .globe-orb, .globe-grid, .globe-disk,
  .hero-copy .brand-mark, .hero-copy h1,
  .hero-copy .hero-support, .hero-copy .hero-cta,
  .hero-visual { animation: none; }
  .btn:hover { transform: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .big.tick { animation: none; }
  .panel.on { animation: none; }
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* —— App shell / planner —— */
.app-shell {
  position: relative;
  z-index: 1;
  width: min(72rem, calc(100% - clamp(1.25rem, 4vw, 4rem)));
  margin: 0 auto clamp(3rem, 6vw, 5rem);
  scroll-margin-top: 1rem;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0;
  padding: 0.35rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 0.75rem 0.75rem 0 0;
  border-bottom: 0;
  backdrop-filter: blur(12px);
}

.tabs button {
  position: relative;
  min-height: 3.1rem;
  padding: 0.7rem 0.35rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.tabs button.on {
  color: var(--accent-ink);
  background: var(--accent);
}

.tab-short { display: none; }

.panel { display: none; }
.panel.on {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0 0 0.85rem 0.85rem;
  box-shadow: var(--shadow);
  padding: clamp(1.35rem, 2.8vw, 2.5rem);
  animation: panel-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.screen-pane {
  background: color-mix(in srgb, var(--field) 88%, var(--soft));
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: clamp(1rem, 2vw, 1.35rem);
}

.panel-copy { max-width: 44rem; margin-bottom: clamp(1.25rem, 2.5vw, 1.85rem); }
.panel-copy h2 {
  margin: 0 0 0.45rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.55rem, 1.25rem + 0.9vw, 2.1rem);
  letter-spacing: -0.03em;
}
.hint {
  margin: 0;
  color: var(--muted);
  font-weight: 300;
  font-size: 0.98rem;
}

.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.1rem, 2.5vw, 1.75rem);
}
@media (min-width: 860px) {
  .layout {
    grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
    align-items: start;
  }
}

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem 0.75rem;
}
.form .full { grid-column: 1 / -1; }
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.field-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

input[type="text"],
input[type="number"],
input[type="search"],
select {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.45rem;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 0.98rem;
}
input:hover, select:hover { border-color: var(--accent); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%234a6068' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
}
html[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%239bb0b8' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.combo { position: relative; }
.combo-control { position: relative; }
.combo-control input { padding-right: 2.2rem; }
.chevron {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  width: 0.75rem;
  height: 0.5rem;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.combo-list {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 0.25rem);
  max-height: 14rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 0.5rem;
  box-shadow: var(--drop);
}
.combo-list.flip {
  top: auto;
  bottom: calc(100% + 0.25rem);
}
.combo-list li {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.35rem;
  cursor: pointer;
  min-height: 2.75rem;
  justify-content: center;
}
.combo-list li:hover,
.combo-list li.active {
  background: var(--accent-soft);
}
.combo-list li[aria-disabled="true"] {
  cursor: default;
  color: var(--muted);
}
.opt-name { font-weight: 500; }
.opt-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.swap {
  width: 100%;
  min-height: 2.75rem;
  border: 1px dashed var(--line-strong);
  border-radius: 0.45rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.swap:hover {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* —— Results —— */
.figure { margin-bottom: 1rem; }
.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand-deep);
}
.big {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.85rem, 1.4rem + 1.6vw, 2.85rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--ink);
}
.big.is-long { font-size: clamp(1.35rem, 1.1rem + 1vw, 2rem); }
.big.tick { animation: tick 0.45s ease; }
@keyframes tick {
  from { opacity: 0.35; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.big-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.route {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.55rem;
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
}
.route .to {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sand-deep);
}
.route-meta {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.share {
  display: flex;
  height: 0.55rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--track);
  margin: 0.85rem 0 1rem;
}
.share i { display: block; height: 100%; min-width: 2px; }
.share i[data-k="housing"],
.share i[data-k="lodging"],
.share i[data-k="deposit"] { background: var(--c1); }
.share i[data-k="food"] { background: var(--c2); }
.share i[data-k="transport"] { background: var(--c3); }
.share i[data-k="utilities"],
.share i[data-k="local"] { background: var(--c4); }
.share i[data-k="healthcare"],
.share i[data-k="arrival"] { background: var(--c5); }
.share i[data-k="other"],
.share i[data-k="visa"] { background: var(--c6); }
.share i[data-k="papers"],
.share i[data-k="purpose"],
.share i[data-k="flights"],
.share i[data-k="setup"],
.share i[data-k="settling"] { background: var(--c7); }

.rows { display: grid; gap: 0.35rem; }
.row {
  display: grid;
  grid-template-columns: 0.7rem 1fr auto auto;
  gap: 0.55rem 0.65rem;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.row.section {
  grid-template-columns: 1fr;
  margin-top: 0.65rem;
  padding-top: 0.75rem;
  border-bottom: 0;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sand-deep);
}
.row.total {
  border-bottom: 0;
  font-weight: 600;
  padding-top: 0.65rem;
}
.swatch {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: var(--bar-muted);
}
.swatch[data-k="housing"], .swatch[data-k="lodging"], .swatch[data-k="deposit"] { background: var(--c1); }
.swatch[data-k="food"] { background: var(--c2); }
.swatch[data-k="transport"] { background: var(--c3); }
.swatch[data-k="utilities"], .swatch[data-k="local"] { background: var(--c4); }
.swatch[data-k="healthcare"], .swatch[data-k="arrival"] { background: var(--c5); }
.swatch[data-k="other"], .swatch[data-k="visa"] { background: var(--c6); }
.swatch[data-k="papers"], .swatch[data-k="purpose"], .swatch[data-k="flights"],
.swatch[data-k="setup"], .swatch[data-k="settling"] { background: var(--c7); }
.pct { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.5rem; text-align: right; }
.amt { font-variant-numeric: tabular-nums; font-weight: 500; text-align: right; min-width: 6rem; }

.quiet {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}
.compare {
  margin: 0.65rem 0 0;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--sand);
  background: var(--soft);
  border-radius: 0 0.4rem 0.4rem 0;
  font-size: 0.92rem;
}
.compare:empty { display: none; }

.salary-block {
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}
.salary-block h3 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.salary-dl {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}
.salary-dl div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: baseline;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}
.salary-dl dt {
  font-size: 0.85rem;
  color: var(--muted);
}
.salary-dl dd {
  margin: 0;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* —— Economy —— */
.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}
@media (min-width: 720px) {
  .filters { grid-template-columns: 1.4fr 1fr 1fr; }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.35rem;
}
@media (min-width: 720px) {
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stat {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: var(--field);
  min-height: 5.25rem;
}
.stat.feature {
  background: linear-gradient(145deg, var(--accent-soft), var(--field));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.stat.wide { grid-column: span 2; }
.stat span {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
.stat strong {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.35rem);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat small {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}
.stat strong.is-down { color: var(--danger); }

.charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}
@media (min-width: 800px) {
  .charts { grid-template-columns: 1fr 1fr; }
}
.chart-box {
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--field);
}
.chart-box h3 {
  margin: 0 0 0.65rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.chart-box canvas {
  display: block;
  width: 100%;
}
.chart-key {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 0.85rem;
  align-items: center;
}
.chart-key i {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  margin-right: 0.25rem;
  vertical-align: -1px;
}
.chart-key i[data-k="gross"] { background: var(--bar-hi); }
.chart-key i[data-k="net"] { background: var(--bar-muted); }
.chart-note { margin-bottom: 1.15rem; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.9rem;
  list-style: none;
  margin: 0.65rem 0 0;
  padding: 0;
  font-size: 0.78rem;
  color: var(--muted);
}
.legend li { display: flex; align-items: center; gap: 0.35rem; }
.legend i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  flex: 0 0 auto;
}
.legend i[data-k="c1"] { background: var(--c1); }
.legend i[data-k="c2"] { background: var(--c2); }
.legend i[data-k="c3"] { background: var(--c3); }
.legend i[data-k="c4"] { background: var(--c4); }
.legend i[data-k="c5"] { background: var(--c5); }

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.5rem;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}
.data-table caption {
  caption-side: top;
  text-align: left;
  padding: 0 0 0.75rem;
  font-weight: 500;
}
.cap-hint {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.data-table th,
.data-table td {
  padding: 0.65rem 0.55rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.data-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.data-table th button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0.35rem 0;
  min-height: 2.75rem;
}
.data-table th[aria-sort="ascending"] button,
.data-table th[aria-sort="descending"] button { color: var(--ink); }
.data-table tr.on { background: var(--accent-soft); }
.data-table tr:hover { background: var(--hover); }
.row-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 0.35rem 0;
  min-height: 2.75rem;
  text-align: left;
}
.row-btn[aria-current="true"] { color: var(--accent); }
.empty-row td {
  text-align: center;
  color: var(--muted);
  padding: 1.5rem;
}

/* —— Footer —— */
#site-foot {
  position: relative;
  z-index: 1;
  width: min(72rem, calc(100% - clamp(1.25rem, 4vw, 4rem)));
  margin: 0 auto;
  padding: 0 0 max(2.5rem, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.foot-brand {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.method {
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  padding: 0.15rem 0.95rem 0.85rem;
}
.method summary {
  cursor: pointer;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  font-weight: 500;
  color: var(--ink);
}
.method p { margin: 0.65rem 0 0; }
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 1rem 0 0;
}
.foot-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}
.foot-links a:hover { text-decoration: underline; }

.error {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--danger);
  border-radius: 0.45rem;
  color: var(--danger);
  background: var(--surface);
}
.noscript {
  width: min(40rem, calc(100% - 2rem));
  margin: 1rem auto;
  position: relative;
  z-index: 2;
}

@media (max-width: 640px) {
  .tab-long { display: none; }
  .tab-short { display: inline; }
  .form { grid-template-columns: 1fr; }
  .pair { grid-template-columns: 1fr 1fr; }
  .fx-pill { display: none; }
  .brand-mark { font-size: clamp(2.35rem, 12vw, 3.4rem); }
  .stat.wide { grid-column: span 2; }
  .tabs {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 18;
    border-radius: 0;
    margin-inline: calc(-1 * clamp(0.65rem, 3vw, 1rem));
    width: calc(100% + 2 * clamp(0.65rem, 3vw, 1rem));
    box-shadow: 0 10px 28px -18px rgba(11, 28, 34, 0.45);
  }
  .app-shell {
    width: min(100%, calc(100% - clamp(1rem, 4vw, 1.5rem)));
  }
  .panel.on { border-radius: 0 0 0.75rem 0.75rem; }
}

@media (max-width: 380px) {
  .pair { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat.wide { grid-column: span 1; }
}

/* Extra device bands: small phones → tablets → desktops → ultrawide */
.topbar {
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
  padding-top: max(0.35rem, env(safe-area-inset-top));
}
.hero {
  min-height: 100svh;
  min-height: 100dvh;
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}
.btn, button, .tabs button, select, input {
  min-height: 44px;
  touch-action: manipulation;
}
@media (min-width: 481px) and (max-width: 767px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) and (max-width: 1439px) {
  .planner { width: min(960px, calc(100% - 2rem)); }
}
@media (min-width: 1440px) {
  .planner, .hero-copy, .wrap {
    width: min(1100px, calc(100% - 3rem));
  }
}
@media (min-width: 1800px) {
  .planner { width: min(1240px, calc(100% - 4rem)); }
}
