/* ══════════════════════════════════════════
   RESET & CSS VARIABLES
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-base:       #030b18;
  --bg-mid:        #060f22;
  --bg-card:       rgba(5, 15, 35, 0.82);
  --bg-card-h:     rgba(7, 20, 46, 0.92);
  --cyan:          #00d8ff;
  --cyan-10:       rgba(0,216,255,.10);
  --cyan-15:       rgba(0,216,255,.15);
  --cyan-25:       rgba(0,216,255,.25);
  --purple:        #7b2fff;
  --purple-10:     rgba(123,47,255,.10);
  --gold:          #ffa940;
  /* refined chain-transfer palette (cohesive premium spectrum) */
  --btc:           #f5a623;
  --eth:           #7e8ce8;
  --bnb:           #e3b23c;
  --sol:           #9b7ae0;
  --xrp:           #46b6e0;
  --usdt:          #2ec9a0;
  --green:         #00e676;
  --red:           #ff3d71;
  --text1:         #deeeff;
  --text2:         #6b8fa8;
  --text3:         #304560;
  --border:        rgba(0,216,255,.10);
  --border-s:      rgba(0,216,255,.22);
  --r:             12px;
  --rs:            8px;
  --mono:          'JetBrains Mono', monospace;
  --sans:          'Space Grotesk', sans-serif;
}

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--bg-base);
  color: var(--text1);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
}

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cyan-15); border-radius: 3px; }

/* ── STAR FIELD BACKGROUND ── */
#stars-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

/* ── GRADIENT GLOW OVERLAY ── */
#app::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 50% at 50% -10%, rgba(0,216,255,.07) 0%, transparent 55%),
    radial-gradient(ellipse 55% 35% at 85% 75%, rgba(123,47,255,.06) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 5%  55%, rgba(0,216,255,.04) 0%, transparent 50%);
}

/* ── GRID DOTS ── */
#app::after {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(0,216,255,.06) 1px, transparent 1px);
  background-size: 34px 34px;
}

/* ══════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════ */
#app {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
}

/* ══════════════════════════════════════════
   HEADER
══════════════════════════════════════════ */
#hdr {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 18px;
  height: 54px; padding: 0 18px;
  background: rgba(3,11,24,.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(24px);
  z-index: 200;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; text-decoration: none; }
.logo-hex {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 0 7px rgba(0,216,255,.55));
  animation: hex-glow 3s ease-in-out infinite alternate;
}
.logo-hex svg { width: 36px; height: 36px; display: block; }
@keyframes hex-glow {
  from { filter: drop-shadow(0 0 6px var(--cyan)); }
  to   { filter: drop-shadow(0 0 14px var(--purple)); }
}
.logo-txt {
  font-size: 15px; font-weight: 700; letter-spacing: .5px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-sub { font-size: 8px; color: var(--text3); font-family: var(--mono); letter-spacing: 2px; }
.badge-live {
  font-size: 8px; font-family: var(--mono); letter-spacing: 1px;
  color: var(--green); background: rgba(0,230,118,.10);
  border: 1px solid rgba(0,230,118,.28); border-radius: 4px;
  padding: 2px 6px;
}

/* Ticker */
.ticker-wrap {
  flex: 1; overflow: hidden; position: relative; min-width: 0;
}
.ticker-wrap::before, .ticker-wrap::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 36px; z-index: 2; pointer-events: none;
}
.ticker-wrap::before { left: 0;  background: linear-gradient(90deg, rgba(3,11,24,.92), transparent); }
.ticker-wrap::after  { right: 0; background: linear-gradient(-90deg, rgba(3,11,24,.92), transparent); }
.ticker {
  display: flex; animation: tick 50s linear infinite;
  width: max-content; will-change: transform;
}
@keyframes tick { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.ticker:hover { animation-play-state: paused; }
.t-item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0 16px; border-right: 1px solid var(--border);
  font-family: var(--mono); font-size: 10.5px; white-space: nowrap;
}
.t-sym { color: var(--text2); font-weight: 500; }
.t-prc { color: var(--text1); font-weight: 600; }
.t-chg { font-size: 9.5px; }
.t-chg.up { color: var(--green); }
.t-chg.dn { color: var(--red);   }

/* Right controls */
.hdr-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.live-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 9px; font-family: var(--mono); color: var(--green); letter-spacing: 1px;
}
.live-dot {
  width: 7px; height: 7px; background: var(--green);
  border-radius: 50%; box-shadow: 0 0 8px var(--green);
  animation: ldot 1.8s ease-in-out infinite;
}
@keyframes ldot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.7)} }
.utc-clock { font-family: var(--mono); font-size: 11px; color: var(--text2); }

/* ══════════════════════════════════════════
   MAIN 3-COLUMN GRID
══════════════════════════════════════════ */
#main {
  flex: 1; display: grid;
  grid-template-columns: 270px 1fr 270px;
  gap: 10px; padding: 10px;
  overflow: hidden; min-height: 0;
}

/* Scrollable side panels */
.side {
  display: flex; flex-direction: column; gap: 9px;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan-15) transparent;
}

/* ── CARD ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 13px 14px;
  backdrop-filter: blur(22px);
  transition: border-color .3s, box-shadow .3s;
  flex-shrink: 0;
}
.card:hover {
  border-color: var(--border-s);
  box-shadow: 0 0 22px rgba(0,216,255,.08);
}
.ch { /* card header */
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 11px;
}
.ct { /* card title */
  display: flex; align-items: center; gap: 7px;
  font-size: 10px; font-weight: 600;
  color: var(--text2); text-transform: uppercase; letter-spacing: 1.4px;
}
.ct svg { flex-shrink: 0; }
.cbadge {
  font-family: var(--mono); font-size: 8.5px;
  padding: 2px 6px; border-radius: 4px; letter-spacing: .5px;
}
.cb-green { color:var(--green); background:rgba(0,230,118,.09); border:1px solid rgba(0,230,118,.24); }
.cb-hot   { color:#ff6b35;      background:rgba(255,107,53,.09); border:1px solid rgba(255,107,53,.24); }
.cb-gold  { color:var(--gold);  background:rgba(255,169,64,.09); border:1px solid rgba(255,169,64,.24); }

/* ── COIN ROW ── */
.coin-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 6px; border-radius: 7px;
  border-bottom: 1px solid rgba(0,216,255,.04);
  cursor: pointer; transition: background .18s;
}
.coin-row:last-child { border-bottom: none; }
.coin-row:hover { background: rgba(0,216,255,.04); }
.coin-ico {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.coin-info { flex: 1; min-width: 0; }
.coin-name { font-size: 12.5px; font-weight: 600; color: var(--text1); }
.coin-vol  { font-size: 9.5px; color: var(--text2); font-family: var(--mono); }
.vbar { height: 3px; background: rgba(255,255,255,.06); border-radius: 2px; margin-top: 3px; overflow: hidden; }
.vbar-fill { height: 100%; border-radius: 2px; }
.coin-prc  { text-align: right; }
.prc       { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--text1); }
.chg       { font-family: var(--mono); font-size: 9.5px; }
.chg.up    { color: var(--green); }
.chg.dn    { color: var(--red);   }

/* ── GAS FEES ── */
.fee-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fee-box  {
  background: rgba(0,216,255,.04); border: 1px solid rgba(0,216,255,.08);
  border-radius: 8px; padding: 8px 6px; text-align: center;
}
.fee-lbl { font-size: 8.5px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; font-family: var(--mono); margin-bottom: 3px; }
.fee-val { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--cyan); }
.fee-unt { font-size: 7.5px; color: var(--text2); font-family: var(--mono); }

/* ── NEWS ── */
.news-item { padding: 8px 0; border-bottom: 1px solid rgba(0,216,255,.04); cursor: pointer; }
.news-item:last-child { border-bottom: none; }
.news-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.n-src  { font-size: 8.5px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 1px; }
.n-time { font-size: 8.5px; color: var(--text3); font-family: var(--mono); }
.n-dot  { width: 2px; height: 2px; background: var(--text3); border-radius: 50%; }
.n-ttl  { font-size: 11.5px; font-weight: 500; color: var(--text1); line-height: 1.5; transition: color .2s; }
.news-item:hover .n-ttl { color: var(--cyan); }
.n-imp  { display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; font-size: 8.5px; font-family: var(--mono); padding: 2px 6px; border-radius: 3px; }
.imp-bull { color:var(--green); background:rgba(0,230,118,.07); border:1px solid rgba(0,230,118,.18); }
.imp-bear { color:var(--red);   background:rgba(255,61,113,.07); border:1px solid rgba(255,61,113,.18); }
.imp-neut { color:var(--gold);  background:rgba(255,169,64,.07); border:1px solid rgba(255,169,64,.18); }

/* ── DOMINANCE BARS ── */
.dom-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.dom-lbl { font-family: var(--mono); font-size: 9.5px; font-weight: 600; width: 38px; flex-shrink: 0; }
.dom-track { flex: 1; height: 13px; background: rgba(255,255,255,.04); border-radius: 3px; overflow: hidden; }
.dom-fill  { height: 100%; border-radius: 3px; display: flex; align-items: center; justify-content: flex-end; padding-right: 4px; }
.dom-txt   { font-family: var(--mono); font-size: 8px; color: rgba(255,255,255,.85); }

/* ── TRANSFER FEED ── */
.tx-item {
  display: flex; align-items: center; gap: 7px; padding: 5px 7px;
  background: rgba(0,216,255,.03); border: 1px solid rgba(0,216,255,.06);
  border-radius: 6px; margin-bottom: 4px; font-family: var(--mono); font-size: 9.5px;
}
/* only the newest incoming transaction animates in */
.tx-item.tx-new { animation: slide-in .35s ease; }
@keyframes slide-in { from{opacity:0;transform:translateY(-7px) scale(.98)} to{opacity:1;transform:translateY(0) scale(1)} }
.tx-badge { padding: 2px 5px; border-radius: 3px; font-size: 8.5px; font-weight: 700; }
.tx-route { flex: 1; color: var(--text2); }
.tx-amt   { color: var(--cyan); font-weight: 600; }
.tx-ago   { font-size: 8px; color: var(--text3); }

/* ══════════════════════════════════════════
   CENTER MAP PANEL
══════════════════════════════════════════ */
#map-panel {
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  backdrop-filter: blur(22px);
  overflow: hidden;
  position: relative;
}
#map-hdr {
  flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 15px; border-bottom: 1px solid var(--border);
}
.map-title {
  font-size: 9.5px; font-weight: 600; color: var(--text2);
  text-transform: uppercase; letter-spacing: 1.4px;
  display: flex; align-items: center; gap: 7px;
}
.map-stats { display: flex; gap: 20px; }
.ms-val  { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--cyan); line-height: 1; }
.ms-lbl  { font-size: 8px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; font-family: var(--mono); margin-top: 2px; }

#map-wrap { flex: 1; position: relative; overflow: hidden; min-height: 0; }
#world-svg { display: none; }
#arc-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* SVG map styles */
.land   { fill: rgba(0,216,255,.055); stroke: rgba(0,216,255,.14); stroke-width: .45; }
.land:hover { fill: rgba(0,216,255,.11); }
.grat   { fill: none; stroke: rgba(0,216,255,.035); stroke-width: .4; }
.sphere { fill: rgba(0,216,255,.018); stroke: rgba(0,216,255,.06); stroke-width: .6; }
.city-ring { fill: none; stroke: var(--cyan); stroke-width: .8; opacity: .35; animation: c-pulse 3s ease-in-out infinite; }
.city-dot  { fill: var(--cyan); filter: drop-shadow(0 0 5px var(--cyan)); }
.city-lbl  { font: 8px var(--mono); fill: var(--cyan); text-anchor: middle; opacity: .75; pointer-events: none; }
@keyframes c-pulse { 0%,100%{r:9;opacity:.25} 50%{r:5;opacity:.45} }

#map-ftr {
  flex-shrink: 0; padding: 9px 15px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 0; justify-content: space-between;
}
.legend { display: flex; align-items: center; gap: 14px; }
.leg-it { display: flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 9.5px; color: var(--text2); }
.leg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.block-num { font-family: var(--mono); font-size: 9px; color: var(--text3); }
.block-num span { color: var(--cyan); }

/* ── LIVE TRANSFER DETAILS TABLE (under the globe) ── */
#tx-table {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: rgba(2, 9, 22, 0.55);
  display: flex; flex-direction: column;
}
.txt-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 15px 6px;
}
.txt-scroll {
  height: 150px; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin; scrollbar-color: var(--cyan-15) transparent;
  padding: 0 8px 6px;
}
.txt { width: 100%; border-collapse: collapse; table-layout: fixed; }
.txt thead th {
  position: sticky; top: 0; z-index: 2;
  background: rgba(4, 12, 28, 0.96);
  font-family: var(--mono); font-size: 8px; font-weight: 500;
  color: var(--text3); text-transform: uppercase; letter-spacing: 1px;
  text-align: left; padding: 6px 8px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.txt th.r, .txt td.r { text-align: right; }
.txt tbody tr {
  border-bottom: 1px solid rgba(0,216,255,.04);
  transition: background .18s;
}
.txt tbody tr:hover { background: rgba(0,216,255,.04); }
.txt tbody td {
  padding: 6px 8px; font-family: var(--mono); font-size: 10.5px;
  color: var(--text1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.txt-asset { display: inline-flex; align-items: center; gap: 6px; }
.txt-badge {
  width: 19px; height: 19px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700;
}
.txt-city { color: var(--text2); }
.txt-amt  { color: var(--cyan); font-weight: 600; }
.txt-fee  { color: var(--text2); }
.txt-hash { color: var(--text3); }
.txt-age  { color: var(--text3); }
.txt-st { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; }
.txt-st.ok   { color: var(--green); }
.txt-st.pend { color: var(--gold); }
.txt-st .d { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.txt-st.pend .d { animation: ldot 1.2s ease-in-out infinite; }
.txt tbody tr.txt-new td { animation: row-in .4s ease; }
@keyframes row-in { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:translateY(0)} }

/* ══════════════════════════════════════════
   RIGHT PANEL — FOREX
══════════════════════════════════════════ */
.fx-tbl { width: 100%; border-collapse: collapse; }
.fx-tbl tr { border-bottom: 1px solid rgba(0,216,255,.04); cursor: pointer; transition: background .18s; }
.fx-tbl tr:hover { background: rgba(0,216,255,.03); }
.fx-tbl tr:last-child { border-bottom: none; }
.fx-tbl td { padding: 6px 4px; font-size: 11.5px; }
.fx-pair { font-family: var(--mono); font-weight: 600; color: var(--text1); }
.fx-rate { font-family: var(--mono); font-weight: 500; color: var(--text1); text-align: right; }
/* Iran Toman/Rial unit rendered on its own line BELOW the number */
.fx-unit { display: block; font-size: 8.5px; opacity: .5; line-height: 1.1; margin-top: 1px; }
/* Iran unit label on the forex page — Persian "(ریال)/(تومان)" needs the Persian
   webfont (the cell's mono font has no Persian glyphs and falls back ugly). */
.irr-unit { opacity: .5; font-size: 9px; }
body.fa .irr-unit, body.fa .fx-unit { font-family: 'Vazirmatn', sans-serif; font-size: 8.5px; }
.fx-chg  { font-family: var(--mono); font-size: 10px; text-align: right; }
.fx-chg.up { color: var(--green); }
.fx-chg.dn { color: var(--red);   }
.fx-spd  { font-family: var(--mono); font-size: 9px; color: var(--text3); text-align: right; }

/* ── TRANSFER FEE COMPARISON ── */
.fee-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid rgba(0,216,255,.04);
}
.fee-row:last-child { border-bottom: none; }
.fee-bar { width: 3px; height: 30px; border-radius: 2px; flex-shrink: 0; }
.fee-method { font-size: 11.5px; font-weight: 500; color: var(--text1); }
.fee-time   { font-size: 9.5px; color: var(--text2); font-family: var(--mono); }
.fee-cost   { margin-left: auto; font-family: var(--mono); font-size: 13px; font-weight: 700; }

/* ── ECONOMIC CALENDAR ── */
.ec-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid rgba(0,216,255,.04);
  font-size: 10.5px;
}
.ec-row:last-child { border-bottom: none; }
.ec-time  { font-family: var(--mono); font-size: 10px; color: var(--cyan); width: 34px; flex-shrink: 0; }
.ec-flag  { font-size: 13px; flex-shrink: 0; }
.ec-name  { flex: 1; color: var(--text1); font-size: 11px; }
.ec-prev  { font-family: var(--mono); font-size: 9px; color: var(--text3); text-align: right; }
.ec-imp-h { font-size: 8px; font-family: var(--mono); padding: 2px 5px; border-radius: 3px; color: #ff6b35; background: rgba(255,107,53,.09); border: 1px solid rgba(255,107,53,.24); }
.ec-imp-m { font-size: 8px; font-family: var(--mono); padding: 2px 5px; border-radius: 3px; color: var(--gold); background: rgba(255,169,64,.09); border: 1px solid rgba(255,169,64,.24); }

/* ── CRYPTO VS SWIFT ── */
.svs-row {
  display: flex; align-items: center; gap: 5px; padding: 5px 0;
  border-bottom: 1px solid rgba(0,216,255,.04);
  font-family: var(--mono); font-size: 10px;
}
.svs-row:last-child { border-bottom: none; }
.svs-lbl { width: 88px; color: var(--text2); }
.svs-val { flex: 1; text-align: center; padding: 2px 4px; border-radius: 3px; }
.svs-win { color: var(--green); background: rgba(0,230,118,.08); }
.svs-los { color: var(--text2); }

/* ══════════════════════════════════════════
   FOOTER STATUS BAR
══════════════════════════════════════════ */
#ftr {
  flex-shrink: 0; display: flex; align-items: center; flex-wrap: nowrap; overflow: hidden;
  height: 38px; padding: 0 18px;
  background: rgba(3,11,24,.92); border-top: 1px solid var(--border);
  backdrop-filter: blur(24px); gap: 0;
}
.f-stat {
  display: flex; align-items: center; gap: 5px;
  padding: 0 16px; border-right: 1px solid var(--border);
  font-family: var(--mono); font-size: 10px; flex-shrink: 0;
}
.f-stat:last-of-type { border-right: none; }
.f-lbl { color: var(--text3); text-transform: uppercase; letter-spacing: .8px; font-size: 8.5px; }
.f-val { color: var(--text1); font-weight: 600; }
.f-val.up { color: var(--green); }
.f-val.dn { color: var(--red);   }
.f-val.cy { color: var(--cyan);  }

/* copyright — pushed to the far right of the status bar */
.f-copy {
  margin-left: auto; padding: 0 2px 0 18px;
  font-family: var(--mono); font-size: 9px; letter-spacing: .7px;
  color: var(--text3); white-space: nowrap; flex-shrink: 0;
}
.f-copy .brand {
  font-weight: 700;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.f-copy .sym { color: var(--cyan); }
/* Persian: keep the copyright pinned to the RIGHT corner. In RTL the footer's
   last item would land at the left edge (and clip off-screen when the status
   bar overflows), so make it the first flex item — RTL then places it flush
   right — and flip its padding/divider to match. */
body.fa .f-copy {
  order: -1; margin-left: 0; margin-right: 0;
  padding: 0 18px 0 2px;
  border-left: 1px solid var(--border);
}

/* ══════════════════════════════════════════
   TOOLTIP
══════════════════════════════════════════ */
#tip {
  position: fixed; z-index: 9999;
  background: rgba(5,15,35,.97); border: 1px solid var(--border-s);
  border-radius: 8px; padding: 8px 12px;
  font-family: var(--mono); font-size: 10.5px; color: var(--text1);
  pointer-events: none; display: none;
  box-shadow: 0 0 24px rgba(0,216,255,.18);
}

/* ═══════════════════════════════════════════════════════
   NAVIGATION (shared across pages)
═══════════════════════════════════════════════════════ */
.nav { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.nav a {
  font-size: 11px; font-weight: 600; letter-spacing: .4px;
  color: var(--text2); text-decoration: none;
  padding: 6px 12px; border-radius: 7px;
  border: 1px solid transparent; transition: all .18s; white-space: nowrap;
}
.nav a:hover { color: var(--text1); background: rgba(0,216,255,.06); }
.nav a.active {
  color: var(--cyan); background: rgba(0,216,255,.08);
  border-color: var(--border-s);
}

/* ═══════════════════════════════════════════════════════
   FULL PAGES (crypto.html / forex.html)
═══════════════════════════════════════════════════════ */
.page {
  flex: 1; overflow-y: auto; overflow-x: hidden; min-height: 0;
  padding: 12px; scrollbar-width: thin; scrollbar-color: var(--cyan-15) transparent;
}
.page-grid {
  display: grid; grid-template-columns: 1fr 330px; gap: 12px;
  max-width: 1500px; margin: 0 auto;
}
@media (max-width: 1100px) { .page-grid { grid-template-columns: 1fr; } }

.panel, .panel-side {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r); backdrop-filter: blur(22px);
  overflow: hidden; align-self: start;
}
.panel-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(4,12,28,.92); z-index: 5;
}
.panel-h h2 {
  font-size: 12px; font-weight: 600; color: var(--text1);
  text-transform: uppercase; letter-spacing: 1.4px;
  display: flex; align-items: center; gap: 8px;
}
.panel-h .sub { font-family: var(--mono); font-size: 9.5px; color: var(--text3); }

/* full data table */
.fulltbl { width: 100%; border-collapse: collapse; }
.fulltbl thead th {
  position: sticky; top: 0; z-index: 4;
  background: rgba(4,12,28,.96);
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  color: var(--text3); text-transform: uppercase; letter-spacing: 1px;
  text-align: right; padding: 9px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--border); cursor: default;
}
.fulltbl thead th.l { text-align: left; }
.fulltbl tbody tr { border-bottom: 1px solid rgba(0,216,255,.045); transition: background .15s; }
.fulltbl tbody tr:hover { background: rgba(0,216,255,.04); }
.fulltbl tbody td {
  padding: 10px 12px; font-family: var(--mono); font-size: 12px;
  color: var(--text1); text-align: right; white-space: nowrap;
}
.fulltbl tbody td.l { text-align: left; }
.fulltbl .rank { color: var(--text3); font-size: 10px; width: 34px; }
.fulltbl .asset { display: flex; align-items: center; gap: 10px; }
.fulltbl .ico {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.fulltbl .a-name { font-family: var(--sans); font-weight: 600; font-size: 12.5px; color: var(--text1); }
.fulltbl .a-sym  { font-size: 9.5px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }
.fulltbl .flag { font-size: 18px; }
.up  { color: var(--green) !important; }
.dn  { color: var(--red)   !important; }
.cyv { color: var(--cyan)  !important; }
.pill {
  display: inline-block; padding: 2px 7px; border-radius: 5px;
  font-size: 10.5px; font-weight: 600;
}
.pill.up { background: rgba(0,230,118,.10); }
.pill.dn { background: rgba(255,61,113,.10); }

/* news column on pages */
.news-full { padding: 6px 14px 14px; }
.news-full .news-item { padding: 11px 0; }
.news-full .n-ttl { font-size: 12.5px; }

/* search box */
.tbl-search {
  background: rgba(0,216,255,.05); border: 1px solid var(--border-s);
  border-radius: 7px; padding: 6px 11px; color: var(--text1);
  font-family: var(--mono); font-size: 11px; width: 190px; outline: none;
}
.tbl-search::placeholder { color: var(--text3); }
.tbl-search:focus { border-color: var(--cyan); }

/* loading shimmer row */
.loading-row td { color: var(--text3); text-align: center !important; padding: 28px !important; font-family: var(--mono); font-size: 11px; }

/* ── Forex page: major-pair quick strip ── */
.majors-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 9px; max-width: 1500px; margin: 0 auto 12px;
}
.major-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--rs); padding: 11px 13px; backdrop-filter: blur(18px);
  transition: border-color .25s, box-shadow .25s;
}
.major-card:hover { border-color: var(--border-s); box-shadow: 0 0 18px rgba(0,216,255,.08); }
.mp-pair { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--text2); letter-spacing: .5px; }
.mp-rate { font-family: var(--mono); font-size: 18px; font-weight: 700; color: var(--text1); margin: 3px 0 2px; }
.mp-chg  { font-family: var(--mono); font-size: 10.5px; font-weight: 600; }
.ccode {
  font-family: var(--mono); font-size: 10px; color: var(--cyan);
  background: rgba(0,216,255,.07); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 4px; letter-spacing: .5px;
}

/* ═══════════════════════════════════════════════════════════════════
   WEB3 PROFESSIONAL POLISH  (layered last — elevates all pages)
   Glassmorphism · gradient accents · premium micro-interactions
═══════════════════════════════════════════════════════════════════ */

/* refined text selection + smooth scroll */
::selection { background: rgba(0,216,255,.28); color: #eaf8ff; }
html { scroll-behavior: smooth; }

/* tabular figures everywhere numbers matter (pro finance alignment) */
.mono, [class*="prc"], [class*="-val"], [class*="-rate"], [class*="-amt"],
.fulltbl td, .txt td, .ms-val, .coin-prc, .t-prc, .mp-rate, .fx-rate {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "cv01" 1;
}

/* keyboard focus ring (accessibility + polish) */
a:focus-visible, input:focus-visible, button:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px;
}

/* ── Glassmorphism upgrade for all surfaces ── */
.card, #map-panel, .panel, .panel-side, .major-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(12,26,52,.55) 0%, rgba(4,12,28,.5) 100%),
    var(--bg-card);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 8px 30px rgba(0,0,0,.28);
}

/* signature gradient accent line along the top edge */
.card::before, .panel::before, .panel-side::before, #map-panel::before {
  content: ''; position: absolute; top: 0; left: 14px; right: 14px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,216,255,.55) 30%, rgba(123,47,255,.55) 70%, transparent);
  opacity: .55; pointer-events: none; z-index: 2;
}

/* premium hover: lift + dual-tone glow */
.card { transition: transform .28s cubic-bezier(.2,.7,.3,1), border-color .28s, box-shadow .28s; }
.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-s);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    0 10px 34px rgba(0,0,0,.34),
    0 0 30px rgba(0,216,255,.10);
}
.major-card { transition: transform .28s cubic-bezier(.2,.7,.3,1), border-color .28s, box-shadow .28s; }
.major-card:hover { transform: translateY(-3px); }

/* hero map panel — breathing dual-tone aura */
#map-panel {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 0 0 1px rgba(0,216,255,.05),
    0 12px 44px rgba(0,0,0,.4),
    0 0 46px rgba(0,216,255,.06);
  animation: panelAura 7s ease-in-out infinite;
}
@keyframes panelAura {
  0%,100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 44px rgba(0,0,0,.4), 0 0 40px rgba(0,216,255,.05); }
  50%     { box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 12px 44px rgba(0,0,0,.4), 0 0 60px rgba(123,47,255,.10); }
}

/* card titles: glowing icon + gradient hairline under title */
.ct svg, .map-title svg, .panel-h h2 svg { filter: drop-shadow(0 0 5px rgba(0,216,255,.4)); }

/* hero stat numbers get a soft glow */
.ms-val { text-shadow: 0 0 14px rgba(0,216,255,.35); }

/* ── List-row micro-interactions: left accent bar + sweep ── */
.coin-row, .fx-rate, .news-item, .tx-item, .dom-row { position: relative; }
.coin-row::before, .news-item::before {
  content: ''; position: absolute; left: -14px; top: 6px; bottom: 6px; width: 2px;
  border-radius: 2px; background: linear-gradient(180deg, var(--cyan), var(--purple));
  transform: scaleY(0); transform-origin: center; transition: transform .22s ease; opacity: .9;
}
.coin-row:hover::before, .news-item:hover::before { transform: scaleY(1); }
.coin-row:hover, .news-item:hover {
  background: linear-gradient(90deg, rgba(0,216,255,.06), transparent 80%);
}

/* full-page table rows: left accent on hover */
.fulltbl tbody tr { position: relative; }
.fulltbl tbody tr:hover {
  background: linear-gradient(90deg, rgba(0,216,255,.06), transparent 70%);
  box-shadow: inset 2px 0 0 var(--cyan);
}
.txt tbody tr:hover { box-shadow: inset 2px 0 0 var(--cyan); }

/* ── Navigation: gradient active state + glow ── */
.nav a { position: relative; }
.nav a.active {
  background: linear-gradient(135deg, rgba(0,216,255,.14), rgba(123,47,255,.14));
  border-color: rgba(0,216,255,.35);
  box-shadow: 0 0 18px rgba(0,216,255,.14), inset 0 1px 0 rgba(255,255,255,.06);
  color: #d6f3ff;
}
.nav a.active::after {
  content: ''; position: absolute; left: 14%; right: 14%; bottom: 3px; height: 2px;
  border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--purple));
}

/* wordmark: cyan→purple gradient, matching the footer brand */
.logo-txt {
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* live indicators: refined breathing glow */
.live-dot, .badge-live, .cbadge.cb-green {
  box-shadow: 0 0 0 0 rgba(0,230,118,.5);
}
.badge-live { animation: liveBreathe 2.4s ease-in-out infinite; }
@keyframes liveBreathe {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,230,118,.0); }
  50%     { box-shadow: 0 0 14px 0 rgba(0,230,118,.28); }
}

/* badges & pills: subtle inset highlight */
.cbadge, .pill, .txt-badge, .ccode { box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }

/* gradient scrollbar thumb */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0,216,255,.35), rgba(123,47,255,.35));
  border-radius: 4px;
}

/* search input focus glow */
.tbl-search:focus { box-shadow: 0 0 0 3px rgba(0,216,255,.12); }

/* honour reduced-motion */
@media (prefers-reduced-motion: reduce) {
  #map-panel { animation: none; }
  .badge-live { animation: none; }
  html { scroll-behavior: auto; }
  .card:hover, .major-card:hover { transform: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE  —  desktop grid → scrolling stacked layout
   Breakpoints: 1024 (tablet) · 768 (large phone) · 480 (phone)
═══════════════════════════════════════════════════════════════════ */

/* ───────────── Tablet & below: the page scrolls, panels stack ───────────── */
@media (max-width: 1024px) {
  html, body { height: auto; overflow-x: hidden; overflow-y: auto; }
  #app { height: auto; min-height: 100dvh; overflow: visible; }

  #main {
    display: flex; flex-direction: column;
    overflow: visible; gap: 12px; padding: 12px;
  }

  /* globe leads as the hero */
  #map-panel { order: -1; height: auto; }
  #map-wrap  { height: 52vh; min-height: 380px; }

  /* sidebars become balanced masonry card columns */
  .side {
    display: block; overflow: visible;
    column-count: 2; column-gap: 12px;
  }
  .side > .card { break-inside: avoid; margin-bottom: 12px; }

  .logo-sub { display: none; }

  /* footer scrolls sideways instead of clipping */
  #ftr { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }

  /* sub-pages: let the document scroll naturally */
  .page { overflow: visible; }
}

/* ───────────── Large phones / portrait tablet ───────────── */
@media (max-width: 768px) {
  #hdr { height: auto; min-height: 52px; flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; }
  .logo       { order: 1; }
  .hdr-right  { order: 2; margin-left: auto; }
  .nav        { order: 3; flex-basis: 100%; }
  .ticker-wrap{ order: 4; flex-basis: 100%; height: 24px; }
  /* hide the flex spacer used on sub-page headers so wrapping stays clean */
  #hdr > div[style*="flex:1"] { display: none; }
  /* declutter the header: both "live" chips are redundant on mobile (every data
     panel shows its own LIVE/STREAMING badge). Dropping them lets the logo +
     language switcher + clock sit on ONE clean row instead of a floating block. */
  .hdr-right .live-badge { display: none; }
  .logo .badge-live { display: none; }
  .hdr-right { gap: 10px; align-items: center; }

  .side { column-count: 1; }                 /* single column of cards */
  #map-wrap { height: 46vh; min-height: 340px; }
  .map-stats { display: none; }              /* declutter the map header */
  .map-title { font-size: 9px; }

  /* wide data table under the globe scrolls horizontally */
  .txt-scroll { overflow-x: auto; }
  .txt { min-width: 660px; }

  .page { padding: 10px; }
  .page-grid { gap: 10px; }
}

/* ───────────── Phones ───────────── */
@media (max-width: 480px) {
  body { font-size: 12px; }
  .ticker-wrap { display: none; }            /* hide ticker on small phones */
  .nav { gap: 3px; }
  .nav a { padding: 5px 9px; font-size: 10px; }
  .logo-txt { font-size: 13px; }
  .logo-hex { width: 30px; height: 30px; font-size: 14px; }
  .utc-clock { font-size: 9px; }

  #map-wrap { height: 42vh; min-height: 290px; }
  .card { padding: 11px 12px; }

  /* full-page tables denser + smaller icons */
  .fulltbl thead th, .fulltbl tbody td { padding: 8px 9px; font-size: 11px; }
  .fulltbl .ico { width: 22px; height: 22px; font-size: 11px; }
  .panel-h { padding: 11px 13px; flex-wrap: wrap; gap: 8px; }
  .panel-h h2 { font-size: 11px; }
  .tbl-search { width: 100%; }
  .majors-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ───────────── Landscape phones: keep the globe usable ───────────── */
@media (max-width: 920px) and (orientation: landscape) and (max-height: 560px) {
  #map-wrap { height: 78vh; min-height: 260px; }
}

/* ═══════════════════════════════════════════════════════════════════
   ASSET ANALYSIS CHART MODAL
═══════════════════════════════════════════════════════════════════ */
.chart-modal {
  position: fixed; inset: 0; z-index: 1000; display: none;
  align-items: center; justify-content: center; padding: 16px;
  background: rgba(2,6,16,.74); backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
}
.chart-modal.open { display: flex; animation: cmFade .2s ease; }
@keyframes cmFade { from { opacity: 0; } to { opacity: 1; } }

.cm-card {
  position: relative; width: min(740px, 96vw);
  background: linear-gradient(180deg, rgba(12,26,52,.92), rgba(4,12,28,.94));
  border: 1px solid var(--border-s); border-radius: 16px;
  padding: 20px; backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 60px rgba(0,216,255,.08), inset 0 1px 0 rgba(255,255,255,.06);
  animation: cmPop .26s cubic-bezier(.2,.8,.3,1);
}
@keyframes cmPop { from { transform: translateY(14px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }

.cm-close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  border: 1px solid var(--border); background: rgba(255,255,255,.04);
  color: var(--text2); border-radius: 8px; font-size: 20px; line-height: 1;
  cursor: pointer; transition: all .18s;
}
.cm-close:hover { color: #fff; border-color: var(--border-s); background: rgba(0,216,255,.08); }

.cm-head { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; padding-right: 34px; }
.cm-ico {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
}
.cm-titles { flex: 1; min-width: 0; }
.cm-name { font-size: 18px; font-weight: 700; color: var(--text1); letter-spacing: .3px; }
.cm-sub  { font-size: 10px; color: var(--text3); font-family: var(--mono); letter-spacing: .5px; margin-top: 2px; }
.cm-pricebox { text-align: right; }
.cm-val { font-family: var(--mono); font-size: 19px; font-weight: 700; color: var(--text1); }
.cm-chg { font-family: var(--mono); font-size: 12px; font-weight: 600; margin-top: 2px; }
.cm-chg.up { color: var(--green); } .cm-chg.dn { color: var(--red); }

.cm-controls {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.cm-modes { display: flex; flex-shrink: 0;
  border: 1px solid var(--border-s); border-radius: 8px; overflow: hidden; }
.cm-mode {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--text2); background: rgba(255,255,255,.02);
  border: none; padding: 6px 12px; cursor: pointer; transition: all .18s;
}
.cm-mode:hover { color: var(--text1); }
.cm-mode.active { color: var(--cyan); background: linear-gradient(135deg, rgba(0,216,255,.16), rgba(123,47,255,.12)); }
.cm-mode.cm-disabled { opacity: .35; pointer-events: none; }

.cm-ranges { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; min-width: 0; }
.cm-range {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--text2); background: rgba(255,255,255,.03);
  border: 1px solid var(--border); border-radius: 6px; padding: 5px 9px; cursor: pointer; transition: all .15s;
}
.cm-range:hover { color: var(--text1); border-color: var(--border-s); }
.cm-range.active {
  color: var(--cyan); background: linear-gradient(135deg, rgba(0,216,255,.14), rgba(123,47,255,.12));
  border-color: rgba(0,216,255,.4); box-shadow: 0 0 12px rgba(0,216,255,.12);
}

.cm-chartwrap { position: relative; width: 100%; height: 300px; }
#cm-canvas { width: 100%; height: 100%; display: block; }
.cm-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; color: var(--text2);
  background: rgba(4,12,28,.4); border-radius: 8px;
}

.cm-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px;
  padding-top: 14px; border-top: 1px solid var(--border);
}
.cm-stat { text-align: center; }
.cm-k { font-size: 8.5px; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; font-family: var(--mono); }
.cm-v { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text1); margin-top: 4px; }
.cm-note { grid-column: 1 / -1; text-align: center; color: var(--text3); font-family: var(--mono); font-size: 11px; padding: 4px; }

/* clickable affordance for assets */
.coin-row, .fulltbl tbody tr, #fx-rates tbody tr, .major-card { cursor: pointer; }

@media (max-width: 560px) {
  .cm-card { padding: 16px; }
  .cm-chartwrap { height: 230px; }
  .cm-stats { grid-template-columns: repeat(2, 1fr); }
  .cm-name { font-size: 16px; } .cm-val { font-size: 16px; }
}

/* ── TradingView pro-chart variant of the modal ── */
.cm-card-tv { width: min(1120px, 96vw); }
.cm-tvbadge {
  font-family: var(--mono); font-size: 9px; color: var(--cyan);
  background: rgba(0,216,255,.08); border: 1px solid var(--border-s);
  border-radius: 5px; padding: 4px 9px; display: inline-flex; align-items: center; gap: 4px;
  margin-left: 10px; white-space: nowrap; flex-shrink: 0;
}
.cm-tv {
  width: 100%; height: min(70vh, 560px);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: #0a1530;
}
.cm-tv iframe { border-radius: 10px; }
@media (max-width: 560px) {
  .cm-tv { height: 64vh; }
  .cm-tvbadge { display: none !important; }
}

/* TradingView mode: no transform animation (lets the widget measure correctly) */
.cm-card-tv { animation: none; }

/* engine switch button (TradingView ⇄ built-in) */
.cm-switch {
  font-family: var(--mono); font-size: 9.5px; color: var(--text2);
  background: rgba(255,255,255,.04); border: 1px solid var(--border-s);
  border-radius: 6px; padding: 5px 9px; cursor: pointer; transition: all .18s;
  margin-left: 8px; white-space: nowrap; flex-shrink: 0;
}
.cm-switch:hover { color: var(--cyan); border-color: var(--cyan); background: rgba(0,216,255,.08); }
@media (max-width: 560px) { .cm-switch { font-size: 9px; padding: 4px 7px; } }

/* ── Forex pairs board: category tabs + pair flags ── */
.pair-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 50px; z-index: 4; background: rgba(4,12,28,.92);
}
.ptab {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--text2); background: rgba(255,255,255,.03);
  border: 1px solid var(--border); border-radius: 7px; padding: 5px 12px; cursor: pointer; transition: all .15s;
}
.ptab:hover { color: var(--text1); border-color: var(--border-s); }
.ptab.active {
  color: var(--cyan); background: linear-gradient(135deg, rgba(0,216,255,.14), rgba(123,47,255,.12));
  border-color: rgba(0,216,255,.4); box-shadow: 0 0 12px rgba(0,216,255,.12);
}
.pair-flags { font-size: 15px; letter-spacing: -2px; white-space: nowrap; }
@media (max-width: 1024px) { .pair-tabs { position: static; } }

/* ── dual clock: location-based local time + UTC ── */
.clock-box { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; line-height: 1.25; }
.clk-local {
  font-family: var(--mono); font-size: 11px; color: var(--text1); white-space: nowrap;
}
.clk-zone {
  color: var(--cyan); font-size: 8.5px; letter-spacing: .6px; text-transform: uppercase;
  margin-right: 3px;
}
.clock-box .utc-clock { font-size: 9.5px; color: var(--text3); }
@media (max-width: 480px) {
  .clk-local { font-size: 10px; }
  .clock-box .utc-clock { font-size: 8.5px; }
}

/* ═══════════════════════════════════════════════════════
   NEWS PAGE — crypto + forex columns with thumbnails
═══════════════════════════════════════════════════════ */
.news-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  max-width: 1500px; margin: 0 auto;
}
@media (max-width: 1024px) { .news-grid { grid-template-columns: 1fr; } }

.news-cards { padding: 6px 12px 14px; }
.news-loading { padding: 30px; text-align: center; color: var(--text3); font-family: var(--mono); font-size: 11px; }

.news-card {
  display: flex; gap: 13px; padding: 13px 6px; cursor: pointer;
  border-bottom: 1px solid rgba(0,216,255,.05); transition: background .15s; position: relative;
}
.news-card:hover { background: linear-gradient(90deg, rgba(0,216,255,.05), transparent 80%); }
.news-card::before {
  content: ''; position: absolute; left: -6px; top: 10px; bottom: 10px; width: 2px;
  border-radius: 2px; background: linear-gradient(180deg, var(--cyan), var(--purple));
  transform: scaleY(0); transform-origin: center; transition: transform .2s ease;
}
.news-card:hover::before { transform: scaleY(1); }

.nc-thumb {
  width: 96px; height: 70px; border-radius: 9px; flex-shrink: 0;
  background-size: cover; background-position: center;
  border: 1px solid var(--border); background-color: rgba(0,216,255,.04);
}
.nc-thumb-ph { background: linear-gradient(135deg, rgba(0,216,255,.20), rgba(123,47,255,.20)); }

.nc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nc-meta {
  display: flex; align-items: center; gap: 6px; margin-bottom: 5px;
  font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: .6px;
}
.nc-src { font-weight: 700; }
.nc-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text3); }
.nc-time { color: var(--text3); }
.nc-title { font-size: 13.5px; font-weight: 600; color: var(--text1); line-height: 1.42; margin-bottom: 7px; }
.news-card:hover .nc-title { color: #fff; }
.nc-body .n-imp { align-self: flex-start; margin-top: auto; }

@media (max-width: 480px) {
  .nc-thumb { width: 76px; height: 58px; }
  .nc-title { font-size: 12.5px; }
}

/* news thumbnail fallbacks: forex flag tile + crypto glyph tile */
.nc-thumb-fx, .nc-thumb-cx {
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.nc-thumb-fx { background: linear-gradient(135deg, rgba(255,169,64,.18), rgba(123,47,255,.16)); }
.nc-thumb-cx { background: linear-gradient(135deg, rgba(0,216,255,.20), rgba(123,47,255,.18)); }
.nc-flag { font-size: 30px; letter-spacing: -3px; line-height: 1; filter: drop-shadow(0 2px 5px rgba(0,0,0,.45)); }
.nc-thumb-cx .nc-flag { font-size: 30px; color: var(--gold); letter-spacing: 0; }
@media (max-width: 480px) { .nc-flag { font-size: 24px; } }

/* real news image (with onerror glyph fallback) fills the thumb tile */
.nc-thumb-img { padding: 0; overflow: hidden; }
.nc-thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── real-time price flash (green up / red down for ~1s) ──
   strong, unmistakable tick: bold colour + glowing pill background that
   fades back out over ~1s. Applied to any price cell that changes value. */
@keyframes flashUp {
  0%   { color: var(--green); background: rgba(0,230,118,.30); box-shadow: 0 0 0 1px rgba(0,230,118,.55), 0 0 12px rgba(0,230,118,.45); }
  35%  { color: var(--green); background: rgba(0,230,118,.20); }
  100% { color: inherit;      background: transparent;         box-shadow: none; }
}
@keyframes flashDown {
  0%   { color: var(--red); background: rgba(255,61,113,.30); box-shadow: 0 0 0 1px rgba(255,61,113,.55), 0 0 12px rgba(255,61,113,.45); }
  35%  { color: var(--red); background: rgba(255,61,113,.20); }
  100% { color: inherit;    background: transparent;         box-shadow: none; }
}
.flash-up, .flash-down {
  border-radius: 6px;
  font-weight: 700;
}
.flash-up   { animation: flashUp   1s ease-out; }
.flash-down { animation: flashDown 1s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .flash-up, .flash-down { animation: none; }
  .flash-up   { color: var(--green) !important; }
  .flash-down { color: var(--red)   !important; }
}

/* ── animated logo: trend line draws up + arrowhead pops (professional, looping) ── */
.logo-hex .lg-trend {
  stroke-dasharray: 23;
  animation: lgDraw 3.4s cubic-bezier(.65,0,.35,1) infinite;
  filter: drop-shadow(0 0 1.6px rgba(0,216,255,.6));
}
.logo-hex .lg-head {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: lgHead 3.4s cubic-bezier(.65,0,.35,1) infinite;
  filter: drop-shadow(0 0 1.6px rgba(123,47,255,.6));
}
@keyframes lgDraw {
  0%   { stroke-dashoffset: 23; opacity: 0; }
  12%  { opacity: 1; }
  46%  { stroke-dashoffset: 0;  opacity: 1; }
  80%  { stroke-dashoffset: 0;  opacity: 1; }
  93%  { stroke-dashoffset: 0;  opacity: 0; }
  100% { stroke-dashoffset: 23; opacity: 0; }
}
@keyframes lgHead {
  0%, 44%  { opacity: 0; transform: scale(.45); }
  54%      { opacity: 1; transform: scale(1); }
  80%      { opacity: 1; transform: scale(1); }
  93%,100% { opacity: 0; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-hex .lg-trend, .logo-hex .lg-head { animation: none; opacity: 1; stroke-dashoffset: 0; }
}

/* ── language switch (EN/FA) ── */
.lang-sw {
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,216,255,.06); color: var(--text2);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 11px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .5px;
  transition: border-color .2s, color .2s, background .2s;
}
.lang-sw:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(0,216,255,.12); }
.lang-sw span { line-height: 1; }

/* ── Persian mode (body.fa): Vazirmatn for text; numbers stay mono/Latin.
     Layout direction is unchanged so the globe & grids are untouched. ── */
body.fa, body.fa .nav a, body.fa .ct, body.fa .panel-h h2, body.fa .f-lbl,
body.fa .ms-lbl, body.fa .ptab, body.fa .map-title, body.fa th,
body.fa .a-name, body.fa .a-sym, body.fa .fee-method, body.fa .fee-time,
body.fa .logo-sub, body.fa .n-ttl, body.fa .nc-title {
  font-family: 'Vazirmatn', 'Space Grotesk', sans-serif;
}
/* Persian headlines read right-to-left */
body.fa .n-ttl, body.fa .nc-title, body.fa .news-item .n-ttl {
  direction: rtl; text-align: right; line-height: 1.7;
}
body.fa .news-meta { justify-content: flex-end; }

/* ── segmented language switcher (both languages visible; active outlined) ── */
.lang-sw {
  display: flex; align-items: center; gap: 3px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 3px;
}
.lang-sw .lang-opt {
  display: flex; align-items: center; gap: 5px;
  background: transparent; color: var(--text3);
  border: 1px solid transparent; border-radius: 6px;
  padding: 4px 10px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .4px;
  transition: color .2s, border-color .2s, background .2s, box-shadow .2s;
}
.lang-sw .lang-opt:hover { color: var(--text1); }
.lang-sw .lang-opt.on {
  color: var(--cyan);
  background: rgba(0,216,255,.07);
  border-color: rgba(0,216,255,.45);              /* the light line around the active language */
  box-shadow: 0 0 7px rgba(0,216,255,.18), inset 0 0 5px rgba(0,216,255,.05);
  cursor: default;
}

/* ── full RTL layout in Persian mode (html[dir=rtl] flips flex/grid/tables);
      numbers, the ticker marquee and the GLOBE stay LTR so nothing breaks ── */
body.fa .ticker-wrap, body.fa .ticker { direction: ltr; }          /* marquee keeps scrolling correctly */
body.fa #map-wrap { direction: ltr; }                              /* globe container — system untouched */
body.fa .cm-chartwrap, body.fa #cm-canvas { direction: ltr; }      /* chart canvas */
body.fa .prc, body.fa .px-cell, body.fa .fx-rate, body.fa .t-prc, body.fa .t-chg,
body.fa .ms-val, body.fa .f-val, body.fa .cm-val, body.fa .cm-chg, body.fa .cm-price,
body.fa .txt-amt, body.fa .txt-fee, body.fa .txt-hash, body.fa .txt-age,
body.fa .mp-rate, body.fa .mp-chg, body.fa .ec-prev, body.fa .ec-time,
body.fa .clk-local, body.fa .utc-clock, body.fa .chg, body.fa .coin-vol,
body.fa .fx-chg, body.fa .fx-spd, body.fa .pill, body.fa .n-time, body.fa .nc-time,
body.fa .fee-cost, body.fa .fee-val, body.fa .dom-txt, body.fa .rank, body.fa .cyv,
body.fa .irr-amt {
  direction: ltr; unicode-bidi: isolate;
}
/* mirrored table alignment: label columns hug the right edge in RTL */
body.fa th.l, body.fa td.l { text-align: right; }
body.fa .news-meta { justify-content: flex-start; }

/* ── clock: internally LTR but LEFT-aligned in Persian RTL mode ──
   bidi-isolate each line so Persian zone label + Latin/Persian time render
   in a deterministic "زون  زمان" order, both rows flush to the left edge. */
body.fa .clock-box { direction: ltr; align-items: flex-start; text-align: left; }
body.fa .clk-local, body.fa .utc-clock {
  direction: ltr; unicode-bidi: isolate; text-align: left;
}
body.fa .clk-zone {
  unicode-bidi: isolate; margin-right: 4px; margin-left: 0; display: inline-block;
}
/* Persian, wrapped header (≤768px): pin the clock group to the LEFT corner.
   In LTR the wrapped layout pushes .hdr-right right (margin-left:auto); in RTL
   we mirror that so the clock sits flush in the physical left corner. */
@media (max-width: 768px) {
  body.fa .hdr-right { margin-left: 0; margin-right: auto; }
}
