/* ═══════════════════════════════════════════════════════════════
   COSMIC GLASS — Design Tokens + Animations + Component Styles
   Applied on top of style.css, does NOT replace it.
   ═══════════════════════════════════════════════════════════════ */

/* ─── DESIGN TOKENS ─── */
:root {
  /* Deep-space palette */
  --cs-bg-deep:    #0a0612;
  --cs-bg-cosmos:  #1a0f2e;
  --cs-bg-card:    rgba(18, 22, 46, 0.88);
  --cs-bg-card2:   rgba(13, 16, 35, 0.92);

  /* Nebula accent pair */
  --cs-pur:  #8B5CF6;
  --cs-cyn:  #06B6D4;
  --cs-rose: #F43F5E;

  /* Glow alphas */
  --cs-glow-pur:  rgba(139, 92, 246, 0.35);
  --cs-glow-cyn:  rgba(6, 182, 212, 0.30);
  --cs-glow-grn:  rgba(16, 185, 129, 0.30);
  --cs-glow-rose: rgba(244, 63, 94, 0.30);

  /* Glass border gradients */
  --cs-border-grad: linear-gradient(135deg,
      rgba(139,92,246,.28) 0%,
      rgba(6,182,212,.14) 55%,
      rgba(139,92,246,.06) 100%);

  /* Card faces */
  --cs-card-face: linear-gradient(160deg,
      rgba(18,22,46,.88),
      rgba(13,16,35,.92));

  /* Shine */
  --cs-shine: linear-gradient(90deg,
      transparent,
      rgba(255,255,255,.04) 40%,
      rgba(255,255,255,.07) 50%,
      rgba(255,255,255,.04) 60%,
      transparent);

  /* Sidebar */
  --cs-sb-width: 240px;
  --cs-sb-bg: rgba(10, 6, 18, 0.92);

  /* Active nav gradient */
  --cs-nav-active-border: linear-gradient(180deg, #8B5CF6, #06B6D4);
}

/* ─── KEYFRAMES ─── */

/* Aurora blob drift */
@keyframes drift1 {
  0%   { transform: translate(0,0)   scale(1);   }
  33%  { transform: translate(30px,-20px) scale(1.05); }
  66%  { transform: translate(-20px,15px) scale(.97);  }
  100% { transform: translate(0,0)   scale(1);   }
}
@keyframes drift2 {
  0%   { transform: translate(0,0)   scale(1);   }
  33%  { transform: translate(-25px,20px)  scale(1.04); }
  66%  { transform: translate(20px,-15px) scale(.98);  }
  100% { transform: translate(0,0)   scale(1);   }
}
@keyframes drift3 {
  0%   { transform: translate(0,0) scale(1);    }
  50%  { transform: translate(15px,25px) scale(1.06); }
  100% { transform: translate(0,0) scale(1);    }
}

/* Generic fade-up entrance */
@keyframes fadeUp {
  from { opacity:0; transform:translateY(14px); }
  to   { opacity:1; transform:translateY(0);    }
}

/* Bar/column grow from baseline */
@keyframes growUp {
  from { transform:scaleY(0); }
  to   { transform:scaleY(1); }
}

/* Ring spinner (sync button) */
@keyframes spinRing {
  to { transform:rotate(360deg); }
}

/* KPI card entrance pulse */
@keyframes successPulse {
  0%   { box-shadow:0 0 0 0 var(--cs-glow-pur); }
  70%  { box-shadow:0 0 0 8px transparent; }
  100% { box-shadow:0 0 0 0 transparent; }
}

/* Logo glow breathe */
@keyframes logoGlow {
  0%,100% { text-shadow:0 0 20px var(--cs-glow-pur); }
  50%      { text-shadow:0 0 40px var(--cs-glow-cyn),0 0 60px var(--cs-glow-pur); }
}

/* Active nav dot pulse */
@keyframes activePulse {
  0%,100% { opacity:1;  transform:scale(1);   }
  50%      { opacity:.4; transform:scale(1.6); }
}

/* Calendar "today" cell pulse */
@keyframes todayPulse {
  0%,100% { box-shadow:0 0 0 2px var(--cs-pur); }
  50%      { box-shadow:0 0 0 4px var(--cs-glow-pur),0 0 12px var(--cs-glow-pur); }
}

/* Shimmer sweep (used on skeleton or hover) */
@keyframes shimmer {
  from { background-position:-200% 0; }
  to   { background-position: 200% 0; }
}

/* Icon glow */
@keyframes iconGlow {
  0%,100% { filter:drop-shadow(0 0 4px var(--cs-glow-pur)); }
  50%      { filter:drop-shadow(0 0 10px var(--cs-glow-cyn)); }
}

/* Circular ring draw (win-rate arc) */
@keyframes glowRing {
  0%,100% { filter:drop-shadow(0 0 3px var(--cs-glow-pur)); }
  50%      { filter:drop-shadow(0 0 8px var(--cs-glow-cyn)); }
}

/* Calculator result particle burst */
@keyframes particleFly {
  0%   { opacity:1;  transform:translate(0,0) scale(1);   }
  100% { opacity:0;  transform:translate(var(--dx,0),var(--dy,-60px)) scale(0); }
}

/* Generic pulse */
@keyframes pulse {
  0%,100% { opacity:1; }
  50%      { opacity:.5; }
}

/* Slide-in from left */
@keyframes slideIn {
  from { transform:translateX(-10px); opacity:0; }
  to   { transform:translateX(0);     opacity:1; }
}

/* Amber warning pulse (loss-streak card) */
@keyframes ambPulse {
  0%,100% { border-color:rgba(245,158,11,.2); box-shadow:none; }
  50%      { border-color:rgba(245,158,11,.5); box-shadow:0 0 18px rgba(245,158,11,.18); }
}

/* ─── STAGGER DELAY UTILITIES ─── */
.delay-1 { animation-delay:.06s  !important; }
.delay-2 { animation-delay:.12s  !important; }
.delay-3 { animation-delay:.18s  !important; }
.delay-4 { animation-delay:.24s  !important; }
.delay-5 { animation-delay:.30s  !important; }
.delay-6 { animation-delay:.36s  !important; }

/* ─── GRADIENT TEXT ─── */
.grad-txt {
  background: linear-gradient(135deg, var(--cs-pur), var(--cs-cyn));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.grad-txt-grn {
  background: linear-gradient(135deg, #10B981, #06B6D4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── COSMIC CARD (glass) ─── */
.cosmic-card {
  background:
    var(--cs-card-face) padding-box,
    var(--cs-border-grad) border-box;
  border: 1px solid transparent;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  box-shadow:
    0 4px 18px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.03);
  transition: box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.cosmic-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cs-shine);
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
}
.cosmic-card:hover {
  box-shadow:
    0 8px 32px rgba(0,0,0,.38),
    0 0 0 1px rgba(139,92,246,.18),
    inset 0 1px 0 rgba(255,255,255,.05);
}
.cosmic-card:hover::before {
  opacity: 1;
  animation: shimmer 1.2s ease-in-out;
}

/* Inner top-shine stripe */
.inner-shine {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(139,92,246,.35) 30%,
    rgba(6,182,212,.2) 60%,
    transparent 100%);
  pointer-events: none;
}

/* ─── SECTION DIVIDER (cosmic) ─── */
.sec-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 18px;
}
.sec-divider span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--cs-pur);
  white-space: nowrap;
  text-shadow: 0 0 12px var(--cs-glow-pur);
}
.sec-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(139,92,246,.35), transparent);
}

/* ─── AURORA BACKGROUND ─── */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}
.aurora-blob-1 {
  width: 600px; height: 600px;
  top: -200px; left: -150px;
  background: radial-gradient(circle, rgba(139,92,246,.18) 0%, transparent 70%);
  animation: drift1 20s ease-in-out infinite;
}
.aurora-blob-2 {
  width: 500px; height: 500px;
  top: 30%; right: -100px;
  background: radial-gradient(circle, rgba(6,182,212,.14) 0%, transparent 70%);
  animation: drift2 25s ease-in-out infinite;
}
.aurora-blob-3 {
  width: 400px; height: 400px;
  bottom: -100px; left: 40%;
  background: radial-gradient(circle, rgba(139,92,246,.1) 0%, transparent 70%);
  animation: drift3 18s ease-in-out infinite;
}
.aurora-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139,92,246,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,92,246,.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Star canvas sits behind everything */
#auroraCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Main content area sits above aurora (sidebar already has z-index:100) */
.mn { position: relative; z-index: 1; }

/* ─── PAGE FADE-IN ─── */
.page.active {
  animation: fadeUp .3s ease both;
}

/* ─── KPI ICON GLOW ─── */
.k-icon {
  position: relative;
}
.k-icon svg {
  animation: iconGlow 4s ease-in-out infinite;
}

/* ─── COSMIC SIDEBAR ─── */
.sb {
  background: var(--cs-sb-bg) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid rgba(139,92,246,.12) !important;
  width: var(--cs-sb-width);
}

/* Logo */
.sb-logo h1 {
  animation: logoGlow 4s ease-in-out infinite;
}

/* Nav item — cosmic active state */
.nav-i.active {
  background: linear-gradient(90deg,
    rgba(139,92,246,.14) 0%,
    rgba(6,182,212,.06) 100%) !important;
  border-left: none !important;
  position: relative;
}
.nav-i.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--cs-nav-active-border);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--cs-glow-pur);
}
/* Pulsing active dot */
.nav-i.active::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cs-pur);
  box-shadow: 0 0 6px var(--cs-glow-pur);
  animation: activePulse 2s ease-in-out infinite;
}

/* Section label underline animation on hover */
.sb-section-btn {
  position: relative;
  overflow: hidden;
}
.sb-section-btn::after {
  content: '';
  position: absolute;
  bottom: 0; left: 16px; right: 16px;
  height: 1px;
  background: linear-gradient(90deg, var(--cs-pur), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}
.sb-section-btn:hover::after,
.sb-section-group.active .sb-section-btn::after {
  transform: scaleX(1);
}

/* ─── COSMIC KPI CARD ─── */
.kpi {
  animation: fadeUp .4s ease both;
}
.kpi:nth-child(2) { animation-delay:.06s; }
.kpi:nth-child(3) { animation-delay:.12s; }
.kpi:nth-child(4) { animation-delay:.18s; }
.kpi:nth-child(5) { animation-delay:.24s; }
.kpi:nth-child(6) { animation-delay:.30s; }
.kpi:nth-child(7) { animation-delay:.36s; }
.kpi:nth-child(8) { animation-delay:.42s; }
/* Inner top-shine stripe injected into each KPI */
.kpi > .inner-shine {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(139,92,246,.4) 30%,
    rgba(6,182,212,.2) 60%,
    transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* Win-rate ring container */
.kpi-ring-wrap {
  position: absolute;
  right: 14px; top: 14px;
  width: 52px; height: 52px;
}
.kpi-ring-wrap svg {
  transform: rotate(-90deg);
  animation: glowRing 3s ease-in-out infinite;
}
.kpi-ring-val {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--cs-pur);
}

/* Sparkline in KPI card */
.kpi-sparkline {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 36px;
  opacity: .35;
  pointer-events: none;
}
.kpi-sparkline polyline {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kpi-sparkline.up polyline  { stroke: var(--cs-cyn); }
.kpi-sparkline.dn polyline  { stroke: var(--cs-rose); }

/* ─── CARD (override for cosmic) ─── */
.card {
  background:
    var(--cs-card-face) padding-box,
    var(--cs-border-grad) border-box !important;
  border: 1px solid transparent !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 4px 18px rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.03) !important;
  transition: box-shadow .2s, transform .18s !important;
}
.card:hover {
  box-shadow:
    0 8px 30px rgba(0,0,0,.32),
    0 0 0 1px rgba(139,92,246,.16),
    inset 0 1px 0 rgba(255,255,255,.05) !important;
}

/* ─── BALANCE BAR (cosmic) ─── */
.bal-bar {
  position: relative;
  z-index: 10;
  background:
    linear-gradient(180deg, rgba(18,22,46,.95), rgba(13,16,35,.98)) padding-box,
    linear-gradient(90deg, rgba(139,92,246,.18), rgba(6,182,212,.1), rgba(139,92,246,.08)) border-box !important;
  border: none !important;
  border-bottom: 1px solid rgba(139,92,246,.14) !important;
  backdrop-filter: blur(20px);
}
.bal-sep {
  background: linear-gradient(180deg, transparent, rgba(139,92,246,.2), transparent) !important;
}

/* Sync button cosmic ring */
#syncBtn {
  position: relative;
  overflow: hidden;
}
#syncBtn.syncing svg {
  animation: spinRing .8s linear infinite;
}

/* ─── TOPBAR (cosmic) ─── */
.topbar {
  background:
    linear-gradient(180deg, rgba(18,22,46,.95), rgba(13,16,35,.98)) padding-box,
    linear-gradient(90deg, rgba(139,92,246,.14), transparent) border-box !important;
  border-bottom: 1px solid rgba(139,92,246,.12) !important;
  backdrop-filter: blur(20px);
}

/* ─── PERIOD PICKER (cosmic) ─── */
.period-picker {
  background:
    var(--cs-card-face) padding-box,
    var(--cs-border-grad) border-box !important;
  border: 1px solid transparent !important;
  backdrop-filter: blur(16px);
}
.pp-btn {
  border-radius: 10px !important;
  transition: color .2s, transform .15s, background .2s, box-shadow .2s !important;
}
.pp-btn:active { transform: scale(.94); }
.pp-btn.active {
  background:
    linear-gradient(180deg, rgba(139,92,246,.42) 0%, rgba(139,92,246,.22) 50%, rgba(6,182,212,.14) 100%) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    inset 0 -1px 0 rgba(0,0,0,.28),
    0 0 0 1px rgba(139,92,246,.4),
    0 4px 14px rgba(139,92,246,.32),
    0 0 22px rgba(139,92,246,.22) !important;
  text-shadow: 0 0 10px var(--cs-glow-pur);
}
@media (max-width: 640px) {
  .pp-btn { padding: 8px 14px !important; font-size: 12px !important; }
}

/* ─── BADGE (cosmic) ─── */
.card-badge {
  background: rgba(139,92,246,.14) !important;
  color: var(--cs-pur) !important;
  border: 1px solid rgba(139,92,246,.22) !important;
}

/* ─── CALENDAR HEATMAP — cosmic cells ─── */
/* Year-calendar cells */
.ycal-day.ycal-today {
  z-index: 2;
}
.ycal-day.ycal-win {
  background: linear-gradient(135deg, #10B981, #059669) !important;
  box-shadow: 0 0 6px var(--cs-glow-grn);
}
.ycal-day.ycal-loss {
  background: linear-gradient(135deg, #EF4444, #B91C1C) !important;
  box-shadow: 0 0 6px var(--cs-glow-rose);
}
.ycal-day.ycal-tapped {
  transform: scale(1.5) !important;
  z-index: 6 !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,.7), 0 4px 14px rgba(0,0,0,.6) !important;
}

/* Desktop: fix year-calendar month width so cells stay small even when few months are rendered */
@media (min-width: 641px) {
  .ycal-grid { justify-content: flex-start !important; }
  .ycal-month {
    flex: 0 0 calc((100% - 66px) / 12) !important;
    max-width: calc((100% - 66px) / 12) !important;
  }
}

/* Mobile: bigger year-calendar (2 cols of 6 months instead of 3x4) */
@media (max-width: 640px) {
  .ycal-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px 10px !important;
  }
  .ycal-mname { font-size: 10px !important; margin-bottom: 4px !important; }
  .ycal-dow { font-size: 7px !important; }
  .ycal-day { font-size: 8px !important; }
  .ycal-days { gap: 3px !important; }
}

/* ─── MOBILE: Trade Journal & Positions as glass cards ─── */
@media (max-width: 640px) {
  #ctJournalTable, #nJournalTable {
    display: block;
  }
  #ctJournalTable thead, #nJournalTable thead { display: none; }
  #ctJournalTable tbody, #nJournalTable tbody { display: block; }
  #ctJournalTable tr, #nJournalTable tr {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    position: relative;
    margin: 0 0 10px 0;
    padding: 14px 92px 14px 16px;
    background: rgba(18,22,46,.55);
    border: 1px solid rgba(139,92,246,.18);
    border-left: 4px solid var(--cs-pur);
    border-radius: 12px;
    backdrop-filter: blur(8px);
  }
  #ctJournalTable tr:has(.pos), #nJournalTable tr:has(.pos) {
    border-left-color: #10B981;
    box-shadow: -2px 0 18px rgba(16,185,129,.16);
  }
  #ctJournalTable tr:has(.neg), #nJournalTable tr:has(.neg) {
    border-left-color: #EF4444;
    box-shadow: -2px 0 18px rgba(239,68,68,.16);
  }
  /* Force line break between symbol/side and meta line */
  #ctJournalTable tr::after, #nJournalTable tr::after {
    content: "";
    order: 9;
    flex-basis: 100%;
    height: 0;
  }
  /* td reset */
  #ctJournalTable td, #nJournalTable td {
    border: none !important;
    padding: 0 !important;
    margin: 0;
  }
  /* Hide non-essential cells (qty/entry/exit) on mobile */
  #ctJournalTable td:nth-child(4), #nJournalTable td:nth-child(4),
  #ctJournalTable td:nth-child(5), #nJournalTable td:nth-child(5),
  #ctJournalTable td:nth-child(6), #nJournalTable td:nth-child(6) {
    display: none !important;
  }
  /* Symbol */
  #ctJournalTable td:nth-child(2), #nJournalTable td:nth-child(2) {
    order: 1;
    display: inline-block;
    font-size: 16px;
    font-weight: 700;
  }
  /* Side badge */
  #ctJournalTable td:nth-child(3), #nJournalTable td:nth-child(3) {
    order: 2;
    display: inline-block;
    margin-left: 8px;
  }
  /* PnL — absolute right */
  #ctJournalTable td:nth-child(7), #nJournalTable td:nth-child(7) {
    order: 3;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 17px;
    text-align: right;
  }
  /* Date · Lev · Duration on second line */
  #ctJournalTable td:nth-child(1), #nJournalTable td:nth-child(1) {
    order: 10;
    display: inline-block;
    font-size: 11px;
    color: var(--txt2);
    margin-top: 6px;
  }
  #ctJournalTable td:nth-child(8), #nJournalTable td:nth-child(8) {
    order: 11;
    display: inline-block;
    font-size: 11px;
    color: var(--txt2);
    margin-top: 6px;
  }
  #ctJournalTable td:nth-child(9), #nJournalTable td:nth-child(9) {
    order: 12;
    display: inline-block;
    font-size: 11px;
    color: var(--txt2);
    margin-top: 6px;
  }
  #ctJournalTable td:nth-child(1)::after,
  #nJournalTable td:nth-child(1)::after,
  #ctJournalTable td:nth-child(8)::after,
  #nJournalTable td:nth-child(8)::after {
    content: "·";
    margin: 0 6px;
    color: var(--txt3);
  }
}

/* ─── APEXCHARTS — cosmic theme overrides ─── */
.apexcharts-canvas {
  background: transparent !important;
}
.apexcharts-tooltip {
  background: rgba(18,22,46,.96) !important;
  border: 1px solid rgba(139,92,246,.25) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 0 0 1px rgba(139,92,246,.08) !important;
  backdrop-filter: blur(12px) !important;
  border-radius: 10px !important;
  color: #E2E8F0 !important;
}
.apexcharts-tooltip-title {
  background: rgba(139,92,246,.08) !important;
  border-bottom: 1px solid rgba(139,92,246,.2) !important;
}
.apexcharts-gridline {
  stroke: rgba(139,92,246,.06) !important;
}
.apexcharts-xaxis-label, .apexcharts-yaxis-label {
  fill: #64748B !important;
}

/* ─── MOBILE: compensate taller sec-tabs (cosmic) ─── */
@media (max-width: 640px) {
  body { padding-top: 118px !important; }
}

/* ─── MOBILE BOTTOM NAV (cosmic) ─── */
.b-nav {
  background:
    linear-gradient(180deg, rgba(18,22,46,.98), rgba(10,6,18,.99)) padding-box,
    linear-gradient(90deg, rgba(139,92,246,.14), rgba(6,182,212,.08), rgba(139,92,246,.06)) border-box !important;
  border: none !important;
  border-top: 1px solid rgba(139,92,246,.14) !important;
  backdrop-filter: blur(24px);
  padding: 8px 6px env(safe-area-inset-bottom, 8px) !important;
}
.bnav {
  position: relative;
  padding: 10px 14px !important;
  gap: 5px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 14px;
  transition: color .2s, transform .15s;
}
.bnav svg { width: 24px !important; height: 24px !important; }
.bnav:active { transform: scale(.94); }
.bnav.active {
  color: #fff !important;
  background:
    linear-gradient(180deg, rgba(139,92,246,.32) 0%, rgba(139,92,246,.14) 50%, rgba(6,182,212,.10) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(0,0,0,.25),
    0 0 0 1px rgba(139,92,246,.35),
    0 6px 18px rgba(139,92,246,.28),
    0 0 24px rgba(139,92,246,.18);
}
.bnav.active svg {
  filter: drop-shadow(0 0 6px var(--cs-glow-pur)) drop-shadow(0 0 2px rgba(255,255,255,.6));
}

/* ─── MOBILE TOP BAR (cosmic) ─── */
.m-top {
  background: rgba(10,6,18,.95) !important;
  border-bottom: 1px solid rgba(139,92,246,.12) !important;
  backdrop-filter: blur(20px);
}

/* ─── LANG SWITCH (cosmic) ─── */
.lang-b.active {
  background: linear-gradient(135deg, var(--cs-pur), #7C3AED) !important;
  box-shadow: 0 2px 8px var(--cs-glow-pur);
}

/* ─── BUTTON (cosmic) ─── */
.btn-p {
  background: linear-gradient(135deg, var(--cs-pur), #7C3AED) !important;
  box-shadow: 0 2px 10px var(--cs-glow-pur);
  border: none !important;
}
.btn-p:hover {
  box-shadow: 0 4px 18px var(--cs-glow-pur) !important;
  transform: translateY(-1px);
}
.btn-s {
  background: rgba(18,22,46,.6) !important;
  border: 1px solid rgba(139,92,246,.2) !important;
  backdrop-filter: blur(8px);
}
.btn-s:hover {
  border-color: rgba(139,92,246,.4) !important;
  box-shadow: 0 2px 10px var(--cs-glow-pur);
}

/* ─── SCROLLBAR (cosmic) ─── */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background: rgba(10,6,18,.5); }
::-webkit-scrollbar-thumb {
  background: rgba(139,92,246,.3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(139,92,246,.5);
}

/* ─── SELECTION ─── */
::selection {
  background: rgba(139,92,246,.3);
  color: #E2E8F0;
}

/* ─── CALC HERO (glass) ─── */
.calc-hero {
  background:
    linear-gradient(135deg, rgba(139,92,246,.1), rgba(6,182,212,.05)) padding-box,
    linear-gradient(135deg, rgba(139,92,246,.3), rgba(6,182,212,.15)) border-box !important;
  border: 1px solid transparent !important;
  backdrop-filter: blur(16px);
}
.calc-hero-txt h2 {
  animation: logoGlow 4s ease-in-out infinite;
}

/* ─── CALC RESULT (glow pulse) ─── */
.calc-result {
  background:
    linear-gradient(135deg, rgba(16,185,129,.08), rgba(6,182,212,.04)) padding-box,
    linear-gradient(135deg, rgba(16,185,129,.3), rgba(6,182,212,.15)) border-box !important;
  border: 1px solid transparent !important;
  backdrop-filter: blur(16px);
  animation: calcResultGlow 3s ease-in-out infinite;
}
@keyframes calcResultGlow {
  0%,100% { box-shadow: 0 4px 20px rgba(0,0,0,.2); }
  50%      { box-shadow: 0 4px 30px rgba(16,185,129,.18), 0 0 60px rgba(16,185,129,.06); }
}

/* ─── PROMO BANNER (cosmic) ─── */
.promo-banner {
  background:
    linear-gradient(135deg, rgba(139,92,246,.1), rgba(139,92,246,.03)) padding-box,
    linear-gradient(135deg, rgba(139,92,246,.25), rgba(6,182,212,.1)) border-box !important;
  border: 1px solid transparent !important;
  backdrop-filter: blur(12px);
}
.promo-banner:hover {
  box-shadow: 0 4px 24px rgba(139,92,246,.18) !important;
}
.promo-banner--grn {
  background:
    linear-gradient(135deg, rgba(16,185,129,.1), rgba(16,185,129,.03)) padding-box,
    linear-gradient(135deg, rgba(16,185,129,.25), rgba(6,182,212,.1)) border-box !important;
}
.promo-banner--grn:hover {
  box-shadow: 0 4px 24px rgba(16,185,129,.18) !important;
}

/* ─── CALC CONTROLS CARD ─── */
.calc-controls {
  backdrop-filter: blur(16px);
}

/* ─── CALC SLIDER (styled via JS, but thumb override here) ─── */
.calc-slider {
  border-radius: 4px !important;
  height: 6px !important;
}
.calc-slider::-webkit-slider-thumb {
  background: linear-gradient(135deg, #8B5CF6, #06B6D4) !important;
  box-shadow: 0 0 8px rgba(139,92,246,.5) !important;
}
.calc-slider::-moz-range-thumb {
  background: linear-gradient(135deg, #8B5CF6, #06B6D4) !important;
  box-shadow: 0 0 8px rgba(139,92,246,.5) !important;
}

/* ─── SECTION TABS (mobile, cosmic) ─── */
.sec-tabs {
  background: rgba(10,6,18,.95) !important;
  border-bottom: 1px solid rgba(139,92,246,.12) !important;
  backdrop-filter: blur(20px);
  padding: 8px 10px !important;
}
.sec-tabs-in { gap: 6px !important; }
.sec-tab {
  padding: 14px 8px !important;
  font-size: 13px !important;
  border-bottom: none !important;
  border-radius: 12px;
  letter-spacing: .6px !important;
  transition: color .2s, transform .15s, background .2s;
}
.sec-tab:active { transform: scale(.96); }
.sec-tab.active {
  color: #fff !important;
  border-bottom: none !important;
  background:
    linear-gradient(180deg, rgba(139,92,246,.34) 0%, rgba(139,92,246,.18) 50%, rgba(6,182,212,.12) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    inset 0 -1px 0 rgba(0,0,0,.28),
    0 0 0 1px rgba(139,92,246,.4),
    0 6px 20px rgba(139,92,246,.32),
    0 0 28px rgba(139,92,246,.2);
  text-shadow: 0 0 12px var(--cs-glow-pur);
}

/* ─── HELP TOOLTIP (cosmic glass) ─── */
.help-tip {
  background: rgba(18,22,46,.97) !important;
  border: 1px solid rgba(139,92,246,.25) !important;
  backdrop-filter: blur(16px) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,.5), 0 0 0 1px rgba(139,92,246,.08) !important;
}
.help-tip.pinned {
  border-color: var(--cs-pur) !important;
}

/* ─── TABLE WRAPPER (cosmic) ─── */
.tbl-wrap {
  border: 1px solid rgba(139,92,246,.12) !important;
  border-radius: 10px;
}
.tbl th {
  background: rgba(139,92,246,.06) !important;
}
.tbl tr:hover {
  background: rgba(139,92,246,.04) !important;
}

/* ─── AUTO-REFRESH DROPDOWN ─── */
.auto-ref-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: rgba(18,22,46,.98);
  border: 1px solid rgba(139,92,246,.28);
  border-radius: 10px;
  padding: 4px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 500;
  min-width: 110px;
  box-shadow: 0 8px 28px rgba(0,0,0,.5), 0 0 0 1px rgba(139,92,246,.06);
}
.auto-ref-opt {
  display: block;
  width: 100%;
  padding: 7px 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--txt2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
  margin-bottom: 2px;
}
.auto-ref-opt:last-child { margin-bottom: 0; }
.auto-ref-opt:hover {
  background: rgba(139,92,246,.14);
  color: var(--txt);
}
.auto-ref-opt.active {
  background: linear-gradient(135deg, rgba(139,92,246,.25), rgba(6,182,212,.12));
  color: var(--cs-pur);
}
.auto-ref-off { color: var(--txt3) !important; }
.auto-ref-off:hover { color: var(--txt2) !important; background: rgba(255,255,255,.04) !important; }

/* ─── BODY background override ─── */
body {
  background: var(--cs-bg-deep) !important;
}

/* ─── CALENDAR TODAY HEADER ─── */
.cal-today-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--txt2);
  padding: 0 4px 10px;
  min-height: 20px;
}
.cal-today-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--grn);
  box-shadow: 0 0 8px rgba(16,185,129,.6);
  flex-shrink: 0;
  animation: calTodayPulse 2s ease-in-out infinite;
}
@keyframes calTodayPulse {
  0%,100% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px rgba(16,185,129,.6); }
  50%      { opacity: .65; transform: scale(1.3); box-shadow: 0 0 12px rgba(16,185,129,.4); }
}

/* ─── YEAR CALENDAR — month total & multi-level dots ─── */
.ycal-mname {
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
}
.ycal-mtotal {
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
}
.ycal-mtotal-pos { color: var(--grn) !important; }
.ycal-mtotal-neg { color: var(--red) !important; }

/* Day-cell as pure dot — no number text, round */
/* Calendar day numbers */
.ycal-day { font-size: 6px !important; color: rgba(148,163,184,.55) !important; }
/* Multi-level win/loss intensities */
.ycal-day.ycal-win1  { background: rgba(16,185,129,.3) !important; box-shadow: none !important; color: rgba(16,185,129,.75) !important; }
.ycal-day.ycal-win2  { background: rgba(16,185,129,.6) !important; box-shadow: 0 0 4px rgba(16,185,129,.3) !important; color: rgba(255,255,255,.85) !important; }
.ycal-day.ycal-win3  { background: #10B981 !important; box-shadow: 0 0 6px rgba(16,185,129,.5) !important; color: #fff !important; }
.ycal-day.ycal-loss1 { background: rgba(239,68,68,.28) !important; box-shadow: none !important; color: rgba(239,68,68,.75) !important; }
.ycal-day.ycal-loss2 { background: rgba(239,68,68,.55) !important; box-shadow: 0 0 4px rgba(239,68,68,.3) !important; color: rgba(255,255,255,.85) !important; }
.ycal-day.ycal-loss3 { background: #EF4444 !important; box-shadow: 0 0 6px rgba(239,68,68,.5) !important; color: #fff !important; }
/* Override old .ycal-win/.ycal-loss if still used */
.ycal-day.ycal-win  { background: #10B981 !important; color: #fff !important; }
.ycal-day.ycal-loss { background: #EF4444 !important; color: #fff !important; }
/* ── TODAY = COSMIC QUANTUM ORB (3D crystalline core + rotating chromatic halo) ── */
.ycal-day.ycal-today {
  background: radial-gradient(circle at 32% 28%,
    #FFFFFF 0%,
    #E0E7FF 10%,
    #A78BFA 32%,
    #6D28D9 58%,
    #1E1B4B 100%
  ) !important;
  color: rgba(255,255,255,.98) !important;
  font-weight: 800 !important;
  font-size: 6.5px !important;
  text-shadow: 0 0 4px rgba(0,0,0,.85), 0 0 1px rgba(255,255,255,.6) !important;
  overflow: visible !important;
  animation: orbPulse 2.6s ease-in-out infinite !important;
  z-index: 5 !important;
  box-shadow:
    inset 0 1px 1.5px rgba(255,255,255,.85),
    inset 0 -1.5px 2px rgba(30,10,80,.55),
    inset 1px 0 1px rgba(255,255,255,.25),
    0 0 0 1px rgba(255,255,255,.35),
    0 0 8px rgba(139,92,246,.85),
    0 0 14px rgba(6,182,212,.45),
    0 2px 5px rgba(0,0,0,.55) !important;
}
/* Rotating chromatic halo — gives the 3D shimmering feel */
.ycal-day.ycal-today::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(139,92,246,.0) 0deg,
    rgba(139,92,246,.85) 60deg,
    rgba(6,182,212,.85) 140deg,
    rgba(244,63,94,.55) 220deg,
    rgba(139,92,246,.85) 300deg,
    rgba(139,92,246,.0) 360deg
  );
  filter: blur(2.5px);
  animation: orbHaloRotate 3.5s linear infinite;
  z-index: -1;
  pointer-events: none;
  opacity: .85;
}
/* Outer pulsing aura */
.ycal-day.ycal-today::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(139,92,246,.35) 0%,
    rgba(6,182,212,.18) 45%,
    transparent 75%
  );
  filter: blur(3px);
  animation: orbAura 2.6s ease-in-out infinite;
  z-index: -2;
  pointer-events: none;
}
@keyframes orbPulse {
  0%,100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.07);
    filter: brightness(1.18);
  }
}
@keyframes orbHaloRotate { to { transform: rotate(360deg); } }
@keyframes orbAura {
  0%,100% { opacity: .85; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.18); }
}

/* ─── KPI CARDS — centered + larger fonts (cosmic override) ─── */
.kpi {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  padding: 24px 16px 22px !important;
  gap: 4px !important;
}
.kpi .k-icon {
  width: 46px !important;
  height: 46px !important;
  border-radius: 12px !important;
  margin: 0 auto 12px !important;
}
.kpi .k-icon svg {
  width: 22px !important;
  height: 22px !important;
}
.kpi .k-label {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-size: 12px !important;
  letter-spacing: .8px !important;
  margin-bottom: 8px !important;
}
.kpi .k-val {
  font-size: 32px !important;
  line-height: 1.1 !important;
  margin-bottom: 6px !important;
}
.kpi .k-sub {
  font-size: 12px !important;
  justify-content: center !important;
}

/* ─── STAT KPI CARDS (analytics row, share .kpi but tighter) ─── */
.stat-kpi-row {
  grid-template-columns: repeat(5, 1fr) !important;
}
.stat-kpi {
  padding: 20px 14px !important;
  gap: 3px !important;
}
.stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px !important;
  flex-shrink: 0;
}
.stat-icon svg {
  width: 18px; height: 18px;
  animation: none !important;
}
.stat-val {
  font-size: 26px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
}
.stat-desc {
  font-size: 11px;
  color: var(--txt3);
  line-height: 1.4;
  margin-top: 2px;
  text-align: center;
}
@media (max-width: 1100px) {
  .stat-kpi-row { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 640px) {
  .stat-kpi-row { grid-template-columns: repeat(2, 1fr) !important; }
  .kpi .k-val { font-size: 26px !important; }
  .stat-val { font-size: 22px !important; }
  .kpi { padding: 20px 12px 18px !important; }
  .kpi .k-icon { width: 40px !important; height: 40px !important; margin-bottom: 10px !important; }
  .kpi .k-icon svg { width: 20px !important; height: 20px !important; }
}

/* ─── SYMBOLS SPLIT LAYOUT ─── */
.sym-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 0;
}
.sym-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@media (max-width: 900px) {
  .sym-split { grid-template-columns: 1fr; }
}

/* ─── TOP PERFORMERS ─── */
.perf-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 8px;
}
.perf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 9px;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(139,92,246,.06);
  transition: background .15s;
}
.perf-item:hover { background: rgba(139,92,246,.07); }
.perf-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  background: rgba(139,92,246,.14);
  color: var(--pur);
  position: relative;
}
/* #1 — Gold */
.perf-rank-1 {
  background: linear-gradient(135deg, #FFE082 0%, #FFB300 50%, #FF8F00 100%) !important;
  color: #3a2a00 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -2px 4px rgba(120,80,0,.4),
    0 0 0 1px rgba(255,193,7,.5),
    0 0 14px rgba(255,179,0,.55),
    0 4px 12px rgba(255,140,0,.35);
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
}
/* #2 — Silver */
.perf-rank-2 {
  background: linear-gradient(135deg, #F5F7FA 0%, #C0C7D1 50%, #8E96A3 100%) !important;
  color: #1f242c !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    inset 0 -2px 4px rgba(60,70,80,.35),
    0 0 0 1px rgba(192,199,209,.55),
    0 0 12px rgba(200,208,220,.45),
    0 4px 10px rgba(120,130,145,.3);
  text-shadow: 0 1px 0 rgba(255,255,255,.5);
}
/* #3 — Bronze */
.perf-rank-3 {
  background: linear-gradient(135deg, #E8B289 0%, #C77B4D 50%, #8B4513 100%) !important;
  color: #2a1505 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.5),
    inset 0 -2px 4px rgba(80,40,15,.45),
    0 0 0 1px rgba(199,123,77,.55),
    0 0 12px rgba(199,123,77,.5),
    0 4px 10px rgba(139,69,19,.35);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.perf-name { flex: 1; font-weight: 600; font-size: 13px; color: var(--txt); }
.perf-pnl { font-weight: 700; font-size: 13px; }

/* ─── COVERAGE STATS ─── */
.cov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
  padding: 4px 0 8px;
}
.cov-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--txt3);
  margin-bottom: 3px;
}
.cov-val {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--txt);
}
.cov-val-grn { color: var(--grn) !important; }
.cov-val-red { color: var(--red) !important; }
.cov-val-pur { color: var(--pur) !important; }

/* ─── MOBILE: collapsible journal filters ─── */
.filter-toggle { display: none; }
@media (max-width: 640px) {
  .filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 14px;
    padding: 12px 14px;
    background:
      linear-gradient(180deg, rgba(18,22,46,.88), rgba(13,16,35,.92)) padding-box,
      var(--cs-border-grad) border-box;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--txt2);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: color .2s, transform .15s;
  }
  .filter-toggle svg { color: var(--cs-pur); flex-shrink: 0; }
  .filter-toggle::after {
    content: "▾";
    margin-left: auto;
    color: var(--cs-pur);
    transition: transform .2s;
  }
  .filter-toggle.open::after { transform: rotate(180deg); }
  .filter-toggle:active { transform: scale(.98); }
  .filters {
    display: none !important;
    margin-bottom: 14px;
    padding: 12px;
    background: rgba(18,22,46,.55);
    border: 1px solid rgba(139,92,246,.16);
    border-radius: 12px;
    backdrop-filter: blur(8px);
  }
  .filters.open { display: flex !important; flex-direction: column; gap: 10px; }
}

/* ─── BALANCE FLASH (on sync change) ─── */
@keyframes cs-flash-up {
  0%   { color: var(--grn); text-shadow: 0 0 16px rgba(16,185,129,.85), 0 0 32px rgba(16,185,129,.5); }
  100% { color: inherit;     text-shadow: none; }
}
@keyframes cs-flash-down {
  0%   { color: var(--red); text-shadow: 0 0 16px rgba(244,63,94,.85), 0 0 32px rgba(244,63,94,.5); }
  100% { color: inherit;     text-shadow: none; }
}
.bv-flash-up   { animation: cs-flash-up   1.1s ease-out; }
.bv-flash-down { animation: cs-flash-down 1.1s ease-out; }

/* ─── SKELETON LOADERS ─── */
@keyframes cs-skel-shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.cs-skel {
  background:
    linear-gradient(90deg,
      rgba(139,92,246,.06) 0%,
      rgba(139,92,246,.18) 50%,
      rgba(139,92,246,.06) 100%);
  background-size: 200% 100%;
  animation: cs-skel-shimmer 1.4s linear infinite;
  border-radius: 8px;
  display: block;
  color: transparent !important;
  border-color: transparent !important;
  pointer-events: none;
}
.cs-skel-kpi {
  height: 96px;
  border-radius: 14px;
  border: 1px solid rgba(139,92,246,.14);
  background:
    linear-gradient(90deg,
      rgba(18,22,46,.6) 0%,
      rgba(139,92,246,.18) 50%,
      rgba(18,22,46,.6) 100%);
  background-size: 200% 100%;
  animation: cs-skel-shimmer 1.4s linear infinite;
  backdrop-filter: blur(10px);
}
@media (max-width: 640px) {
  .cs-skel-kpi { height: 78px; }
}

/* ============================================================
   Collapsible cards with shooting-star reveal
   ============================================================ */
.cs-fold {
  position: relative;
  overflow: hidden;
  padding: 0;
}
.cs-fold-head {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  border-radius: inherit;
  transition: background .25s ease;
}
.cs-fold-head:hover {
  background: rgba(139, 92, 246, 0.05);
}
.cs-fold-head h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #E2E8F0;
  font-weight: 700;
}
.cs-fold-chev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 14px;
  color: var(--cs-pur, #8B5CF6);
  background: rgba(139, 92, 246, 0.10);
  border: 1px solid rgba(139, 92, 246, 0.28);
  text-shadow: 0 0 8px rgba(139, 92, 246, 0.7);
  transition: transform .35s cubic-bezier(.4,0,.2,1), background .25s ease;
}
.cs-fold.is-open .cs-fold-chev {
  transform: rotate(180deg);
  background: rgba(139, 92, 246, 0.20);
}

.cs-fold-body {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height .7s cubic-bezier(.42, 0, .32, 1),
    opacity .55s ease .1s,
    padding .7s cubic-bezier(.42, 0, .32, 1);
  padding: 0 18px;
}
.cs-fold.is-open .cs-fold-body {
  max-height: 900px;
  opacity: 1;
  padding: 4px 18px 18px;
}
/* Calendar is taller than charts */
.cs-fold[data-fold$="-cal"].is-open .cs-fold-body {
  max-height: 1600px;
}

/* badge + chevron grouping inside fold head */
.cs-fold-end {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* ----- shooting projectile (diagonal meteor base) ----- */
.cs-fold-projectile {
  position: absolute;
  top: 48px;
  right: 30px;
  width: 3px;
  height: 110px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  transform-origin: top center;
}
.cs-fold-projectile::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, #fff 0%, rgba(255,255,255,.7) 40%, transparent 70%);
}

.cs-fold-meteor.is-launching .cs-fold-projectile {
  animation: cs-meteor-fall .72s cubic-bezier(.42, 0, .32, 1) forwards;
}
@keyframes cs-meteor-fall {
  0%   { opacity: 0; transform: translate(0, -10px) rotate(18deg); }
  12%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-200px, 360px) rotate(18deg); }
}

/* ----- color variants ----- */
/* Default (no modifier): magenta-purple */
.cs-fold-meteor .cs-fold-projectile {
  background: linear-gradient(to bottom,
    rgba(255,255,255,.98) 0%,
    rgba(255,200,235,.9) 15%,
    rgba(236,72,153,.75) 40%,
    rgba(139,92,246,.5) 70%,
    transparent 100%);
  filter: drop-shadow(0 0 10px rgba(236,72,153,.6));
}
.cs-fold-meteor .cs-fold-projectile::before {
  box-shadow:
    0 0 12px 3px rgba(255,255,255,.95),
    0 0 24px 8px rgba(236,72,153,.7),
    0 0 38px 14px rgba(139,92,246,.35);
}

/* Gold — for "PnL by Hour" (sun-like) */
.cs-fold-meteor.cs-fold-gold .cs-fold-projectile {
  background: linear-gradient(to bottom,
    rgba(255,255,255,.98) 0%,
    rgba(255,236,180,.9) 14%,
    rgba(251,191,36,.78) 38%,
    rgba(245,158,11,.55) 65%,
    transparent 100%);
  filter: drop-shadow(0 0 10px rgba(251,191,36,.7));
}
.cs-fold-meteor.cs-fold-gold .cs-fold-projectile::before {
  box-shadow:
    0 0 12px 3px rgba(255,255,255,.95),
    0 0 24px 8px rgba(251,191,36,.75),
    0 0 38px 14px rgba(245,158,11,.4);
}

/* Emerald — for Calendar (cool aurora-cyan) */
.cs-fold-meteor.cs-fold-emerald .cs-fold-projectile {
  background: linear-gradient(to bottom,
    rgba(255,255,255,.98) 0%,
    rgba(190,255,235,.9) 14%,
    rgba(52,211,153,.78) 38%,
    rgba(6,182,212,.55) 65%,
    transparent 100%);
  filter: drop-shadow(0 0 10px rgba(52,211,153,.7));
}
.cs-fold-meteor.cs-fold-emerald .cs-fold-projectile::before {
  box-shadow:
    0 0 12px 3px rgba(255,255,255,.95),
    0 0 24px 8px rgba(52,211,153,.75),
    0 0 38px 14px rgba(6,182,212,.4);
}

@media (prefers-reduced-motion: reduce) {
  .cs-fold-body { transition: max-height .2s ease, opacity .2s ease, padding .2s ease; }
  .cs-fold-projectile { display: none; }
  .cs-fold-chev { transition: transform .15s ease; }

  /* Decorative infinite animations — silenced for users who ask for less motion.
     (Functional spinner #syncBtn.syncing is intentionally kept.) */
  .aurora-blob,
  .sb-logo h1,
  .calc-hero-txt h2,
  .nav-i.active::after,
  .k-icon svg,
  .kpi-ring-wrap svg,
  .calc-result,
  .cal-today-dot,
  .ycal-day.ycal-today,
  .ycal-day.ycal-today::before,
  .ycal-day.ycal-today::after,
  .cs-equity-card .apexcharts-point-annotations circle,
  .cs-skel,
  .cs-skel-kpi {
    animation: none !important;
  }
  /* One-shot entrance animations — jump straight to final state */
  .page.active,
  .kpi,
  .cosmic-card { animation: none !important; }
}

@media (max-width: 640px) {
  .cs-fold-projectile { right: 24px; }
  .cs-fold.is-open .cs-fold-body { max-height: 1100px; }
  .cs-fold[data-fold$="-cal"].is-open .cs-fold-body { max-height: 2400px; }
}

/* ============================================================
   Equity Curve — hook visual: neon glow + endpoint pulse
   ============================================================ */
.cs-equity-card {
  position: relative;
}
/* Stroke + area glow (CT default = purple→cyan) */
.cs-equity-card .apexcharts-area {
  filter:
    drop-shadow(0 0 6px rgba(139, 92, 246, .55))
    drop-shadow(0 0 16px rgba(139, 92, 246, .25));
}
.cs-equity-card .apexcharts-line,
.cs-equity-card .apexcharts-graphical .apexcharts-series path[stroke] {
  filter:
    drop-shadow(0 0 4px rgba(196, 181, 253, .7))
    drop-shadow(0 0 10px rgba(139, 92, 246, .55))
    drop-shadow(0 0 22px rgba(6, 182, 212, .32));
}
/* Noblemarkpo variant — cyan→emerald */
.cs-equity-card.cs-eq-cyan .apexcharts-area {
  filter:
    drop-shadow(0 0 6px rgba(6, 182, 212, .55))
    drop-shadow(0 0 16px rgba(6, 182, 212, .25));
}
.cs-equity-card.cs-eq-cyan .apexcharts-line,
.cs-equity-card.cs-eq-cyan .apexcharts-graphical .apexcharts-series path[stroke] {
  filter:
    drop-shadow(0 0 4px rgba(165, 243, 252, .7))
    drop-shadow(0 0 10px rgba(6, 182, 212, .55))
    drop-shadow(0 0 22px rgba(52, 211, 153, .32));
}

/* Pulsing endpoint marker (annotation point) — only the endpoint, not the
   best/worst trade markers which share the point-annotations group. */
.cs-equity-card .apexcharts-point-annotations circle.cs-eq-endpoint {
  transform-box: fill-box;
  transform-origin: center;
  animation: cs-eq-pulse 1.8s ease-in-out infinite;
}
@keyframes cs-eq-pulse {
  0%, 100% { r: 5; filter: drop-shadow(0 0 6px rgba(34, 211, 238, .9)); }
  50%      { r: 8; filter: drop-shadow(0 0 14px rgba(34, 211, 238, 1)); }
}
.cs-equity-card.cs-eq-cyan .apexcharts-point-annotations circle.cs-eq-endpoint {
  animation: cs-eq-pulse-em 1.8s ease-in-out infinite;
}
@keyframes cs-eq-pulse-em {
  0%, 100% { r: 5; filter: drop-shadow(0 0 6px rgba(52, 211, 153, .9)); }
  50%      { r: 8; filter: drop-shadow(0 0 14px rgba(52, 211, 153, 1)); }
}

/* Endpoint label sheen */
.cs-equity-card .apexcharts-point-annotation-label rect {
  rx: 6;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, .35));
}
.cs-equity-card.cs-eq-cyan .apexcharts-point-annotation-label rect {
  filter: drop-shadow(0 0 8px rgba(52, 211, 153, .35));
}

/* Extended badge — bigger pill with subtle glow */
.cs-eq-badge {
  font-size: 13px !important;
  padding: 6px 12px !important;
  letter-spacing: .3px;
  font-weight: 700;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .04),
    0 0 0 1px rgba(34, 211, 238, .14),
    0 4px 18px rgba(34, 211, 238, .14);
  backdrop-filter: blur(8px);
}
@media (max-width: 640px) {
  .cs-eq-badge { font-size: 12px !important; padding: 5px 10px !important; }
}

/* ===== Cabinet (client wallet) ===== */
.cb-demobar{display:flex;align-items:center;gap:9px;margin-bottom:16px;padding:9px 14px;border:1px solid var(--amb-bg);background:var(--amb-bg);border-radius:12px;color:var(--amb);font-size:12.5px;font-weight:500}
.cb-demodot{width:7px;height:7px;border-radius:50%;background:var(--amb);box-shadow:0 0 8px var(--amb);animation:cbpulse 2s ease-in-out infinite;flex:none}
@keyframes cbpulse{0%,100%{opacity:1}50%{opacity:.35}}
.cb-hero{background:linear-gradient(135deg,var(--blu-bg),var(--pur-bg)),var(--card)}
.cb-hero-top{display:flex;align-items:center;justify-content:space-between}
.cb-hero-label{font-size:13px;color:var(--txt3);font-weight:500}
.cb-eye{background:transparent;border:1px solid var(--brd);border-radius:9px;width:34px;height:34px;cursor:pointer;font-size:15px;line-height:1;transition:background .15s}
.cb-eye:hover{background:var(--card-h)}
.cb-balance{font-size:46px;font-weight:800;color:var(--txt);font-variant-numeric:tabular-nums;letter-spacing:-1px;margin:6px 0 14px}
.cb-hero-row{display:flex;flex-wrap:wrap;gap:28px}
.cb-hero-stat{display:flex;flex-direction:column;gap:3px}
.cb-hs-label{font-size:11.5px;color:var(--txt3)}
.cb-hs-val{font-size:18px;font-weight:700;color:var(--txt);font-variant-numeric:tabular-nums}
.cb-hs-val.muted{color:var(--txt2)}
.cb-hs-val.pos{color:var(--grn)} .cb-hs-val.neg{color:var(--red)}
.cb-hero-note{margin-top:14px;font-size:11.5px;color:var(--txt3)}
.section.cabinet-private .cb-money{filter:blur(10px);user-select:none;transition:filter .2s}
.cb-trades-summary{display:flex;flex-wrap:wrap;gap:26px}
.cb-chip{display:flex;flex-direction:column;gap:2px}
.cb-chip-v{font-size:22px;font-weight:700;color:var(--txt);font-variant-numeric:tabular-nums}
.cb-chip-v.pos{color:var(--grn)} .cb-chip-v.neg{color:var(--red)}
.cb-chip-l{font-size:11px;color:var(--txt3)}
/* login gate */
.cb-login{display:flex;justify-content:center;align-items:flex-start;padding:40px 16px}
.cb-login-card{width:100%;max-width:360px;display:flex;flex-direction:column;align-items:stretch;gap:12px;text-align:center;padding:32px 26px}
.cb-login-ico{font-size:34px;line-height:1}
.cb-login-card h2{margin:4px 0 0;font-size:20px;color:var(--txt)}
.cb-login-sub{margin:0 0 8px;font-size:12.5px;color:var(--txt3)}
.cb-input{width:100%;padding:11px 13px;border:1px solid var(--brd);border-radius:10px;background:var(--card-h);color:var(--txt);font-size:14px;outline:none;transition:border-color .15s}
.cb-input:focus{border-color:var(--pur)}
.cb-login-btn{width:100%;justify-content:center;margin-top:4px;padding:11px}
.cb-login-err{font-size:12.5px;color:var(--red);background:var(--red-bg);border-radius:8px;padding:8px 10px}
.cb-loggedbar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px;font-size:12px;color:var(--txt3)}
.cb-logout{background:transparent;border:1px solid var(--brd);border-radius:8px;color:var(--txt2);font-size:12px;padding:5px 12px;cursor:pointer;transition:background .15s}
.cb-logout:hover{background:var(--card-h);color:var(--txt)}
@media(max-width:640px){
  .cb-balance{font-size:36px}
  .cb-hero-row{gap:18px}
  .cb-trades-summary{gap:18px}
}

