:root {
  --bg: #070b14;
  --surface: #0e1526;
  --surface-2: #141e35;
  --border: rgba(148, 163, 184, 0.16);
  --border-bright: rgba(16, 185, 129, 0.42);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.14);
  --sky: #38bdf8;
  --amber: #f59e0b;
  --rose: #fb7185;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 20% -10%, rgba(16, 185, 129, 0.14), transparent 45%),
              radial-gradient(circle at 85% 5%, rgba(56, 189, 248, 0.10), transparent 40%),
              var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.mono { font-family: 'JetBrains Mono', monospace; }
.muted { color: var(--muted); }
.accent { color: var(--emerald); }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Ticker Bar */
.ticker-bar {
  background: rgba(14, 21, 38, 0.92);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  overflow-x: auto;
}
.ticker-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 8px;
  padding-bottom: 8px;
  white-space: nowrap;
}
.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--emerald);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.live-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}
.ticker-track {
  display: flex;
  align-items: center;
  gap: 18px;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  transition: color 0.15s;
}
.ticker-item:hover { color: #fff; }
.ticker-item strong { color: #fff; font-weight: 700; }
.delta.up { color: var(--emerald); font-weight: 600; }
.delta.down { color: var(--rose); font-weight: 600; }
.delta.flat { color: var(--muted); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 20, 0.78);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #0ea5e9);
  color: #04120c;
  font-size: 17px;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.main-nav a {
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: all 0.15s;
}
.main-nav a:hover, .main-nav a.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.header-cta {
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--emerald-soft);
  border: 1px solid var(--border-bright);
  color: var(--emerald);
  font-weight: 600;
  font-size: 13.5px;
  transition: all 0.15s;
}
.header-cta:hover { background: var(--emerald); color: #05130d; }

/* Hero */
.hero { padding-top: 38px; padding-bottom: 22px; }
.eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--emerald);
  background: var(--emerald-soft);
  border: 1px solid var(--border-bright);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 780px;
}
.hero-sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 16.5px;
  max-width: 680px;
}

/* Tool Tabs */
.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tab-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.tab-btn:hover { color: #fff; border-color: rgba(255,255,255,0.25); }
.tab-btn.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(56, 189, 248, 0.14));
  border-color: var(--emerald);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(16,185,129,0.25);
}

/* Calculator Workspace */
.workspace { padding-bottom: 28px; }
.calc-card {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  background: linear-gradient(180deg, rgba(14,21,38,0.96), rgba(11,17,31,0.98));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}
.calc-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 16px;
  border-right: 1px solid var(--border);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
}
.field-head .val-pill {
  font-family: 'JetBrains Mono', monospace;
  color: var(--emerald);
  font-size: 13px;
}
input[type="number"], input[type="text"], input[type="email"], input[type="url"], input[type="password"], select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--emerald); }
input[type="range"] {
  width: 100%;
  accent-color: var(--emerald);
  cursor: pointer;
}

.calc-results {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.kpi-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
.kpi-box.primary {
  border-color: var(--border-bright);
  background: linear-gradient(135deg, rgba(16,185,129,0.14), rgba(20,30,53,0.95));
}
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-val { font-size: clamp(20px, 2.2vw, 27px); font-weight: 800; font-family: 'JetBrains Mono', monospace; margin-top: 4px; color: #fff; }
.kpi-sub { font-size: 12px; color: var(--emerald); margin-top: 2px; }

.chart-wrap {
  background: rgba(8, 12, 22, 0.72);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}
.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.chart-head h3 { margin: 0; font-size: 14.5px; color: #cbd5e1; }
#calc-chart { width: 100%; height: 290px; display: block; }

/* Inline Contextual Affiliate Banner */
.inline-affiliate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(16,185,129,0.12), rgba(56,189,248,0.08));
  border: 1px solid var(--border-bright);
}
.inline-affiliate p { margin: 4px 0 0; font-size: 13.5px; }

/* Buttons & Badges */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 11px;
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #03150e;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: transform 0.12s, filter 0.15s;
}
.primary-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ghost-btn:hover { border-color: var(--emerald); color: #fff; }
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(56,189,248,0.16);
  color: var(--sky);
}
.badge.emerald { background: var(--emerald-soft); color: var(--emerald); }

/* Pulse Strip */
.pulse-strip { margin: 12px auto 26px; }
.pulse-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--emerald);
  border-radius: 16px;
  padding: 20px 22px;
}
.pulse-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; }
.pulse-meta a { color: var(--emerald); font-weight: 600; }
.pulse-card h3 { margin: 0 0 6px; font-size: 18px; }
.pulse-card p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* Sections */
.section-block { margin-top: 40px; }
.section-head { margin-bottom: 18px; }
.section-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.section-head p { margin: 0; font-size: 14.5px; }
.section-head a { color: var(--emerald); text-decoration: underline; }

/* Affiliate Offers Grid */
.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.offer-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  transition: transform 0.15s, border-color 0.15s;
}
.offer-card:hover { transform: translateY(-3px); border-color: var(--border-bright); }
.offer-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.partner-name { font-weight: 700; font-size: 15px; }
.offer-card p { margin: 0; font-size: 13.5px; color: var(--muted); }
.offer-cta { font-weight: 700; font-size: 13.5px; color: var(--emerald); }

/* Programmatic Rate Pairs Grid */
.pairs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}
.pair-chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13.5px;
  transition: border-color 0.15s, background 0.15s;
}
.pair-chip:hover { border-color: var(--emerald); background: var(--surface-2); }
.pair-label { font-weight: 700; }
.pair-val { font-family: 'JetBrains Mono', monospace; color: var(--emerald); font-size: 12.5px; }

/* FAQ & Newsletter */
.two-col-info {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  margin-bottom: 56px;
}
.faq-card, .newsletter-card, .rate-hero-card, .table-card, .pulse-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
}
.faq-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-item h3 { margin: 0 0 6px; font-size: 15.5px; }
.faq-item p { margin: 0; color: var(--muted); font-size: 14px; }

.sub-form { display: flex; gap: 10px; margin-top: 16px; }
.sub-msg { font-size: 13px; margin-top: 10px; min-height: 18px; color: var(--emerald); }

/* Rate Pair Page & Tables */
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a:hover { color: #fff; }
.quick-conv-box {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 16px;
  margin-top: 20px;
}
.quick-conv-box label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.eq-sign { font-size: 24px; font-weight: 700; color: var(--emerald); padding-bottom: 8px; }
.conv-output {
  background: var(--surface-2);
  border: 1px solid var(--border-bright);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 18px;
  font-weight: 700;
  color: var(--emerald);
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }

.pulse-list { display: flex; flex-direction: column; gap: 18px; margin-top: 24px; }
.pulse-article h2 { margin: 4px 0 10px; font-size: 21px; }
.pulse-article ul { margin: 12px 0; padding-left: 20px; color: #cbd5e1; }
.pulse-article li { margin-bottom: 6px; }
.article-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.legal-body p { color: #cbd5e1; margin-bottom: 14px; }

/* Footer */
.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  background: rgba(8, 12, 22, 0.9);
  padding: 44px 0 28px;
  font-size: 13.5px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr 1fr;
  gap: 28px;
}
.footer-grid h4 { margin: 0 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; color: #cbd5e1; }
.footer-links { display: flex; flex-direction: column; gap: 8px; color: var(--muted); }
.footer-links.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.footer-links a:hover { color: var(--emerald); }
.footer-bottom {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .calc-card { grid-template-columns: 1fr; }
  .calc-controls { padding-right: 0; border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
  .two-col-info, .footer-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .inline-affiliate { flex-direction: column; align-items: flex-start; }
  .quick-conv-box { grid-template-columns: 1fr; }
  .eq-sign { display: none; }
  .sub-form { flex-direction: column; }
}
