/* ============================================================
   CalcFX — design system
   Deep navy + gold accents, data-dense finance aesthetic.
   Light body, dark hero/footer. Chinese market colors:
   up = red (#D93025), down = green (#1E8E3E).
   ============================================================ */
:root {
  --navy-900: #0A1F3F;
  --navy-800: #0E2A52;
  --navy-700: #123B7A;
  --navy-600: #1B4FA0;
  --gold-500: #C8A24A;
  --gold-400: #D9B869;
  --gold-100: #F4EBD4;
  --ink: #10233C;
  --body: #49596E;
  --muted: #7A8899;
  --line: #E3E9F1;
  --line-strong: #CFD8E3;
  --bg: #F5F7FA;
  --bg-alt: #EEF2F7;
  --card: #FFFFFF;
  --up: #D93025;
  --down: #1E8E3E;
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 35, 60, .05), 0 2px 8px rgba(16, 35, 60, .04);
  --shadow: 0 2px 6px rgba(16, 35, 60, .06), 0 16px 40px rgba(16, 35, 60, .10);
  --shadow-lg: 0 4px 12px rgba(16, 35, 60, .08), 0 24px 64px rgba(16, 35, 60, .14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--card);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 40px; font-weight: 800; }
h2 { font-size: 28px; }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--navy-600); }
img, svg { vertical-align: middle; }
button { font-family: inherit; }
.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.ta-r { text-align: right; }
.center { text-align: center; }
.dim { color: var(--muted); }
.text-danger { color: var(--up) !important; }
.flag { font-size: 1.05em; }
/* third-party flag photos (flagcdn) + coin badges for crypto */
.flag-img {
  display: inline-block; width: 20px; height: 14px; border-radius: 2.5px;
  object-fit: cover; vertical-align: -2px; box-shadow: 0 0 0 1px rgba(16,35,60,.10);
  background: var(--bg-alt);
}
.flag-img.flag-lg { width: 28px; height: 19px; }
.coin-badge {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold-100); color: var(--navy-800); font-size: 10.5px; font-weight: 800;
  vertical-align: -4px; box-shadow: 0 0 0 1px rgba(16,35,60,.08);
}
.select-wrap.has-flag select { padding-left: 38px; }
.select-wrap.has-flag > .flag-img,
.select-wrap.has-flag > .coin-badge {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  pointer-events: none; z-index: 1;
}
.tick-item .flag-img { vertical-align: -1px; }
.code { font-weight: 700; color: var(--ink); letter-spacing: .02em; }
.code-sm { color: var(--muted); font-size: .85em; font-weight: 600; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.22,.68,.36,1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ============ topbar ============ */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; flex: none; border-radius: 9px; box-shadow: 0 4px 12px rgba(18,59,122,.28); }
.brand-name { font-size: 20px; font-weight: 800; color: var(--navy-900); letter-spacing: -.02em; }
.brand-name em { font-style: normal; color: var(--gold-500); }
.nav-main { display: flex; gap: 4px; margin-left: 12px; flex: 1; }
.nav-link {
  padding: 8px 13px; border-radius: 9px; color: var(--body); font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--bg-alt); color: var(--ink); }
.nav-link.is-active { color: var(--navy-700); background: rgba(18,59,122,.08); }
.nav-right { display: flex; align-items: center; gap: 10px; }
/* ---------- language switcher (flag dropdown) ---------- */
.lang-switch { position: relative; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: #fff;
  font-size: 13px; font-weight: 700; color: var(--navy-700); cursor: pointer;
  font-family: inherit; transition: border-color .15s, background .15s;
}
.lang-toggle:hover { border-color: var(--navy-700); background: var(--navy-700); color: #fff; }
.lang-toggle:hover .flag-img { box-shadow: 0 0 0 1px rgba(255,255,255,.5); }
.lang-toggle svg { opacity: .7; }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 168px; z-index: 80;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.lang-switch:hover .lang-menu, .lang-switch:focus-within .lang-menu, .lang-switch.is-open .lang-menu { display: block; }
.lang-opt {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap;
}
.lang-opt:hover { background: var(--bg-alt); color: var(--navy-700); }
.lang-opt.is-active { background: rgba(18,59,122,.07); color: var(--navy-700); }
.lang-opt.is-active::after { content: "✓"; margin-left: auto; font-weight: 800; color: var(--navy-700); }
.foot-bottom .lang-switch { display: inline-block; vertical-align: middle; }
.foot-bottom .lang-toggle { padding: 4px 10px; font-size: 12px; border-color: rgba(255,255,255,.25); background: transparent; color: #C6D4E8; }
.foot-bottom .lang-toggle:hover { background: #fff; color: var(--navy-900); border-color: #fff; }
.foot-bottom .lang-menu { bottom: calc(100% + 8px); top: auto; right: 0; }
.foot-bottom .lang-menu .lang-opt { color: var(--ink); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--navy-900); border-radius: 2px; transition: transform .2s, opacity .2s; }

@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .nav-main {
    position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 16px; display: none;
    box-shadow: var(--shadow);
  }
  .nav-main.is-open { display: flex; }
  .nav-link { padding: 12px 10px; border-radius: 8px; }
}

/* ============ hero ============ */
.hero { position: relative; background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-800) 46%, #0C2549 100%); color: #EAF1FA; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(720px 380px at 85% -10%, rgba(200,162,74,.16), transparent 60%),
    radial-gradient(600px 500px at -10% 110%, rgba(27,79,160,.35), transparent 60%),
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.02fr .98fr; gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 104px; }
.eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-400); margin: 0 0 18px;
  padding: 6px 14px; border: 1px solid rgba(200,162,74,.4); border-radius: 999px;
}
.hero h1 { color: #fff; font-size: 46px; margin-bottom: 18px; }
.hero h1 .gold { color: var(--gold-400); }
.hero-sub { font-size: 17px; color: #B9C9DE; max-width: 540px; margin-bottom: 26px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.hero-points li { display: flex; align-items: center; gap: 10px; font-weight: 600; color: #DCE6F3; font-size: 15px; }
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; padding-bottom: 88px; }
  .hero h1 { font-size: 34px; }
}

/* ============ converter card ============ */
.converter {
  background: #fff; color: var(--ink); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 26px 26px 20px; position: relative; z-index: 5;
}
.conv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-title { font-size: 17px; font-weight: 800; margin: 0; color: var(--ink); letter-spacing: -.01em; }
.conv-live { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; color: var(--up); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px rgba(217,48,37,.18); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.conv-grid { display: grid; grid-template-columns: 1fr 1fr auto 1fr; gap: 10px; align-items: end; }
.conv-field label, .tri-input label, .tri-select-field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.conv-field input, .tri-input input {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: 17px; font-weight: 700; color: var(--ink); background: #fff;
  font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s;
}
.conv-field input:focus, .tri-input input:focus, .rates-search input:focus, #scanBase:focus {
  outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(18,59,122,.14);
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
select {
  width: 100%; appearance: none; -webkit-appearance: none;
  border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 12px 30px 12px 12px; font-size: 15px; font-weight: 600; color: var(--ink);
  background: #fff; cursor: pointer; transition: border-color .15s;
}
select:hover { border-color: var(--navy-600); }
select:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(18,59,122,.14); }
.conv-swap {
  width: 42px; height: 46px; border-radius: 12px; border: 1.5px solid var(--line-strong);
  background: var(--bg); color: var(--navy-700); cursor: pointer; display: grid; place-items: center;
  transition: transform .25s, border-color .15s, background .15s; flex: none;
}
.conv-swap:hover { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.conv-swap:active { transform: rotate(180deg); }
.conv-result {
  margin-top: 18px; background: linear-gradient(135deg, #F7F9FC 0%, #EDF2F8 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap;
}
.conv-result-main { display: flex; align-items: baseline; gap: 10px; }
.conv-result-value { font-size: 38px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.conv-result-code { font-size: 16px; font-weight: 800; color: var(--navy-700); }
.conv-result-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 13px; color: var(--muted); }
.conv-result-side b { color: var(--ink); font-variant-numeric: tabular-nums; }
.conv-rate-line { color: var(--body); }
.conv-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.conv-meta b { color: var(--body); }
.conv-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.chip {
  border: 1px solid var(--line-strong); background: #fff; color: var(--body);
  border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all .15s; font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--navy-700); color: var(--navy-700); background: rgba(18,59,122,.05); }
.chip.is-on { background: var(--navy-700); border-color: var(--navy-700); color: #fff; }
.chip-arrow { color: var(--gold-500); margin: 0 3px; font-weight: 400; }
.conv-tri-link { display: inline-block; margin-top: 16px; font-weight: 700; font-size: 14px; color: var(--navy-700); }
.conv-tri-link:hover { text-decoration: underline; }

/* ============ ticker ============ */
.ticker { position: relative; background: rgba(4,14,30,.55); border-top: 1px solid rgba(255,255,255,.08); overflow: hidden; }
.ticker-track { display: flex; gap: 44px; padding: 11px 0; white-space: nowrap; width: max-content; animation: ticker 48s linear infinite; font-variant-numeric: tabular-nums; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tick-item { font-size: 13.5px; color: #C6D4E8; font-weight: 600; }
.tick-item b { color: #fff; font-weight: 700; }
.tick-item .tick-up { color: #FF7A72; }
.tick-item .tick-down { color: #6FE3A0; }

/* ============ sections ============ */
.section { padding: 76px 0; }
.section-alt { background: var(--bg-alt); }
.section .eyebrow, .page-hero .eyebrow { color: var(--gold-500); border-color: rgba(200,162,74,.45); }
.section h2 { margin-bottom: 6px; }
.section-sub { color: var(--body); font-size: 16px; max-width: 720px; margin-bottom: 34px; }
.section-more { margin-top: 30px; }
.table-foot { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.container-narrow { margin-left: auto; margin-right: auto; }

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

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid transparent; border-radius: 11px; cursor: pointer;
  padding: 11px 20px; font-size: 14.5px; font-weight: 700; color: #fff;
  background: var(--navy-700); transition: transform .12s, box-shadow .15s, background .15s;
  text-decoration: none;
}
.btn:hover { background: var(--navy-600); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(18,59,122,.28); }
.btn:active { transform: none; }
.btn-gold { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: #2A2008; }
.btn-gold:hover { background: linear-gradient(135deg, var(--gold-500), #B8903F); color: #2A2008; }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.5); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.12); color: #fff; box-shadow: none; }
.btn-ghost { background: #fff; border-color: var(--line-strong); color: var(--navy-700); }
.btn-ghost:hover { border-color: var(--navy-700); color: var(--navy-700); background: rgba(18,59,122,.05); box-shadow: none; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 9px; }

/* ============ triangular teaser ============ */
.tri-teaser-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.tri-feature-list { display: flex; flex-direction: column; gap: 14px; margin: 26px 0 30px; }
.tri-feature { padding-left: 18px; border-left: 3px solid var(--gold-500); }
.tri-feature h4 { margin: 0 0 3px; font-size: 15.5px; }
.tri-feature p { margin: 0; font-size: 14px; color: var(--muted); }
.tri-demo { padding: 24px; background: var(--navy-900); border: 0; }
.tri-demo-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.tri-demo-title { color: #fff; font-weight: 800; font-size: 15px; }
.tri-demo-badge { font-size: 12px; font-weight: 700; color: var(--gold-400); border: 1px solid rgba(200,162,74,.4); padding: 4px 10px; border-radius: 999px; }
.tri-demo-legs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.tri-leg {
  display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.09); border-radius: 10px; padding: 10px 14px;
}
.tri-leg-code { font-weight: 800; color: #fff; font-size: 14px; }
.tri-leg-arrow { color: var(--gold-400); }
.tri-leg-rate { margin-left: auto; color: #C6D4E8; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tri-demo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tri-stat { background: rgba(255,255,255,.05); border-radius: 10px; padding: 10px 12px; }
.tri-stat-label { display: block; font-size: 11px; color: #8FA5C0; margin-bottom: 4px; }
.tri-stat-value { font-size: 15px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.tri-stat-value.is-up { color: #FF7A72; }
.tri-stat-value.is-down { color: #6FE3A0; }
@media (max-width: 980px) { .tri-teaser-grid { grid-template-columns: 1fr; } }

/* ============ pair cards grid ============ */
.pairs-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.pair-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 8px; color: var(--body);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.pair-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); color: var(--body); }
.pair-card-head { display: flex; align-items: center; gap: 8px; }
.pair-codes { font-weight: 800; color: var(--ink); font-size: 14.5px; }
.pair-slash { color: var(--gold-500); margin: 0 2px; }
.pair-card-rate { font-size: 22px; font-weight: 800; color: var(--navy-800); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pair-card-names { font-size: 12.5px; color: var(--muted); }
@media (max-width: 1080px) { .pairs-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .pairs-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ delta badges ============ */
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--up); background: rgba(217,48,37,.09); }
.delta.down { color: var(--down); background: rgba(30,142,62,.1); }
.delta.flat { color: var(--muted); background: var(--bg-alt); }
.src-flag { font-size: 10.5px; font-weight: 700; margin-left: 6px; padding: 2px 6px; border-radius: 5px; }
.src-flag.best { color: var(--up); background: rgba(217,48,37,.09); }
.src-flag.worst { color: var(--down); background: rgba(30,142,62,.1); }

/* ============ data tables ============ */
.table-wrap { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: .04em; text-transform: uppercase; padding: 13px 14px;
  background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: rgba(18,59,122,.035); }
.cell-flag { white-space: nowrap; }
.cell-flag .code { margin-left: 8px; }
.cell-name { color: var(--body); }
.cell-rate { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cell-action { text-align: right; white-space: nowrap; }
.cell-delta { text-align: right; }
.rates-table-wrap { max-height: 720px; overflow: auto; }
.rates-table th { position: sticky; top: 0; z-index: 2; }
.scan-empty { text-align: center; color: var(--muted); padding: 30px 14px !important; }
.leg-path b { color: var(--ink); }
.src-badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  background: var(--bg-alt); color: var(--navy-700); border: 1px solid var(--line);
}
.src-cell .sep { color: var(--line-strong); margin: 0 4px; }

/* ============ triangular tool page ============ */
.page-hero {
  background: linear-gradient(160deg, var(--navy-900), var(--navy-800));
  color: #EAF1FA; padding: 60px 0 46px;
}
.page-hero h1 { color: #fff; font-size: 36px; margin-bottom: 10px; }
.page-hero-sub { color: #B9C9DE; font-size: 16.5px; max-width: 760px; }
.page-hero .eyebrow { margin-bottom: 14px; }
.pair-hero { padding-bottom: 40px; }
.pair-eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.live-badge { display: inline-flex; align-items: center; gap: 5px; color: #FF7A72; font-weight: 800; font-size: 11px; letter-spacing: .08em; }
.pair-hero-rate { display: flex; gap: 44px; align-items: flex-end; flex-wrap: wrap; margin-top: 18px; }
.pair-hero-value { font-size: 52px; font-weight: 800; color: #fff; letter-spacing: -.02em; line-height: 1; }
.pair-hero-sub { display: block; margin-top: 8px; color: #B9C9DE; font-size: 14.5px; }
.pair-hero-sub b { color: #fff; }
.pair-hero-meta { display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: #8FA5C0; padding-bottom: 6px; }
.pair-hero-meta b { color: #DCE6F3; }

.tri-tool { padding: 28px; }
.tri-tool-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.tri-inputs { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.tri-input { width: 150px; }
.tri-input-wide { flex: 1; min-width: 180px; }
.tri-selects { display: flex; gap: 12px; align-items: flex-end; flex: 2; min-width: 340px; }
.tri-select-field { flex: 1; }
.tri-arrow { color: var(--gold-500); font-weight: 800; font-size: 18px; padding-bottom: 13px; }
.tri-result { margin-top: 24px; }
.verdict {
  display: flex; align-items: center; gap: 12px; border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 18px; font-weight: 800;
}
.verdict-icon { font-size: 18px; }
.verdict-value { margin-left: auto; font-size: 20px; }
.verdict-ok { background: rgba(217,48,37,.07); color: var(--up); border: 1px solid rgba(217,48,37,.25); }
.verdict-no { background: var(--bg-alt); color: var(--body); border: 1px solid var(--line); }
.gauge { margin-bottom: 20px; }
.gauge-label { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.gauge-bar { position: relative; height: 12px; background: var(--bg-alt); border-radius: 99px; overflow: visible; border: 1px solid var(--line); }
.gauge-mid { position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--navy-700); }
.gauge-needle {
  position: absolute; top: -7px; width: 4px; height: 26px; border-radius: 3px;
  background: var(--gold-500); box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(200,162,74,.5);
  transform: translateX(-50%); transition: left .4s cubic-bezier(.22,.68,.36,1);
}
.tri-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 22px; }
.tri-stats .tri-stat { background: var(--bg); border: 1px solid var(--line); padding: 12px 14px; }
.tri-stats .tri-stat-label { font-size: 11px; color: var(--muted); margin-bottom: 5px; display: block; }
.tri-stats .tri-stat-value { font-size: 16px; font-weight: 800; color: var(--ink); }
.tri-foot { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.scan-bar { display: flex; gap: 22px; align-items: flex-end; padding: 18px 20px; margin-bottom: 20px; flex-wrap: wrap; }
.scan-field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.scan-field:first-child { min-width: 240px; }
.scan-fee-chips { display: flex; gap: 8px; }
.scan-meta { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.scan-hint { font-size: 12.5px; color: var(--gold-500); font-weight: 600; margin-top: 4px; }

.formula {
  background: var(--navy-900); color: #fff; border-radius: var(--radius);
  padding: 18px 22px; font-size: 16px; font-weight: 700; margin: 18px 0 22px;
  font-variant-numeric: tabular-nums; text-align: center; letter-spacing: .01em;
}
.risk-box { border-left: 4px solid var(--up); background: rgba(217,48,37,.04); margin-top: 26px; padding: 18px 22px; }
.risk-box h3 { margin: 0 0 8px; font-size: 15.5px; color: var(--up); }
.risk-box p { margin: 0; font-size: 14px; }

/* ============ pair page ============ */
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pair-conv { padding: 22px; }
.pair-conv-result { margin-top: 16px; background: linear-gradient(135deg, #F7F9FC, #EDF2F8); border-radius: var(--radius); padding: 16px 18px; font-size: 28px; font-weight: 800; color: var(--ink); }
.pair-conv-result .code-sm { font-size: 14px; margin-left: 8px; }
.pair-tri { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.pair-tri h3 { font-size: 14px; margin-bottom: 6px; }
.pair-tri p { font-size: 13px; margin-bottom: 10px; }
.pair-side { display: flex; flex-direction: column; gap: 20px; }
.pair-table-card, .pair-src-card { padding: 22px; }
.pair-src-note { font-size: 12px; margin: 10px 0 0; }
.pair-trend { margin-top: 20px; padding: 22px; }
.trend-note { font-size: 12.5px; margin-bottom: 14px; }
.trend-chart { position: relative; height: 220px; }
.trend-loading { color: var(--muted); font-size: 13px; padding: 40px 0; text-align: center; }
.trend-svg { width: 100%; height: 220px; display: block; }
.trend-stats { display: flex; gap: 26px; margin-top: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.trend-stats b { color: var(--ink); }
.pair-faq-title { margin-top: 56px; }
@media (max-width: 980px) { .pair-grid { grid-template-columns: 1fr; } }

/* ============ FAQ accordion ============ */
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { padding: 0; overflow: hidden; }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 20px; cursor: pointer; font-weight: 700; color: var(--ink); font-size: 15.5px;
  list-style: none; transition: background .15s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: var(--bg); }
.faq-icon { position: relative; width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--bg-alt); transition: transform .25s, background .15s; }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; top: 50%; left: 50%; background: var(--navy-700); transform: translate(-50%, -50%); border-radius: 2px; }
.faq-icon::before { width: 12px; height: 2px; }
.faq-icon::after { width: 2px; height: 12px; transition: transform .25s; }
.faq-item[open] .faq-icon { transform: rotate(45deg); background: var(--gold-500); }
.faq-item[open] .faq-icon::before, .faq-item[open] .faq-icon::after { background: #fff; }
.faq-body { padding: 0 20px 18px; color: var(--body); font-size: 14.5px; }
.faq-body p { margin: 0; }

/* ============ features & steps ============ */
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.feature { padding: 26px 22px; }
.feature-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(200,162,74,.16), rgba(18,59,122,.1));
  font-size: 22px; margin-bottom: 14px;
}
.feature h3 { font-size: 16.5px; margin-bottom: 8px; }
.feature p { font-size: 14px; color: var(--muted); margin: 0; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { padding: 26px 22px; }
.step-num {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--navy-700); color: #fff; font-weight: 800; margin-bottom: 14px; font-size: 16px;
}
.step h3 { font-size: 16px; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--muted); margin: 0; }
@media (max-width: 1080px) { .feature-grid, .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .feature-grid, .steps { grid-template-columns: 1fr; } }

/* ============ CTA band ============ */
.cta-band { background: linear-gradient(135deg, var(--navy-800), var(--navy-900)); padding: 56px 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.cta-inner h2 { color: #fff; margin: 0 0 6px; font-size: 26px; }
.cta-inner p { color: #B9C9DE; margin: 0; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============ footer ============ */
.footer { background: #071527; color: #8FA5C0; padding: 60px 0 0; }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; padding-bottom: 44px; }
.footer .brand-name { color: #fff; }
.foot-brand p { font-size: 13.5px; line-height: 1.7; margin: 14px 0 0; }
.foot-note { font-size: 12px; color: #5E7392; margin-top: 12px; }
.foot-col h4 { color: #DCE6F3; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px; }
.foot-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.foot-col a { color: #8FA5C0; font-size: 13.5px; }
.foot-col a:hover { color: #fff; }
.foot-bottom {
  border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; font-size: 12.5px; color: #5E7392;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.foot-bottom a { color: #8FA5C0; }
@media (max-width: 980px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .foot-grid { grid-template-columns: 1fr; } }

/* ============ rates page ============ */
.rates-toolbar { display: flex; gap: 18px; align-items: center; padding: 14px 18px; margin-bottom: 18px; flex-wrap: wrap; }
.rates-search { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 240px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 0 12px; color: var(--muted); }
.rates-search input { flex: 1; border: 0; outline: none; padding: 11px 0; font-size: 14.5px; font-family: inherit; background: transparent; color: var(--ink); }
.rates-filters { display: flex; gap: 8px; }
.rates-sort { display: flex; align-items: center; gap: 10px; }
.rates-sort label { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.rates-sort .select-wrap { width: 148px; }
.rates-meta { font-size: 12.5px; color: var(--muted); margin-top: 14px; }

/* ============ prose ============ */
.prose { font-size: 15.5px; }
.prose h2 { margin-top: 40px; margin-bottom: 12px; font-size: 21px; }
.prose-lead { font-size: 17px; color: var(--ink); font-weight: 600; }
.prose p { margin-bottom: 14px; }
.updated-note { font-size: 12.5px; color: var(--muted); }
.guide-steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 20px 0 24px; }
.guide-step { padding: 20px; }
.guide-step h3 { font-size: 15px; margin-bottom: 6px; color: var(--navy-700); }
.guide-step p { font-size: 13.5px; color: var(--muted); margin: 0; }
.principle-list { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 24px; }
.principle-list li { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; display: flex; flex-direction: column; gap: 5px; }
.principle-list b { color: var(--ink); font-size: 14.5px; }
.principle-list span { font-size: 13px; color: var(--muted); }
.disclaimer-box { margin-top: 30px; padding: 18px 22px; border-left: 4px solid var(--gold-500); background: rgba(200,162,74,.07); border-radius: 0 var(--radius) var(--radius) 0; }
.disclaimer-box h3 { font-size: 14.5px; margin-bottom: 6px; color: var(--ink); }
.disclaimer-box p { font-size: 13.5px; margin: 0; }
@media (max-width: 760px) { .guide-steps, .principle-list { grid-template-columns: 1fr; } }

/* ============ admin ============ */
.admin-topbar { position: sticky; top: 0; z-index: 70; background: var(--navy-900); border-bottom: 1px solid rgba(255,255,255,.1); }
.admin-topbar-inner { display: flex; align-items: center; gap: 18px; height: 58px; max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.admin-topbar .brand-name { color: #fff; }
.admin-badge { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--gold-400); border: 1px solid rgba(200,162,74,.4); border-radius: 99px; padding: 3px 10px; }
.admin-nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.admin-nav a { color: #B9C9DE; font-size: 13.5px; font-weight: 600; padding: 7px 12px; border-radius: 8px; }
.admin-nav a:hover, .admin-nav a.is-active { color: #fff; background: rgba(255,255,255,.1); }
.admin-main { max-width: 1280px; margin: 0 auto; padding: 28px 20px 80px; }
.admin-section { margin-bottom: 44px; }
.admin-section h2 { font-size: 20px; margin-bottom: 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 700; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--ink); }
.admin-actions { display: flex; gap: 10px; }
.admin-flash {
  display: none; margin-bottom: 16px; padding: 12px 18px; border-radius: var(--radius-sm);
  background: rgba(27,79,160,.09); border: 1px solid rgba(27,79,160,.25); color: var(--navy-700);
  font-weight: 600; font-size: 14px;
}
.admin-flash.is-show { display: block; }
.admin-flash.is-error { background: rgba(217,48,37,.08); border-color: rgba(217,48,37,.3); color: var(--up); }
.visits-chart { display: flex; gap: 10px; align-items: flex-end; height: 180px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.visits-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.visits-bar { width: 100%; max-width: 54px; background: linear-gradient(180deg, var(--navy-600), var(--navy-700)); border-radius: 6px 6px 0 0; min-height: 3px; transition: height .4s; }
.visits-bar-label { font-size: 11px; color: var(--muted); }
.settings-form { padding: 22px; max-width: 640px; display: flex; flex-direction: column; gap: 14px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: 14px; }
.settings-row > span { font-weight: 700; color: var(--ink); }
.settings-row b { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.settings-row input, .settings-row select { width: 260px; }
.settings-form .btn { align-self: flex-start; margin-top: 6px; }
@media (max-width: 1080px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } .settings-row { flex-direction: column; align-items: flex-start; } .settings-row input, .settings-row select { width: 100%; } }

.admin-login-body { background: var(--bg); min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.admin-login { width: 100%; max-width: 400px; padding: 36px; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.admin-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.admin-login h1 { font-size: 20px; margin-bottom: 20px; }
.admin-login form { display: flex; flex-direction: column; gap: 14px; }
.admin-login label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.admin-login input { border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 11px 14px; font-size: 15px; font-family: inherit; }
.admin-login input:focus { outline: none; border-color: var(--navy-700); }
.admin-login-error { background: rgba(217,48,37,.08); color: var(--up); border-radius: 8px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; margin-bottom: 14px; }

/* ============ responsive tweaks ============ */
@media (max-width: 640px) {
  .conv-grid { grid-template-columns: 1fr 1fr; }
  .conv-swap { grid-column: span 2; width: 100%; transform: rotate(90deg); }
  .conv-result { flex-direction: column; align-items: flex-start; }
  .conv-result-value { font-size: 30px; }
  .tri-selects { flex-direction: column; gap: 10px; }
  .tri-arrow { transform: rotate(90deg); padding: 0; }
  .tri-stats { grid-template-columns: repeat(2, 1fr); }
  .scan-bar { flex-direction: column; align-items: stretch; }
  .pair-hero-value { font-size: 38px; }
  .page-hero h1 { font-size: 28px; }
  h1 { font-size: 30px; }
  .section { padding: 52px 0; }
  .container, .container-narrow { padding: 0 16px; }
  /* wide tables stay usable on phones: horizontal scroll, no squeeze */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 520px; }
  .rates-table { min-width: 640px; }
  .tri-legs-table .data-table, .pair-table-card .data-table { min-width: 420px; }
  .tri-tool { padding: 18px 16px; }
  .tri-tool-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pair-flags { font-size: 0; }
  .pair-flags .flag-img + .flag-img { margin-left: 4px; }
  .pair-card-head { gap: 8px; }
  .cell-flag .code { margin-left: 6px; }
  .qty-chips, .scan-fee-chips { flex-wrap: wrap; }
  .topbar-inner { gap: 14px; }
  .brand-name { font-size: 16px; }
}
/* short landscape phones: keep hero compact */
@media (max-width: 740px) and (max-height: 420px) {
  .hero-grid { padding-top: 32px; padding-bottom: 48px; }
  .hero h1 { font-size: 26px; }
}

/* print */
@media print { .topbar, .ticker, .cta-band, .footer, .conv-swap, .admin-nav { display: none !important; } }
