/* ════════════════════════════════════════════════════════════════
   غني — CASE v2  ·  "Trading Cockpit"
   Dark obsidian command center · gold = wealth · cyan = live signal
   Self-hosted Noto (Kufi display / Sans body) · CSP-safe · RTL-first
═══════════════════════════════════════════════════════════════════ */

/* ── Fonts (self-hosted, no CDN) ── */
@font-face {
  font-family: 'GhaniSans';
  src: url('../fonts/NotoSansArabic-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'GhaniSans';
  src: url('../fonts/NotoSansArabic-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'GhaniKufi';
  src: url('../fonts/NotoKufiArabic-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  /* ── ink / surfaces ── */
  --ink-0:   #06080f;   /* deepest page base */
  --ink-1:   #0a0e1a;   /* page bg */
  --ink-2:   #0e1422;   /* panel */
  --ink-3:   #131b2e;   /* raised panel / tile */
  --ink-4:   #1a2438;   /* hover / input */
  --ink-5:   #222e46;   /* border-strong / chip */
  --line:    rgba(140,160,200,.10);
  --line-2:  rgba(140,160,200,.18);

  /* ── text ── */
  --tx:      #e8edf7;
  --tx-2:    #aab6cf;
  --tx-3:    #6b7896;   /* muted */
  --tx-faint:#48536e;

  /* ── brand: gold (wealth) + cyan (live) ── */
  --gold:    #f0b54a;
  --gold-2:  #e89a2c;
  --gold-dim:rgba(240,181,74,.13);
  --cyan:    #38d4d0;
  --cyan-2:  #2aa8c4;
  --cyan-dim:rgba(56,212,208,.12);

  /* ── semantic ── */
  --up:      #3ddc97;   /* green / profit */
  --up-dim:  rgba(61,220,151,.12);
  --down:    #ff5d6c;   /* red / loss */
  --down-dim:rgba(255,93,108,.12);
  --warn:    #ffa94d;
  --warn-dim:rgba(255,169,77,.13);
  --violet:  #9d8cff;   /* macro / accents */
  --violet-dim:rgba(157,140,255,.12);

  --r-lg:    20px;
  --r-md:    14px;
  --r-sm:    10px;
  --shadow:  0 1px 0 rgba(255,255,255,.03) inset, 0 18px 50px -24px rgba(0,0,0,.9);
  --shadow-sm: 0 8px 24px -16px rgba(0,0,0,.8);
  --glow-gold: 0 0 0 1px rgba(240,181,74,.25), 0 8px 32px -12px rgba(240,181,74,.35);
  --grid-w:  1340px;

  --ff-body: 'GhaniSans', 'Segoe UI', system-ui, sans-serif;
  --ff-disp: 'GhaniKufi', 'GhaniSans', system-ui, sans-serif;
  /* tabular figures for prices/tokens */
  --ff-num:  'GhaniSans', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { max-width: 100vw; overflow-x: hidden; }

body {
  font-family: var(--ff-body);
  color: var(--tx);
  background: var(--ink-1);
  background-image:
    radial-gradient(1100px 620px at 88% -8%, rgba(240,181,74,.07), transparent 60%),
    radial-gradient(900px 600px at 6% 4%, rgba(56,212,208,.06), transparent 58%),
    radial-gradient(1200px 900px at 50% 120%, rgba(157,140,255,.05), transparent 60%),
    linear-gradient(180deg, var(--ink-0), var(--ink-1) 30%);
  background-attachment: fixed;
  min-height: 100vh;
  direction: rtl;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .1px;
}
::selection { background: rgba(240,181,74,.28); color: #fff; }

/* faint dot-grid texture over the whole page */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(150,170,210,.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 80%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-5); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-2); background-clip: content-box; }
* { scrollbar-width: thin; scrollbar-color: var(--ink-5) transparent; }

/* numbers: tabular + a touch wider for legibility of Arabic-Indic digits */
.num { font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums; }

/* ══════════════════ AUTH GATE ══════════════════ */
#gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(240,181,74,.10), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(56,212,208,.07), transparent 60%),
    var(--ink-0);
}
.gate-card {
  position: relative; width: 340px; max-width: 100%;
  background: linear-gradient(180deg, rgba(20,28,46,.9), rgba(12,17,28,.92));
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: 38px 34px 30px; text-align: center;
  box-shadow: var(--shadow), var(--glow-gold);
  backdrop-filter: blur(10px);
}
.gate-mark {
  width: 70px; height: 70px; margin: 0 auto 18px; border-radius: 18px;
  display: grid; place-items: center;
  background: radial-gradient(120% 120% at 30% 20%, rgba(240,181,74,.22), rgba(20,28,46,.6));
  border: 1px solid rgba(240,181,74,.3);
  box-shadow: 0 10px 30px -10px rgba(240,181,74,.5);
}
.gate-mark img { width: 48px; height: 48px; }
.gate-title { font-family: var(--ff-disp); font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.gate-sub { font-size: 12.5px; color: var(--tx-3); margin: 5px 0 24px; }
.gate-input {
  width: 100%; padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--ink-1); border: 1px solid var(--line-2); color: var(--tx);
  font: 700 22px var(--ff-num); text-align: center; letter-spacing: 10px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.gate-input::placeholder { color: var(--tx-faint); letter-spacing: 8px; }
.gate-input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-dim); }
.gate-btn {
  width: 100%; margin-top: 14px; padding: 13px; border: none; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #1a1304;
  font-size: 15px; font-weight: 700; letter-spacing: .3px;
  transition: transform .12s, box-shadow .2s; box-shadow: 0 10px 26px -12px rgba(240,181,74,.7);
}
.gate-btn:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -12px rgba(240,181,74,.85); }
.gate-btn:active { transform: translateY(0); }
.gate-err { font-size: 12.5px; color: var(--down); min-height: 18px; margin-top: 12px; transition: opacity .3s; }
.gate-back { display: inline-block; margin-top: 8px; font-size: 12.5px; color: var(--tx-3); transition: color .2s; }
.gate-back:hover { color: var(--cyan); }

#app { display: none; position: relative; z-index: 1; }

/* ══════════════════ TOP BAR ══════════════════ */
.bar {
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px; height: 62px;
  background: linear-gradient(180deg, rgba(10,14,26,.92), rgba(10,14,26,.72));
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px -22px #000;
}
.bar-brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.bar-logo {
  width: 38px; height: 38px; border-radius: 11px;
  box-shadow: 0 0 0 1px rgba(240,181,74,.25), 0 6px 18px -6px rgba(240,181,74,.5);
}
.bar-name { font-family: var(--ff-disp); font-size: 18px; font-weight: 700; line-height: 1; }
.bar-name .dot-g { color: var(--gold); }
.bar-tag { font-size: 10.5px; color: var(--tx-3); margin-top: 3px; letter-spacing: .3px; }

/* live market ticker */
.bar-ticker {
  flex: 1; overflow: hidden; min-width: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.tick-track { display: flex; gap: 30px; white-space: nowrap; width: max-content; animation: tickscroll 60s linear infinite; }
.tick-track:hover { animation-play-state: paused; }
@keyframes tickscroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tick { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; }
.tick-sym { color: var(--tx-3); font-weight: 700; font-size: 11px; }
.tick-px  { color: var(--tx); font-weight: 700; }
.tick-chg { font-weight: 700; font-size: 11.5px; }
.tick.up   .tick-chg { color: var(--up); }
.tick.down .tick-chg { color: var(--down); }

.bar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 9px; font-size: 12px; font-weight: 700;
  background: var(--ink-3); border: 1px solid var(--line-2); color: var(--tx-2);
  transition: border-color .18s, color .18s, background .18s; white-space: nowrap;
}
.pill:hover { border-color: var(--line-2); color: var(--tx); background: var(--ink-4); }
.pill.gold { color: var(--gold); border-color: rgba(240,181,74,.3); background: var(--gold-dim); }
.pill.gold:hover { background: rgba(240,181,74,.2); }
.pill.danger { color: var(--down); border-color: rgba(255,93,108,.3); background: var(--down-dim); }
.pill.danger:hover { background: rgba(255,93,108,.2); }
.pill.live { color: var(--up); border-color: rgba(61,220,151,.3); background: var(--up-dim); }
.pill .ic { font-size: 13px; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); animation: beacon 2.2s infinite; }
.live-dot.off { background: var(--tx-faint); animation: none; }
@keyframes beacon { 0%,100% { box-shadow: 0 0 0 0 rgba(61,220,151,.55); } 60% { box-shadow: 0 0 0 6px rgba(61,220,151,0); } }

/* ══════════════════ HERO STRIP ══════════════════ */
.wrap { max-width: var(--grid-w); margin: 0 auto; padding: 20px; }
.hero {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 920px){ .hero { grid-template-columns: 1fr; } }

.hero-main {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 22px 24px;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(240,181,74,.10), transparent 55%),
    linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
}
.hero-main::after {
  content:""; position:absolute; inset:0; pointer-events:none;
  background: linear-gradient(90deg, transparent 60%, rgba(240,181,74,.04));
}
.hero-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--gold); font-weight: 700; letter-spacing: .6px; }
.hero-h { font-family: var(--ff-disp); font-size: clamp(22px, 3vw, 30px); font-weight: 700; margin: 8px 0 2px; line-height: 1.25; }
.hero-h .sm { color: var(--gold); }
.hero-desc { font-size: 13.5px; color: var(--tx-2); max-width: 46ch; }
.hero-status-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.hchip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--ink-3); border: 1px solid var(--line-2); color: var(--tx-2);
}
.hchip b { color: var(--tx); }
.hchip .hc-dot { width: 8px; height: 8px; border-radius: 50%; }
.hchip.ok { border-color: rgba(61,220,151,.28); }   .hchip.ok .hc-dot { background: var(--up); animation: beacon 2.2s infinite; }
.hchip.gold .hc-dot { background: var(--gold); }
.hchip.cyan .hc-dot { background: var(--cyan); }
.hchip.warn { border-color: rgba(255,169,77,.3); } .hchip.warn .hc-dot { background: var(--warn); }

/* PnL spotlight tile */
.hero-pnl {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 22px 24px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--line-2); box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: center;
}
.hp-label { font-size: 12px; color: var(--tx-3); font-weight: 700; letter-spacing: .4px; }
.hp-big {
  font-family: var(--ff-disp); font-size: clamp(34px, 6vw, 52px); font-weight: 700; line-height: 1;
  margin: 6px 0 4px; letter-spacing: -.5px;
}
.hp-big.up { color: var(--up); text-shadow: 0 0 32px rgba(61,220,151,.3); }
.hp-big.down { color: var(--down); text-shadow: 0 0 32px rgba(255,93,108,.3); }
.hp-sub { font-size: 13px; color: var(--tx-2); }
.hp-mini-row { display: flex; gap: 18px; margin-top: 16px; }
.hp-mini { }
.hp-mini-v { font-size: 19px; font-weight: 700; }
.hp-mini-v.up { color: var(--up); } .hp-mini-v.down { color: var(--down); } .hp-mini-v.gold { color: var(--gold); }
.hp-mini-l { font-size: 11.5px; color: var(--tx-3); margin-top: 1px; }
.hp-spark { position: absolute; inset: auto 0 0 0; height: 46px; opacity: .5; }

/* ══════════════════ SECTION TABS (nav) ══════════════════ */
.tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 6px;
}
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 700;
  color: var(--tx-3); border: 1px solid transparent; transition: all .15s; background: transparent;
}
.tab .ic { font-size: 14px; }
.tab:hover { color: var(--tx); background: var(--ink-3); }
.tab.active { color: var(--gold); background: var(--gold-dim); border-color: rgba(240,181,74,.25); }

.view { display: none; animation: fade .35s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ══════════════════ GRID + PANELS ══════════════════ */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-5  { grid-column: span 5; }
.col-4  { grid-column: span 4; }
.col-7  { grid-column: span 7; }
@media (max-width: 1000px){ .col-8,.col-7,.col-5,.col-6,.col-4 { grid-column: span 12; } }

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--ink-2), rgba(10,14,26,.85));
  border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.panel:hover { border-color: var(--line-2); }
.panel-accent { box-shadow: var(--shadow-sm), 0 0 0 1px rgba(240,181,74,.12); }
.panel-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.panel-hd .ph-ic {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--ink-3); border: 1px solid var(--line-2); font-size: 15px; flex-shrink: 0;
}
.panel-hd h3 { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.panel-hd .ph-meta { margin-inline-start: auto; font-size: 11.5px; color: var(--tx-3); font-weight: 600; white-space: nowrap; }
.panel-bd { padding: 16px 18px; }
.panel-bd.tight { padding: 12px 14px; }

/* generic stat tiles */
.stat-row { display: grid; gap: 10px; }
.stat-row.c4 { grid-template-columns: repeat(4, 1fr); }
.stat-row.c3 { grid-template-columns: repeat(3, 1fr); }
.stat-row.c2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 480px){ .stat-row.c4 { grid-template-columns: 1fr 1fr; } }
.stat {
  background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 12px; text-align: center; transition: border-color .18s, transform .18s;
}
.stat:hover { border-color: var(--line-2); transform: translateY(-2px); }
.stat-v { font-family: var(--ff-disp); font-size: 26px; font-weight: 700; line-height: 1.05; }
.stat-v.up { color: var(--up); } .stat-v.down { color: var(--down); }
.stat-v.gold { color: var(--gold); } .stat-v.cyan { color: var(--cyan); }
.stat-l { font-size: 11.5px; color: var(--tx-3); margin-top: 5px; }

/* status grid (Ghani state) */
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv {
  background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 13px;
}
.kv-l { font-size: 11.5px; color: var(--tx-3); margin-bottom: 4px; }
.kv-v { font-size: 16px; font-weight: 700; }
.kv-v.up { color: var(--up); } .kv-v.gold { color: var(--gold); } .kv-v.cyan { color: var(--cyan); }

/* ── reminders / list rows ── */
.rows { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row-item:last-child { border-bottom: none; }
.row-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); margin-top: 6px; flex-shrink: 0; box-shadow: 0 0 8px var(--cyan); }
.row-title { font-size: 14px; font-weight: 600; color: var(--tx); }
.row-sub { font-size: 12px; color: var(--tx-3); margin-top: 2px; }
.empty { text-align: center; color: var(--tx-3); font-size: 13px; padding: 26px 0; }
.empty .em-ic { font-size: 26px; display: block; margin-bottom: 8px; opacity: .5; }

/* ── TODOs ── */
.todo-add { display: flex; gap: 8px; margin-bottom: 12px; }
.inp {
  flex: 1; min-width: 0; padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--ink-1); border: 1px solid var(--line-2); color: var(--tx);
  font: 400 14px var(--ff-body); outline: none; transition: border-color .18s, box-shadow .18s; direction: rtl;
}
.inp:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-dim); }
.inp::placeholder { color: var(--tx-faint); }
.btn-add {
  flex-shrink: 0; width: 44px; border: none; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--cyan), var(--cyan-2)); color: #042024;
  font-size: 22px; font-weight: 700; line-height: 1; transition: transform .12s, box-shadow .2s;
  box-shadow: 0 8px 20px -10px rgba(56,212,208,.8);
}
.btn-add:hover { transform: translateY(-1px); }
.todo-list { display: flex; flex-direction: column; gap: 7px; max-height: 340px; overflow-y: auto; padding-inline-end: 4px; }
.todo {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: var(--r-sm);
  background: var(--ink-3); border: 1px solid var(--line); transition: border-color .15s, background .15s;
}
.todo:hover { border-color: var(--line-2); background: var(--ink-4); }
.todo-check {
  width: 21px; height: 21px; border-radius: 7px; flex-shrink: 0;
  border: 2px solid var(--line-2); background: var(--ink-1);
  display: grid; place-items: center; transition: all .2s;
}
.todo-check.done { background: var(--up); border-color: var(--up); }
.todo-check.done::after { content: "✓"; color: #042417; font-size: 13px; font-weight: 800; }
.todo-text { flex: 1; font-size: 14px; color: var(--tx); line-height: 1.45; word-break: break-word; }
.todo-text.done { color: var(--tx-3); text-decoration: line-through; }
.todo-acts { display: flex; gap: 1px; flex-shrink: 0; }
.todo-act { opacity: 0; background: none; border: none; font-size: 14px; padding: 4px 7px; border-radius: 6px; transition: opacity .18s, background .15s; }
.todo:hover .todo-act { opacity: .85; }
.todo-act:hover { background: var(--ink-5); opacity: 1; }
.ta-copy { color: var(--cyan); } .ta-edit { color: var(--gold); } .ta-del { color: var(--down); }
@media (hover: none){ .todo-act { opacity: .85 !important; } }
.todo-edit-inp {
  flex: 1; padding: 4px 9px; border-radius: 7px; background: var(--ink-1);
  border: 1px solid var(--cyan); color: var(--tx); font: 400 14px var(--ff-body);
  outline: none; box-shadow: 0 0 0 3px var(--cyan-dim); direction: rtl;
}

/* ── CRON ── */
.cron-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 640px){ .cron-cols { grid-template-columns: 1fr; } }
.cron-sub { font-size: 12px; font-weight: 700; color: var(--tx-3); letter-spacing: .4px; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.cron-i { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cron-i:last-child { border-bottom: none; }
.cron-badge {
  flex-shrink: 0; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; margin-top: 2px; white-space: nowrap;
  background: var(--cyan-dim); border: 1px solid rgba(56,212,208,.25); color: var(--cyan);
}
.cron-badge.once { background: var(--violet-dim); border-color: rgba(157,140,255,.25); color: var(--violet); }
.cron-name { font-size: 13.5px; color: var(--tx); line-height: 1.4; }
.cron-meta { font-size: 11.5px; color: var(--tx-3); margin-top: 2px; }
.cron-meta code { font-family: ui-monospace, 'SF Mono', monospace; font-size: 11px; color: var(--tx-faint); }

/* ── KNOWLEDGE / NEWS feed ── */
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.fbtn {
  padding: 6px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 700;
  border: 1px solid var(--line-2); background: transparent; color: var(--tx-3); transition: all .15s;
}
.fbtn:hover { color: var(--tx); border-color: var(--line-2); }
.fbtn.active { background: var(--gold-dim); border-color: rgba(240,181,74,.3); color: var(--gold); }
.feed-meta { font-size: 12px; color: var(--tx-3); margin-bottom: 12px; }
.feed-scroll { max-height: 620px; overflow-y: auto; padding-inline-end: 4px; }
.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 11px; padding-bottom: 6px; }
.fcard {
  background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 14px;
  transition: border-color .15s, transform .15s, box-shadow .15s; display: block;
}
.fcard:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.fcard-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.cat {
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; flex-shrink: 0;
  background: var(--cyan-dim); color: var(--cyan); border: 1px solid rgba(56,212,208,.2);
}
.cat.technical_learning { background: var(--up-dim); color: var(--up); border-color: rgba(61,220,151,.2); }
.cat.earnings { background: var(--gold-dim); color: var(--gold); border-color: rgba(240,181,74,.2); }
.cat.macro { background: var(--down-dim); color: var(--down); border-color: rgba(255,93,108,.2); }
.cat.commodities_fx, .cat.forex, .cat.energy { background: var(--warn-dim); color: var(--warn); border-color: rgba(255,169,77,.2); }
.cat.mega_cap, .cat.tech { background: var(--violet-dim); color: var(--violet); border-color: rgba(157,140,255,.2); }
.cat.general { background: var(--ink-4); color: var(--tx-2); border-color: var(--line-2); }
.fcard-imp { margin-inline-start: auto; font-size: 11px; color: var(--gold); letter-spacing: 1px; }
.fcard-title { font-size: 13.5px; color: var(--tx); line-height: 1.55; }
.fcard-title.translating { color: var(--tx-3); font-style: italic; }
.fcard-meta { font-size: 11px; color: var(--tx-faint); margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.fcard-src { color: var(--cyan-2); font-weight: 700; }

/* ── ARCHIVE ── */
.arc-list { display: flex; flex-direction: column; gap: 9px; max-height: 640px; overflow-y: auto; padding-inline-end: 4px; }
.arc-i {
  background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 15px; transition: border-color .15s;
}
.arc-i:hover { border-color: var(--line-2); }
.arc-top { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.arc-type { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--gold-dim); color: var(--gold); }
.arc-type.session_start, .arc-type.eod_summary { background: var(--up-dim); color: var(--up); }
.arc-type.trade, .arc-type.trade_open, .arc-type.trade_close { background: var(--cyan-dim); color: var(--cyan); }
.arc-title { font-size: 14px; font-weight: 700; color: var(--tx); }
.arc-when { margin-inline-start: auto; font-size: 11px; color: var(--tx-faint); white-space: nowrap; }
.arc-body { font-size: 12.5px; color: var(--tx-2); line-height: 1.7; white-space: pre-wrap; word-break: break-word; max-height: 110px; overflow: hidden; position: relative; }
.arc-body.open { max-height: none; }
.arc-fade { position: absolute; inset: auto 0 0 0; height: 38px; background: linear-gradient(transparent, var(--ink-3)); pointer-events: none; }
.arc-more { font-size: 11.5px; color: var(--cyan); font-weight: 700; margin-top: 8px; background: none; border: none; padding: 0; }

/* ══════════════════ RADAR (token cockpit) ══════════════════ */
.rdr-headline {
  display: flex; align-items: center; gap: 11px; font-size: 14.5px; font-weight: 700;
  padding: 13px 16px; border-radius: var(--r-sm); margin-bottom: 16px; border: 1px solid;
}
.rdr-headline.crit { background: var(--down-dim); color: var(--down); border-color: rgba(255,93,108,.3); }
.rdr-headline.warn { background: var(--warn-dim); color: var(--warn); border-color: rgba(255,169,77,.3); }
.rdr-headline.ok   { background: var(--up-dim); color: var(--up); border-color: rgba(61,220,151,.3); }
.rdr-headline.idle { background: var(--ink-3); color: var(--tx-2); border-color: var(--line-2); }
.rdr-tallies { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 560px){ .rdr-tallies { gap: 8px; } }
.rtile {
  background: var(--ink-3); border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 13px; text-align: center;
  transition: transform .18s, border-color .18s;
}
.rtile:hover { transform: translateY(-2px); border-color: var(--line-2); }
.rtile.accent { border-color: rgba(240,181,74,.28); background: linear-gradient(165deg, var(--gold-dim), var(--ink-3)); }
.rtile-p { font-size: 11.5px; color: var(--tx-3); font-weight: 700; margin-bottom: 7px; }
.rtile-v { font-family: var(--ff-disp); font-size: 27px; font-weight: 700; line-height: 1; }
@media (max-width: 560px){ .rtile-v { font-size: 21px; } }
.rtile-u { font-size: 11px; color: var(--tx-3); margin-top: 4px; }
.rtile-io { font-size: 11.5px; color: var(--cyan); margin-top: 7px; font-weight: 700; }
.rtile-runs { font-size: 10.5px; color: var(--tx-faint); margin-top: 4px; }

.spark-cap { font-size: 11.5px; color: var(--tx-3); margin: 4px 0 6px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 38px; }
.spark-b { flex: 1; background: linear-gradient(180deg, var(--gold), var(--gold-2)); border-radius: 3px 3px 0 0; min-height: 3px; opacity: .85; transition: opacity .15s; }
.spark-b:hover { opacity: 1; }

.rdr-shared { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md); background: var(--ink-3); border: 1px dashed var(--line-2); }
.rdr-shared-t { font-size: 12px; color: var(--tx-3); font-weight: 700; margin-bottom: 12px; }
.gauge { margin-bottom: 13px; }
.gauge:last-child { margin-bottom: 0; }
.gauge-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.gauge-l { font-size: 12px; color: var(--tx-2); }
.gauge-p { font-size: 15px; font-weight: 700; }
.gbar { height: 10px; border-radius: 6px; background: var(--ink-1); overflow: hidden; border: 1px solid var(--line); }
.gbar-f { height: 100%; border-radius: 6px; transition: width .6s cubic-bezier(.2,.7,.2,1); }
.gbar-f.lo { background: linear-gradient(90deg, var(--up), var(--cyan)); }
.gbar-f.mid { background: linear-gradient(90deg, var(--gold), var(--warn)); }
.gbar-f.hi { background: linear-gradient(90deg, var(--warn), var(--down)); }
.gauge-reset { font-size: 11px; color: var(--tx-3); margin-top: 4px; }
.rdr-foot { font-size: 11.5px; color: var(--tx-3); margin-top: 14px; line-height: 1.8; }
.rdr-foot b { color: var(--tx-2); }

/* ── COST ARCHIVE (calculator) ── */
.calc { margin-top: 16px; padding: 16px; border-radius: var(--r-md); background: linear-gradient(165deg, var(--cyan-dim), var(--ink-3)); border: 1px solid rgba(56,212,208,.22); }
.calc-t { font-size: 12.5px; color: var(--cyan); font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.sel {
  width: 100%; padding: 11px 13px; border-radius: var(--r-sm); background: var(--ink-1);
  border: 1px solid var(--line-2); color: var(--tx); font: 700 13.5px var(--ff-body); outline: none; margin-bottom: 12px;
}
.sel:focus { border-color: var(--cyan); }
.sel option, .sel optgroup { background: var(--ink-2); color: var(--tx); }
.cal-wrap { position: relative; margin-bottom: 12px; }
.cal-toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--r-sm);
  background: var(--ink-1); border: 1px solid var(--line-2); color: var(--tx); font-size: 13.5px; font-weight: 700; transition: border-color .15s;
}
.cal-toggle:hover { border-color: var(--cyan); }
.cal-caret { color: var(--tx-3); font-size: 11px; }
.cal {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 60; box-sizing: border-box;
  width: min(330px, 92vw); background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r-md);
  box-shadow: 0 24px 60px -20px #000; padding: 14px;
}
.cal-sel { font-size: 13.5px; font-weight: 700; color: var(--cyan); margin-bottom: 9px; text-align: center; }
.cal-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 10px; }
.cal-nav span { font-size: 13.5px; font-weight: 700; min-width: 110px; text-align: center; }
.cal-nav button { background: var(--ink-3); border: 1px solid var(--line-2); color: var(--tx); border-radius: 8px; font-size: 16px; line-height: 1; padding: 5px 13px; transition: all .15s; }
.cal-nav button:hover { border-color: var(--cyan); color: var(--cyan); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 3px; }
.cal-dow { font-size: 10.5px; color: var(--tx-3); text-align: center; padding: 2px 0 5px; font-weight: 700; }
.cal-cell {
  position: relative; aspect-ratio: 1; min-width: 0; display: grid; place-items: center;
  font-size: 12.5px; color: var(--tx-2); border-radius: 9px; transition: background .15s; border: 1px solid transparent;
}
.cal-cell.empty { visibility: hidden; }
.cal-cell:not(.empty):hover { background: var(--ink-4); cursor: pointer; }
.cal-cell.has { font-weight: 700; color: var(--tx); }
.cal-cell.today { border-color: rgba(56,212,208,.4); }
.cal-cell.sel { background: linear-gradient(135deg, var(--cyan), var(--cyan-2)); color: #042024; font-weight: 700; }
.cal-dot { position: absolute; bottom: 4px; inset-inline-start: 50%; transform: translateX(50%); width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.cal-cell.sel .cal-dot { background: #042024; }
.cal-today { display: block; margin: 11px auto 0; background: var(--ink-3); border: 1px solid var(--line-2); color: var(--tx); border-radius: 8px; font-size: 11.5px; font-weight: 700; padding: 6px 18px; transition: all .15s; }
.cal-today:hover { border-color: var(--cyan); color: var(--cyan); }
.arc-period { padding: 11px 0; border-bottom: 1px solid var(--line); }
.arc-period:last-of-type { border-bottom: none; }
.arc-period-h { font-size: 12.5px; color: var(--cyan); font-weight: 700; margin-bottom: 5px; }
.arc-period-io { font-size: 12px; color: var(--tx-2); line-height: 1.7; }
.arc-period-tot { font-size: 15px; font-weight: 700; color: var(--gold); margin-top: 4px; }
.calc-foot { font-size: 11px; color: var(--tx-3); margin-top: 11px; line-height: 1.6; }
.calc-foot b { color: var(--warn); }

/* ── big nav cards (chat / mindmap) ── */
.navcards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
@media (max-width: 720px){ .navcards { grid-template-columns: 1fr; } }
.navcard {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1)); border: 1px solid var(--line-2);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.navcard:hover { transform: translateY(-2px); border-color: rgba(56,212,208,.35); box-shadow: 0 18px 40px -22px rgba(0,0,0,.9); }
.navcard.gold:hover { border-color: rgba(240,181,74,.35); }
.navcard::after { content:""; position:absolute; inset-inline-end:-30%; inset-block:0; width:60%; background: radial-gradient(circle at 100% 50%, rgba(56,212,208,.1), transparent 70%); pointer-events:none; }
.navcard.gold::after { background: radial-gradient(circle at 100% 50%, rgba(240,181,74,.1), transparent 70%); }
.nav-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; flex-shrink: 0; background: var(--ink-3); border: 1px solid var(--line-2); }
.nav-ic img { width: 30px; height: 30px; border-radius: 7px; }
.nav-t { font-size: 15px; font-weight: 700; }
.nav-s { font-size: 11.5px; color: var(--tx-3); margin-top: 2px; }
.nav-arrow { margin-inline-start: auto; font-size: 18px; color: var(--tx-3); }

/* ── skeleton ── */
.sk { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--ink-3), var(--ink-4), var(--ink-3)); background-size: 200% 100%; animation: shimmer 1.5s infinite; margin-bottom: 9px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── change-password modal ── */
.modal-ov { display: none; position: fixed; inset: 0; z-index: 10000; background: rgba(3,5,10,.72); backdrop-filter: blur(6px); align-items: center; justify-content: center; padding: 20px; }
.modal-ov.open { display: flex; }
.modal { width: 340px; max-width: 100%; background: linear-gradient(180deg, var(--ink-2), var(--ink-1)); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow); }
.modal-t { font-family: var(--ff-disp); font-size: 16px; font-weight: 700; margin-bottom: 18px; text-align: center; }
.fld { margin-bottom: 12px; }
.fld-l { font-size: 12px; color: var(--tx-3); margin-bottom: 5px; }
.fld-i { width: 100%; padding: 11px 14px; border-radius: var(--r-sm); background: var(--ink-1); border: 1px solid var(--line-2); color: var(--tx); font: 700 18px var(--ff-num); text-align: center; letter-spacing: 6px; outline: none; }
.fld-i:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.modal-msg { font-size: 12.5px; min-height: 18px; margin-top: 8px; text-align: center; }
.modal-msg.ok { color: var(--up); } .modal-msg.err { color: var(--down); }
.modal-acts { display: flex; gap: 9px; margin-top: 18px; }
.m-save { flex: 1; padding: 12px; border: none; border-radius: var(--r-sm); background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #1a1304; font-size: 14px; font-weight: 700; }
.m-cancel { flex: 1; padding: 12px; border-radius: var(--r-sm); background: var(--ink-3); border: 1px solid var(--line-2); color: var(--tx-2); font-size: 14px; font-weight: 700; }

/* footer */
.foot { text-align: center; color: var(--tx-faint); font-size: 11.5px; padding: 30px 0 20px; }

/* ── responsive bar ── */
@media (max-width: 760px){
  .bar { padding: 0 12px; gap: 8px; }
  .bar-ticker { display: none; }
  .bar-tag { display: none; }
  .pill { padding: 6px 10px; font-size: 11px; }
  .pill .ptxt { display: none; }
  .pill.gold .ptxt, .pill.danger .ptxt { display: none; }
}
@media (max-width: 600px){
  .wrap { padding: 14px; }
  .grid { gap: 12px; }
  .hero-main, .hero-pnl { padding: 18px; }
  .panel-bd { padding: 14px; }
}
