/* ============================================
   NAIRA FX TRACKER — Design System
   Refined editorial finance aesthetic
   Light theme default, dark theme available
   Optimized: mobile-first, desktop, 4K
   ============================================ */

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ===== Design Tokens ===== */
:root {
  /* Naira-inspired palette - emerald green & gold */
  --accent: #0a7d2c;          /* Naira green */
  --accent-2: #0d9938;
  --accent-dark: #065c1e;
  --gold: #d4a017;
  --gold-soft: #f5d76e;
  --red: #d63b3b;
  --green: #1a9f4d;

  /* Light theme (default) */
  --bg: #fafaf7;
  --bg-2: #ffffff;
  --bg-3: #f1efe9;
  --surface: #ffffff;
  --surface-2: #f7f5f0;
  --border: #e8e4d8;
  --border-strong: #d4cfc0;
  --text: #14110a;
  --text-2: #5a544a;
  --text-3: #8a8475;
  --shadow-sm: 0 1px 2px rgba(20, 17, 10, 0.06);
  --shadow: 0 4px 24px -8px rgba(20, 17, 10, 0.12);
  --shadow-lg: 0 24px 48px -16px rgba(20, 17, 10, 0.18);

  /* Type */
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Spacing scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  /* Radius */
  --r-sm: 6px;
  --r: 12px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Container */
  --container-max: 1400px;
  --container-pad: 1.25rem;
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0c0e0b;
  --bg-2: #141714;
  --bg-3: #1c201d;
  --surface: #16191a;
  --surface-2: #1f2422;
  --border: #2a302c;
  --border-strong: #3a4239;
  --text: #f3f0e6;
  --text-2: #b3aea0;
  --text-3: #7a7568;
  --accent: #2bc35d;
  --accent-2: #4cd57a;
  --gold: #f0c040;
  --gold-soft: #ffd966;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 4px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.65);
}

/* ===== Base ===== */
html, body { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.container.narrow { max-width: 880px; }

.skip-link {
  position: absolute; top: -100px; left: 0;
  background: var(--accent); color: white;
  padding: var(--s-3) var(--s-4); z-index: 1000;
  border-radius: 0 0 var(--r) 0;
}
.skip-link:focus { top: 0; }

/* ===== Header ===== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .header { background: rgba(12, 14, 11, 0.85); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  padding-top: var(--s-3); padding-bottom: var(--s-3);
}

.logo {
  display: flex; align-items: center; gap: var(--s-3);
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.2rem; letter-spacing: -0.02em;
}
.logo-mark { width: 32px; height: 32px; flex-shrink: 0; }
.logo-text { white-space: nowrap; }
.logo-fx { color: var(--accent); }

.nav { display: none; gap: var(--s-1); align-items: center; }
.nav-link {
  font-size: 0.92rem; font-weight: 500;
  padding: var(--s-2) var(--s-4); border-radius: var(--r-sm);
  color: var(--text-2); transition: all 0.18s ease;
  position: relative;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active { color: var(--accent); }
.nav-link.active::after {
  content: ''; position: absolute; left: 50%; bottom: -2px;
  width: 18px; height: 2px; background: var(--accent);
  border-radius: 1px; transform: translateX(-50%);
}

.header-actions { display: flex; gap: var(--s-2); align-items: center; }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); color: var(--text-2);
  transition: all 0.18s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

#theme-toggle .icon-moon { display: none; }
[data-theme="dark"] #theme-toggle .icon-sun { display: none; }
[data-theme="dark"] #theme-toggle .icon-moon { display: block; }

.install-btn {
  padding: var(--s-2) var(--s-4);
  background: var(--accent); color: white;
  border-radius: var(--r-sm); font-weight: 600; font-size: 0.88rem;
  transition: all 0.18s ease;
}
.install-btn:hover { background: var(--accent-2); transform: translateY(-1px); }

.menu-btn { }

.mobile-nav {
  display: none; flex-direction: column;
  padding: var(--s-3) var(--container-pad);
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.mobile-nav.open { display: flex; }
.mobile-nav .nav-link { padding: var(--s-3) var(--s-4); }

/* ===== Hero ===== */
.hero {
  padding: var(--s-6) 0 var(--s-7);
  background:
    radial-gradient(ellipse 70% 50% at 80% 0%, rgba(10, 125, 44, 0.10), transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 30%, rgba(212, 160, 23, 0.08), transparent 70%);
}
[data-theme="dark"] .hero {
  background:
    radial-gradient(ellipse 70% 50% at 80% 0%, rgba(43, 195, 93, 0.10), transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 30%, rgba(240, 192, 64, 0.06), transparent 70%);
}

.hero-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--s-4); flex-wrap: wrap;
  margin-bottom: var(--s-6);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--text-2); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: var(--s-3);
}
.hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.05; letter-spacing: -0.03em;
  margin-bottom: var(--s-3);
}
.grad {
  background: linear-gradient(135deg, var(--accent) 0%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: var(--text-2); max-width: 60ch;
}

.hero-status {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; font-size: 0.85rem; color: var(--text-2);
  font-family: var(--font-mono);
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-3);
}
.dot.live {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(26, 159, 77, 0.18);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(26, 159, 77, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(26, 159, 77, 0.08); }
}

/* ===== FX Cards Grid ===== */
.fx-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 600px) { .fx-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .fx-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .fx-grid { grid-template-columns: repeat(4, 1fr); } }

.fx-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  transition: all 0.25s ease;
  position: relative; overflow: hidden;
}
.fx-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--accent), var(--gold));
  opacity: 0; transition: opacity 0.25s ease;
}
.fx-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.fx-card:hover::before { opacity: 1; }

.fx-card-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: var(--s-4);
}
.fx-pair {
  display: flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.05rem; letter-spacing: -0.01em;
}
.fx-flag {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); font-size: 1.15rem;
  border: 1px solid var(--border);
}
.fx-change {
  font-family: var(--font-mono); font-size: 0.82rem;
  padding: 2px 8px; border-radius: var(--r-sm); font-weight: 600;
}
.fx-change.up { color: var(--green); background: rgba(26, 159, 77, 0.12); }
.fx-change.down { color: var(--red); background: rgba(214, 59, 59, 0.12); }
.fx-change.flat { color: var(--text-3); background: var(--surface-2); }

.fx-rates {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  padding-top: var(--s-3); border-top: 1px dashed var(--border);
}
.fx-rate-label {
  font-size: 0.72rem; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: var(--s-1);
  font-family: var(--font-mono);
}
.fx-rate-value {
  font-family: var(--font-mono); font-weight: 700;
  font-size: 1.3rem; letter-spacing: -0.01em;
  color: var(--text); line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.fx-rate-value .ngn-sym { color: var(--accent); margin-right: 2px; }

/* ===== Section Titles ===== */
.section-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em; line-height: 1.15;
  margin-bottom: var(--s-3);
}
.section-sub { color: var(--text-2); margin-bottom: var(--s-5); }

/* ===== Quick Converter ===== */
.quick-converter { padding: var(--s-7) 0; }
.qc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-6);
  box-shadow: var(--shadow);
}
.qc-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s-4); align-items: end;
}
@media (max-width: 640px) {
  .qc-row { grid-template-columns: 1fr; }
  .qc-swap { justify-self: center; transform: rotate(90deg); }
}

.qc-field { display: flex; flex-direction: column; gap: var(--s-2); }
.qc-label {
  font-size: 0.78rem; color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 600;
}
.qc-input-wrap {
  display: flex; align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  overflow: hidden;
  transition: border-color 0.18s ease;
}
.qc-input-wrap:focus-within { border-color: var(--accent); }
.qc-input-wrap input {
  flex: 1; padding: var(--s-3) var(--s-4);
  background: transparent; border: none; outline: none;
  font-family: var(--font-mono); font-size: 1.1rem; font-weight: 600;
  min-width: 0;
}
.qc-input-wrap select {
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2); border: none; border-left: 1px solid var(--border);
  outline: none; font-weight: 600; cursor: pointer;
  font-family: var(--font-body);
}

.qc-swap {
  width: 44px; height: 44px;
  border-radius: 50%; background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); border: 1px solid var(--border);
  transition: all 0.18s ease;
}
.qc-swap:hover { background: var(--accent); color: white; transform: rotate(180deg); }
.qc-swap svg { width: 18px; height: 18px; }

.qc-meta {
  margin-top: var(--s-5);
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s-4); flex-wrap: wrap;
  padding-top: var(--s-4); border-top: 1px solid var(--border);
}
.qc-rate-label { font-size: 0.85rem; color: var(--text-2); margin-right: var(--s-3); }
.qc-toggle {
  display: inline-flex; background: var(--surface-2);
  border-radius: var(--r-sm); padding: 3px;
}
.qc-tab {
  padding: 6px var(--s-4); font-size: 0.85rem; font-weight: 600;
  color: var(--text-2); border-radius: var(--r-sm);
  transition: all 0.18s ease;
}
.qc-tab.active { background: var(--accent); color: white; }
.qc-rate {
  font-family: var(--font-mono); font-size: 0.95rem;
  color: var(--text-2); font-weight: 500;
}
.qc-full-link {
  display: inline-block; margin-top: var(--s-4);
  font-weight: 600; color: var(--accent); font-size: 0.92rem;
}
.qc-full-link:hover { text-decoration: underline; }

/* ===== Chart Section ===== */
.chart-section { padding: var(--s-7) 0; background: var(--bg-2); }
[data-theme="dark"] .chart-section { background: var(--bg-2); }
.chart-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5);
}
.chart-controls select {
  padding: var(--s-2) var(--s-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-weight: 600; cursor: pointer;
}
.tv-widget-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-3);
  overflow: hidden;
  min-height: 500px;
  position: relative;
}
#tv-fx-chart, .tv-widget-wrap > div { height: 500px; width: 100%; }

/* ===== Alerts ===== */
.alerts-section { padding: var(--s-7) 0; }
.alert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--s-6);
}
.alert-form {
  display: grid; gap: var(--s-3);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .alert-form { grid-template-columns: 1fr 1fr 1fr 1fr auto; align-items: end; }
}
.btn-primary {
  padding: var(--s-3) var(--s-5);
  background: var(--accent); color: white;
  border-radius: var(--r); font-weight: 600;
  transition: all 0.18s ease; height: 44px;
}
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); }
.btn-ghost {
  padding: var(--s-2) var(--s-3);
  background: transparent; color: var(--text-2);
  border: 1px solid var(--border); border-radius: var(--r-sm);
  font-size: 0.85rem; font-weight: 500;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger {
  color: var(--red); background: transparent;
  padding: 4px 10px; border-radius: var(--r-sm);
  font-size: 0.82rem;
}
.btn-danger:hover { background: rgba(214, 59, 59, 0.1); }

.alerts-list { margin-top: var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); }
.alert-item {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s-3); padding: var(--s-3) var(--s-4);
  background: var(--surface-2); border-radius: var(--r);
  font-size: 0.92rem;
}
.alert-item .alert-pair-label { font-weight: 600; }
.alert-item .alert-cond { font-family: var(--font-mono); color: var(--text-2); }
.alert-item.triggered { border-left: 3px solid var(--accent); }
.alert-empty { color: var(--text-3); text-align: center; padding: var(--s-5); font-size: 0.9rem; }

/* ===== Snapshot ===== */
.snapshot { padding: var(--s-7) 0; background: var(--bg-2); }
.snapshot-grid {
  display: grid; gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.snap-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  transition: all 0.25s ease;
}
.snap-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.snap-icon {
  width: 48px; height: 48px;
  border-radius: var(--r); background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); margin-bottom: var(--s-3);
}
.snap-icon svg { width: 24px; height: 24px; }
.snap-card h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.2rem; margin-bottom: var(--s-2);
  letter-spacing: -0.01em;
}
.snap-card p { color: var(--text-2); font-size: 0.92rem; margin-bottom: var(--s-3); }
.snap-cta { color: var(--accent); font-weight: 600; font-size: 0.9rem; }

/* ===== SEO/FAQ blocks ===== */
.seo-block { padding: var(--s-7) 0; }
.seo-block h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.25rem; margin-top: var(--s-5); margin-bottom: var(--s-2);
  letter-spacing: -0.01em;
}
.seo-block p {
  color: var(--text-2); line-height: 1.7; margin-bottom: var(--s-3);
  font-size: 1.02rem;
}
.seo-block strong { color: var(--text); }

.faq-section { padding: var(--s-6) 0 var(--s-7); }
.faq {
  border-bottom: 1px solid var(--border);
  padding: var(--s-4) 0;
}
.faq summary {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.05rem; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  list-style: none; letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; font-size: 1.4rem; color: var(--accent);
  transition: transform 0.18s ease;
}
.faq[open] summary::after { transform: rotate(45deg); }
.faq p { margin-top: var(--s-3); color: var(--text-2); line-height: 1.65; }

/* ===== Ad Slots ===== */
.ad-slot {
  min-height: 90px;
  margin: var(--s-5) 0;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 0.85rem;
}
.ad-slot:empty::before { content: '— ad space —'; opacity: 0.5; }

/* ===== Footer ===== */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  margin-top: var(--s-7);
  padding-top: var(--s-7);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
  padding-bottom: var(--s-6);
}
@media (min-width: 720px) { .footer-inner { grid-template-columns: 1fr 2fr; } }
.footer-tag { color: var(--text-2); margin-top: var(--s-3); font-size: 0.9rem; }
.footer-cols {
  display: grid; gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.footer-cols h4 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 0.92rem; margin-bottom: var(--s-3);
  letter-spacing: -0.01em;
}
.footer-cols a {
  display: block; padding: var(--s-1) 0;
  color: var(--text-2); font-size: 0.9rem;
  transition: color 0.15s ease;
}
.footer-cols a:hover { color: var(--accent); }
.footer-bottom {
  padding: var(--s-4) var(--container-pad);
  border-top: 1px solid var(--border);
  text-align: center; color: var(--text-3); font-size: 0.85rem;
}

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--text); color: var(--bg);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r); font-size: 0.92rem; font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200; max-width: 90vw;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ===== Tables (for commodities/crypto/forex pages) ===== */
.market-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-top: var(--s-4);
}
.market-toolbar {
  display: flex; gap: var(--s-3); align-items: center;
  padding: var(--s-4); flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.market-search {
  flex: 1; min-width: 200px;
  position: relative;
}
.market-search input {
  width: 100%; padding: var(--s-3) var(--s-4) var(--s-3) 40px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); outline: none;
  transition: border-color 0.18s ease;
}
.market-search input:focus { border-color: var(--accent); }
.market-search::before {
  content: '';
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8475' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat;
}
.market-filter {
  padding: var(--s-2) var(--s-4);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); cursor: pointer; font-weight: 500;
}
.market-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.92rem;
}
.market-table th, .market-table td {
  padding: var(--s-3) var(--s-4); text-align: left;
  border-bottom: 1px solid var(--border);
}
.market-table th {
  background: var(--surface-2);
  font-weight: 600; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-2); position: sticky; top: 0; z-index: 1;
  cursor: pointer; user-select: none;
}
.market-table th:hover { color: var(--text); }
.market-table td.num {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  text-align: right;
}
.market-table tr:last-child td { border-bottom: none; }
.market-table tr:hover { background: var(--surface-2); }
.market-table .star-btn {
  color: var(--text-3); transition: color 0.18s ease;
  padding: 4px;
}
.market-table .star-btn:hover, .market-table .star-btn.active { color: var(--gold); }
.market-table .star-btn svg { width: 18px; height: 18px; }
.market-table .symbol { font-weight: 600; }
.market-table .name { color: var(--text-2); font-size: 0.85rem; }

@media (max-width: 720px) {
  .market-table th:nth-child(n+5), .market-table td:nth-child(n+5) { display: none; }
}

/* ===== Page hero (sub-pages) ===== */
.page-hero {
  padding: var(--s-6) 0 var(--s-5);
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(10, 125, 44, 0.07), transparent 70%);
}
.page-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -0.025em; margin-bottom: var(--s-3); line-height: 1.1;
}
.page-sub { color: var(--text-2); max-width: 60ch; font-size: 1.02rem; }

/* ===== Converter page ===== */
.converter-page { padding-bottom: var(--s-7); }
.converter-grid {
  display: grid; gap: var(--s-5);
  grid-template-columns: 1fr;
}
@media (min-width: 960px) { .converter-grid { grid-template-columns: 1.4fr 1fr; } }

.conv-amount-input {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  padding: var(--s-4) var(--s-5); border-radius: var(--r);
  background: var(--bg); border: 1px solid var(--border);
  width: 100%; outline: none;
}
.conv-amount-input:focus { border-color: var(--accent); }

.conv-result {
  margin-top: var(--s-5); padding: var(--s-5);
  background: var(--surface-2); border-radius: var(--r);
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 700; word-break: break-word;
}
.conv-result-label {
  font-family: var(--font-body); font-size: 0.85rem;
  color: var(--text-2); font-weight: 500; margin-bottom: var(--s-2);
  text-transform: uppercase; letter-spacing: 0.06em;
}

.popular-list {
  display: flex; flex-direction: column; gap: var(--s-2);
}
.popular-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2); border-radius: var(--r);
  font-size: 0.92rem;
}
.popular-item .pair-name { font-weight: 600; }
.popular-item .pair-rate { font-family: var(--font-mono); color: var(--text-2); }

/* ===== Admin Page ===== */
.admin-page { padding: var(--s-6) 0 var(--s-7); }
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  margin-bottom: var(--s-5);
}
.admin-card h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.3rem; margin-bottom: var(--s-3);
  letter-spacing: -0.01em;
}
.admin-card .field {
  display: flex; flex-direction: column; gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.admin-card label {
  font-size: 0.85rem; color: var(--text-2); font-weight: 600;
}
.admin-card input[type="text"],
.admin-card input[type="password"],
.admin-card input[type="url"],
.admin-card textarea {
  padding: var(--s-3) var(--s-4);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-sm); outline: none;
  font-family: var(--font-mono); font-size: 0.92rem;
  transition: border-color 0.18s;
}
.admin-card input:focus, .admin-card textarea:focus { border-color: var(--accent); }
.admin-card textarea { min-height: 120px; resize: vertical; }
.admin-card .field-hint {
  font-size: 0.82rem; color: var(--text-3); margin-top: 2px;
}
.admin-card .actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-3); }

.admin-warn {
  padding: var(--s-3) var(--s-4);
  background: rgba(212, 160, 23, 0.12);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-sm);
  color: var(--text); font-size: 0.9rem;
  margin-bottom: var(--s-4);
}

/* ===== Responsive nav ===== */
@media (min-width: 920px) {
  .nav { display: flex; }
  .menu-btn { display: none; }
}

/* ===== 4K / High-DPI optimization ===== */
@media (min-width: 2200px) {
  :root {
    --container-max: 1800px;
    --container-pad: 2rem;
  }
  body { font-size: 18px; }
  .fx-rate-value { font-size: 1.5rem; }
}

@media (min-width: 3000px) {
  :root {
    --container-max: 2400px;
  }
  body { font-size: 20px; }
}

/* ===== Print ===== */
@media print {
  .header, .footer, .ad-slot, #install-btn, .qc-swap { display: none; }
}

/* ===== Reduce motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ════════════════════════════════════════════════
   DUAL SCROLLING TICKER BANNERS
   Two rows: Official CBN Rate + Black Market Rate
   Matches the reference screenshot style exactly
════════════════════════════════════════════════ */

.tickers-wrap {
  position: sticky;
  top: var(--header-h, 57px);
  z-index: 90;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  overflow: hidden;
}

/* One ticker row */
.ticker-row {
  display: flex;
  align-items: center;
  height: 38px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.ticker-row:last-child { border-bottom: none; }

/* Left label badge */
.ticker-label {
  flex-shrink: 0;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-transform: uppercase;
  color: #fff;
  min-width: 160px;
  justify-content: center;
}
.ticker-label.label-official { background: #1a4f8a; }  /* dark blue like screenshot */
.ticker-label.label-bm       { background: #8a1a1a; }  /* dark red for black market */

[data-theme="dark"] .ticker-label.label-official { background: #1e5fa8; }
[data-theme="dark"] .ticker-label.label-bm       { background: #a82020; }

/* Scrolling track container */
.ticker-scroller {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* The inner track — doubled content for seamless loop */
.tk-track {
  display: flex;
  align-items: center;
  width: max-content;
  animation: ticker-scroll 40s linear infinite;
  will-change: transform;
}
/* Sync both rows to same speed */
#ticker-bm-inner .tk-track {
  animation-duration: 40s; /* same as official */
}

.tk-track:hover { animation-play-state: paused; cursor: default; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Individual pair item */
.tk-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px 0 0;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.tk-item::after {
  content: '·';
  margin-left: 18px;
  color: var(--border-strong);
}
.tk-flag {
  font-size: 1.05rem;
  line-height: 1;
}
.tk-label { color: var(--text); }

/* Loading placeholder */
.tk-loading {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-3);
  padding: 0 20px;
  letter-spacing: 0.04em;
}

/* Divider between official and BM tickers */
.ticker-row.label-bm-row {
  background: rgba(138, 26, 26, 0.04);
}
[data-theme="dark"] .ticker-row.label-bm-row {
  background: rgba(168, 32, 32, 0.08);
}

/* AbokiDollar source badge */
.aboki-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(26, 159, 77, 0.12);
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
  border: 1px solid rgba(26, 159, 77, 0.25);
}

/* Pulse animation when rates update */
@keyframes badge-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(26,159,77,0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(26,159,77,0); }
  100% { box-shadow: 0 0 0 0 rgba(26,159,77,0); }
}
.badge-pulse { animation: badge-pulse 1s ease-out; }

/* Rate source mini-tag on FX cards */
.fx-rate-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.rate-src {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.rate-src-cbn   { background: rgba(26, 79, 138, 0.12); color: #1a4f8a; }
.rate-src-aboki { background: rgba(26, 159, 77, 0.12); color: var(--green); }
.rate-src-est   { background: var(--surface-2); color: var(--text-3); }
[data-theme="dark"] .rate-src-cbn { color: #6fa8dc; background: rgba(111,168,220,0.12); }
