/* ==========================================================================
   AbokiFx — Design System
   Emerald + slate, AbokiFX-familiar, data-dense, fast.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #F8FAFC;
  --bg-elevated: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-muted: #E2E8F0;

  /* Ink */
  --ink: #0F172A;
  --ink-2: #1E293B;
  --ink-muted: #475569;
  --ink-soft: #64748B;
  --ink-faint: #94A3B8;

  /* Border */
  --line: #E2E8F0;
  --line-strong: #CBD5E1;

  /* Brand — emerald */
  --brand: #059669;
  --brand-dark: #047857;
  --brand-deep: #064E3B;
  --brand-darker: #022C22;
  --brand-light: #10B981;
  --brand-pale: #ECFDF5;
  --brand-surface: #D1FAE5;

  /* Semantic */
  --up: #059669;
  --down: #DC2626;
  --down-surface: #FEE2E2;

  /* Fonts */
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-full: 999px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,0.07), 0 2px 4px -2px rgba(15,23,42,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15,23,42,0.08), 0 4px 6px -4px rgba(15,23,42,0.05);
  --shadow-emerald: 0 10px 30px -10px rgba(5,150,105,0.35);

  /* Layout */
  --maxw: 1240px;
  --maxw-narrow: 760px;
  --gutter: 24px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  letter-spacing: -0.005em;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }

.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;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: var(--maxw-narrow); margin: 0 auto; padding: 0 var(--gutter); }

@media (max-width: 500px) {
  :root { --gutter: 12px; }
}

/* Ticker removed */

/* ==========================================================================
   Navigation
   ========================================================================== */
.nav-wrap {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(135deg, var(--brand-darker) 0%, var(--brand-deep) 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 20px; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
}
.brand { display: flex; align-items: center; gap: 14px; color: #fff; font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand-light); font-size: 26px; font-weight: 800;
}
.brand-text { line-height: 1; }
.brand-text em { font-style: normal; color: var(--brand-light); font-weight: 400; }
.brand-sub { display: block; font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255,255,255,0.5); margin-top: 4px; font-weight: 700; }

.nav-links { display: flex; gap: 2px; align-items: center; }
.nav-links a {
  font-size: 12px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  padding: 8px 14px; border-radius: var(--r-full);
  transition: all 0.15s ease;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-links a.active { color: #fff; background: rgba(255,255,255,0.1); }
.nav-cta {
  background: var(--brand-light) !important;
  color: var(--brand-darker) !important;
  padding: 10px 18px !important;
  font-weight: 800 !important;
}
.nav-cta:hover { background: #fff !important; }

.nav-toggle {
  display: none; background: transparent; border: 0; padding: 8px;
  cursor: pointer; color: #fff;
}
@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--brand-darker);
    padding: 12px var(--gutter) 20px;
    gap: 2px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .nav-links.open a { width: 100%; padding: 14px 16px; border-radius: var(--r-md); }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: 48px 0 32px; }
.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}
.hero h1 .accent { color: var(--brand); }
.hero-lede {
  color: var(--ink-muted); font-size: 17px; max-width: 60ch;
  line-height: 1.6; margin: 0 0 20px;
}
.hero-meta {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  padding: 5px 10px; border-radius: var(--r-full);
  text-transform: uppercase;
}
.pill.live { background: var(--brand-pale); color: var(--brand-dark); border: 1px solid var(--brand-surface); }
.pill.neutral { background: var(--bg-subtle); color: var(--ink-muted); border: 1px solid var(--line); }

/* ==========================================================================
   Layout — sidebar grid
   ========================================================================== */
.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  padding: 24px 0 64px;
}
@media (max-width: 1000px) { .main-grid { grid-template-columns: 1fr; } }

.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-sticky { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 1001px) { .sidebar-sticky { position: sticky; top: 92px; } }

/* ==========================================================================
   Section headers
   ========================================================================== */
.section { margin-bottom: 48px; }
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.section-head h2 {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  display: flex; align-items: center; gap: 12px; color: var(--ink);
}
.section-head h2::before {
  content: ''; width: 4px; height: 22px; background: var(--brand);
  border-radius: 2px; display: inline-block;
}
.section-head .section-sub { color: var(--ink-muted); font-size: 13px; margin-top: 4px; }
.section-head .section-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--ink-faint); text-transform: uppercase;
}

/* ==========================================================================
   Flag images — rendered as direct <img> SVG tags, no CSS library needed
   ========================================================================== */
.rate-flag { display: inline-flex; align-items: center; flex-shrink: 0; }

/* ==========================================================================
   Rate cards — full-width stacked, matching the reference screenshot
   Header: flag + name + LIVE badge on one row (subtle gray bg)
   Body: BUY left | SELL right, large values
   ========================================================================== */
.rate-rows { display: flex; flex-direction: column; gap: 10px; }

.rate-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  text-decoration: none; color: inherit;
  display: block;
}
.rate-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--brand-surface);
  text-decoration: none;
}

/* Header row — flag, name, badge */
.rate-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
}
.rate-card-head-left { display: flex; align-items: center; gap: 14px; }
.rate-flag { font-size: 26px; line-height: 1; }
.rate-card-name { font-size: 15px; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.rate-card-code { font-size: 12px; font-weight: 600; color: var(--ink-soft); font-family: var(--font-mono); margin-top: 2px; }

.rate-badge {
  background: var(--brand); color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: 0.12em;
  padding: 5px 12px; border-radius: var(--r-full); text-transform: uppercase;
}

/* Body — two equal columns */
.rate-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.rate-col {
  padding: 22px 24px;
}
.rate-col + .rate-col {
  border-left: 1px solid var(--line);
}

/* Label — BUY green, SELL red */
.rate-label {
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 8px;
}
.rate-label.buy  { color: #059669; }
.rate-label.sell { color: #DC2626; }
.rate-label:not(.buy):not(.sell) { color: var(--ink-soft); }

/* Value — large bold mono */
.rate-value {
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.02em; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}

@media (max-width: 500px) {
  .rate-card-body {
    grid-template-columns: 1fr 1fr;
  }
  .rate-col {
    padding: 14px 14px;
  }
  .rate-value {
    font-size: 18px;
  }
  .rate-label {
    font-size: 10px;
    margin-bottom: 5px;
  }
  .rate-card-head {
    padding: 12px 14px;
  }
  .rate-flag { font-size: 22px; }
  .rate-card-name { font-size: 13px; }
  .rate-card-code { font-size: 11px; }
  .rate-badge { font-size: 8px; padding: 4px 8px; }
  .rate-rows { gap: 8px; }
  /* Conversion page result values */
  .rate-value[style*="font-size:26px"] { font-size: 20px !important; }
}

/* Keep old .rate-row alias removed */
.rate-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
}
.rate-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  color: inherit;
}
.rate-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-surface);
  text-decoration: none;
}
.rate-card.feature { grid-column: span 2; }
@media (max-width: 600px) { .rate-card.feature { grid-column: span 1; } }

.rate-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; background: var(--bg-subtle); border-bottom: 1px solid var(--line);
}
.rate-card-head-left { display: flex; align-items: center; gap: 12px; }
.rate-flag { font-size: 24px; line-height: 1; }
.rate-card-name { font-size: 13px; font-weight: 800; letter-spacing: 0; color: var(--ink); }
.rate-card-code { font-size: 11px; font-weight: 700; color: var(--ink-soft); letter-spacing: 0.04em; margin-top: 2px; font-family: var(--font-mono); }
.rate-badge {
  font-size: 9px; font-weight: 800; letter-spacing: 0.1em;
  padding: 3px 8px; border-radius: var(--r-full);
  background: var(--brand); color: #fff; text-transform: uppercase;
}
.rate-card-body { display: grid; grid-template-columns: 1fr 1fr; }
.rate-card.feature .rate-card-body { grid-template-columns: 1fr 1fr; }
.rate-col { padding: 20px 18px; }
.rate-col + .rate-col { border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(5,150,105,0.02), transparent); }
.rate-label {
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 6px;
}
.rate-label.buy  { color: #059669; }   /* green for buy */
.rate-label.sell { color: #DC2626; }   /* red for sell */
.rate-label:not(.buy):not(.sell) { color: var(--ink-soft); }
.rate-value {
  font-family: var(--font-mono);
  font-size: 24px; font-weight: 800;
  letter-spacing: -0.02em; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.rate-card.feature .rate-value { font-size: 24px; font-weight: 800; }
.rate-col.sell .rate-value { color: var(--brand-dark); }

/* Mini card variant removed — all currencies show equal full buy/sell layout */

/* ==========================================================================
   Spread banner
   ========================================================================== */
.spread-banner {
  display: flex; align-items: center; gap: 20px;
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand-darker) 100%);
  color: #fff;
  padding: 20px 24px; border-radius: var(--r-xl);
  margin: 16px 0 0;
  box-shadow: var(--shadow-emerald);
}
.spread-num { font-family: var(--font-mono); font-size: 28px; font-weight: 800; color: var(--brand-light); letter-spacing: -0.02em; line-height: 1; }
.spread-text { font-size: 13px; line-height: 1.4; color: rgba(255,255,255,0.85); }
.spread-text strong { color: #fff; font-weight: 700; }

/* ==========================================================================
   CBN official panel
   ========================================================================== */
.cbn-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
}
.cbn-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px;
  margin-top: 16px;
}
.cbn-item {
  padding: 12px 14px;
  background: var(--bg-subtle);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}
.cbn-item-label { font-size: 10px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; font-family: var(--font-mono); }
.cbn-item-value { font-family: var(--font-mono); font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Converter (sidebar)
   ========================================================================== */
.converter {
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand-darker) 100%);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-emerald);
}
.converter h3 {
  font-size: 18px; font-weight: 800; color: #fff;
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.converter h3 .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-light); animation: pulse 2s infinite; }
.conv-stack { display: flex; flex-direction: column; gap: 12px; }
.conv-field { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--r-md); padding: 12px 14px; transition: background 0.15s, border-color 0.15s; }
.conv-field:focus-within { background: rgba(255,255,255,0.12); border-color: var(--brand-light); }
.conv-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.conv-tag { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 0.1em; }
.conv-currency-select {
  background: rgba(0,0,0,0.25); border: 1px solid rgba(255,255,255,0.1);
  color: #fff; border-radius: var(--r-full);
  padding: 3px 10px; font-size: 11px; font-weight: 700; cursor: pointer;
}
.conv-currency-select option { background: var(--brand-darker); color: #fff; }
.conv-input {
  width: 100%; background: transparent; border: 0; padding: 2px 0;
  font-family: var(--font-mono); font-size: 24px; font-weight: 800;
  letter-spacing: -0.02em; color: #fff; outline: none;
  font-variant-numeric: tabular-nums;
}
.conv-result {
  font-family: var(--font-mono); font-size: 28px; font-weight: 800;
  letter-spacing: -0.02em; color: var(--brand-light);
  font-variant-numeric: tabular-nums;
}
.conv-meta {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px dashed rgba(255,255,255,0.1);
  font-size: 11px; color: rgba(255,255,255,0.6);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.conv-meta .v { color: #fff; font-weight: 600; font-family: var(--font-mono); }

.market-toggle {
  display: inline-flex; background: rgba(0,0,0,0.25); padding: 3px;
  border-radius: var(--r-full); gap: 2px; border: 1px solid rgba(255,255,255,0.06);
}
.market-toggle button {
  border: 0; background: transparent; cursor: pointer;
  padding: 5px 12px; border-radius: var(--r-full);
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5); text-transform: uppercase;
  transition: all 0.15s;
}
.market-toggle button.active { background: var(--brand-light); color: var(--brand-darker); }

/* ==========================================================================
   Sidebar cards
   ========================================================================== */
.side-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 20px;
}
.side-card h3 {
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em;
  color: var(--ink-soft); text-transform: uppercase;
  padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}

.news-item { padding: 12px 0; border-bottom: 1px solid var(--line); display: block; color: inherit; }
.news-item:last-child { border-bottom: 0; }
.news-item:hover h4 { color: var(--brand-dark); }
.news-item h4 { font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--ink-2); margin-bottom: 4px; transition: color 0.15s; }
.news-item-meta { font-size: 10px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.news-item-tag { display: inline-block; font-size: 9px; font-weight: 800; background: var(--brand-pale); color: var(--brand-dark); padding: 2px 6px; border-radius: var(--r-sm); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }

/* ==========================================================================
   Conversion table (SEO goldmine — $1 → ₦, $5 → ₦, etc.)
   ========================================================================== */
.conv-table-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.conv-table-head {
  padding: 20px 24px;
  background: #0B1220;
  color: #fff;
}
.conv-table-head h2 { color: #fff; font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.conv-table-head p { color: #94A3B8; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
table.data th, table.data td {
  text-align: left; padding: 14px 24px;
  border-bottom: 1px solid var(--line); vertical-align: middle;
}
table.data thead th {
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em;
  color: var(--ink-soft); text-transform: uppercase;
  background: var(--bg-subtle);
}
table.data thead th:last-child { color: var(--brand-dark); }
table.data tbody tr:hover { background: var(--brand-pale); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td:last-child { font-family: var(--font-mono); font-weight: 700; color: var(--brand-dark); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Buttons & inputs
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r-full);
  font-size: 13px; font-weight: 700; line-height: 1;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-subtle); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--brand-dark); }
.btn-danger { background: var(--down); color: #fff; }

.input, .select, .textarea {
  width: 100%; padding: 11px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font-size: 14px; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-pale);
}
.textarea { min-height: 200px; resize: vertical; line-height: 1.6; font-family: var(--font-sans); }
.label { display: block; font-size: 11px; font-weight: 700; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.form-row { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* ==========================================================================
   Market News — horizontal cards, prominent
   ========================================================================== */
.news-rows { display: flex; flex-direction: column; gap: 10px; }

.news-row {
  display: grid; grid-template-columns: 1fr auto auto;
  align-items: center; gap: 20px;
  background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 24px;
  text-decoration: none; color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.news-row:hover { border-color: var(--brand-surface); box-shadow: var(--shadow-sm); transform: translateY(-1px); text-decoration: none; }
.news-row-left { display: flex; align-items: center; gap: 14px; }
.news-row-tag { font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand-dark); background: var(--brand-pale); padding: 3px 8px; border-radius: var(--r-full); display: inline-block; margin-bottom: 8px; }
.news-row h3 { font-size: 17px; font-weight: 800; line-height: 1.35; color: var(--ink); margin: 0 0 6px; letter-spacing: -0.01em; }
.news-row-byline { font-size: 12px; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.news-row-meta { font-size: 11px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }
.news-row-arrow { color: var(--brand); font-size: 18px; font-weight: 700; flex-shrink: 0; }

@media (max-width: 700px) {
  .news-row { grid-template-columns: 1fr auto; gap: 12px; padding: 16px 18px; }
  .news-row-meta { display: none; }
  .news-row h3 { font-size: 15px; }
}

/* ==========================================================================
   Price Trend (homepage)
   ========================================================================== */
.trend-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px 28px;
}
.trend-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.trend-title { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.trend-sub { font-size: 13px; color: var(--ink-muted); margin-top: 2px; font-weight: 500; }
.trend-tabs {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  padding: 3px; border-radius: var(--r-full);
  gap: 2px;
}
.trend-tab {
  background: transparent; border: 0; cursor: pointer;
  padding: 7px 16px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  color: var(--ink-soft);
  transition: all 0.15s;
  font-family: var(--font-sans);
}
.trend-tab:hover { color: var(--ink); }
.trend-tab.active {
  background: var(--bg-elevated);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.trend-chart-wrap { height: 360px; position: relative; }
@media (max-width: 600px) {
  .trend-card { padding: 20px; }
  .trend-chart-wrap { height: 280px; }
  .trend-tabs { width: 100%; justify-content: space-between; }
  .trend-tab { flex: 1; }
}

/* ==========================================================================
   Chart card
   ========================================================================== */
.chart-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 24px;
}
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.range-toggle { display: inline-flex; background: var(--bg-subtle); padding: 3px; border-radius: var(--r-full); border: 1px solid var(--line); }
.range-toggle button {
  background: transparent; border: 0; cursor: pointer;
  padding: 5px 14px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em;
  color: var(--ink-soft); font-family: var(--font-mono);
  transition: all 0.15s;
}
.range-toggle button.active { background: var(--ink); color: #fff; }
.chart-wrap { height: 360px; position: relative; }

/* ==========================================================================
   Blog cards
   ========================================================================== */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.post-card {
  display: flex; flex-direction: column;
  background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 24px;
  transition: all 0.2s ease; text-decoration: none; color: inherit;
  min-height: 240px;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-surface); text-decoration: none; }
.post-emoji { font-size: 34px; margin-bottom: 14px; }
.post-card h3 { font-size: 18px; font-weight: 800; line-height: 1.3; margin-bottom: 10px; color: var(--ink); }
.post-excerpt { font-size: 14px; color: var(--ink-muted); line-height: 1.55; margin-bottom: 16px; flex: 1; }
.post-meta { font-size: 10px; font-weight: 800; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }

.post-article { max-width: 720px; margin: 0 auto; padding: 40px var(--gutter); }
.post-article h1 { font-size: clamp(28px, 4.5vw, 44px); font-weight: 800; line-height: 1.15; letter-spacing: -0.025em; margin-bottom: 14px; }
.post-article .post-meta { margin-bottom: 28px; }
.post-article p { font-size: 17px; line-height: 1.75; margin: 0 0 18px; color: var(--ink-2); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--bg-elevated); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: var(--r-full); text-transform: uppercase;
}
.badge.verified { background: var(--brand-pale); color: var(--brand-dark); }
.badge.unverified { background: var(--bg-muted); color: var(--ink-muted); }
.star-rating { color: #F59E0B; font-size: 13px; font-family: var(--font-mono); letter-spacing: 1px; }

/* ==========================================================================
   FAQ (details/summary)
   ========================================================================== */
.faq-item {
  background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 24px; margin-bottom: 12px;
}
.faq-item[open] { border-color: var(--brand-surface); }
.faq-item summary {
  list-style: none; cursor: pointer;
  font-weight: 700; font-size: 15px; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+'; font-size: 22px; font-weight: 400; color: var(--ink-soft);
  transition: transform 0.2s;
}
.faq-item[open] summary::after { content: '–'; color: var(--brand); }
.faq-item[open] summary { margin-bottom: 12px; }
.faq-body { font-size: 14px; color: var(--ink-muted); line-height: 1.65; padding-top: 12px; border-top: 1px solid var(--line); }

/* ==========================================================================
   Alerts / flash
   ========================================================================== */
.flash { padding: 12px 16px; border-radius: var(--r-md); font-size: 14px; margin-bottom: 16px; border: 1px solid; font-weight: 600; }
.flash.success { background: var(--brand-pale); color: var(--brand-dark); border-color: var(--brand-surface); }
.flash.error { background: var(--down-surface); color: var(--down); border-color: #FCA5A5; }

.alert-hero {
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand-darker) 100%);
  color: #fff; border-radius: var(--r-xl); padding: 40px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center;
  box-shadow: var(--shadow-emerald);
}
@media (max-width: 800px) { .alert-hero { grid-template-columns: 1fr; padding: 28px; } }
.alert-hero h2 { color: #fff; font-size: clamp(26px, 3.5vw, 36px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.alert-hero h2 em { color: var(--brand-light); font-style: normal; }
.alert-hero p { color: rgba(255,255,255,0.72); font-size: 15px; max-width: 40ch; }
.alert-hero-card { background: var(--bg-elevated); color: var(--ink); border-radius: var(--r-lg); padding: 24px; }

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  background: #0B1220; color: #94A3B8;
  padding: 56px 0 24px; margin-top: 64px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter) 36px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 800; font-size: 20px; margin-bottom: 14px; }
.footer-brand .brand-mark { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); }
.footer-col h4 { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #CBD5E1; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #94A3B8; font-size: 13px; font-weight: 500; }
.footer-col a:hover { color: var(--brand-light); }
.footer-bottom {
  max-width: var(--maxw); margin: 0 auto; padding: 24px var(--gutter) 0;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 11px; color: #64748B; font-weight: 600;
}
.footer-bottom a { color: #64748B; }

/* ==========================================================================
   Admin
   ========================================================================== */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
@media (max-width: 800px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-sidebar { background: #0B1220; color: #94A3B8; padding: 24px 18px; }
.admin-sidebar .brand { color: #fff; margin-bottom: 28px; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar nav a {
  padding: 10px 14px; border-radius: var(--r-md);
  font-size: 13px; color: #94A3B8; transition: all 0.15s ease; font-weight: 600;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active {
  background: rgba(255,255,255,0.05); color: #fff; text-decoration: none;
}
.admin-main { padding: 36px; background: var(--bg); }
.admin-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.admin-head p { color: var(--ink-muted); margin-top: 4px; font-size: 14px; }
.admin-head { margin-bottom: 28px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 32px; }
.stat-card { background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.stat-label { font-size: 10px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }
.stat-value { font-family: var(--font-mono); font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }

.card { background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 24px; }

.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background:
    radial-gradient(circle at 20% 30%, var(--brand-pale) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, #FEF3C7 0%, transparent 50%),
    var(--bg);
}
.login-card { background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 36px; max-width: 420px; width: 100%; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 28px; font-weight: 800; margin-bottom: 4px; }
.login-card p { color: var(--ink-muted); font-size: 14px; margin-bottom: 24px; }

/* ==========================================================================
   Misc
   ========================================================================== */
.hidden { display: none !important; }
.section-intro {
  font-size: 16px; color: var(--ink-2); line-height: 1.65;
  max-width: 68ch;
}
.section-intro p { margin: 0 0 14px; }
.section-intro h3 { font-size: 18px; font-weight: 800; margin: 24px 0 10px; color: var(--ink); }

@media print {
  .nav-wrap, .ticker-wrap, footer, .btn { display: none; }
}
