:root{
  --bg: #070A12;
  --card: rgba(12, 16, 32, .72);
  --card2: rgba(10, 14, 28, .55);
  --text: #E9EEFF;
  --muted: rgba(233,238,255,.65);

  --cyan: #55F6FF;
  --mag:  #FF4DFF;
  --vio:  #7C5CFF;
  --good: #4CFF9A;
  --bad:  #FF4D6D;
  --warn: #FFD166;
  --gold: #F5C542;

  --border: rgba(255,255,255,.10);
  --border2: rgba(255,255,255,.06);

  --shadow: 0 10px 30px rgba(0,0,0,.55);
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";

  /* panels */
  --panelH: 520px;      /* desktop cards height (chart+trades) */
  --chartInnerH: 420px; /* desktop canvas height */
}

@media (max-width: 980px){
  :root{
    --panelH: 460px;
    --chartInnerH: 360px;
  }
}

*{ box-sizing: border-box; }
html, body { height: 100%; }

body{
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% 20%, rgba(124,92,255,.16), transparent 60%),
    radial-gradient(800px 520px at 85% 30%, rgba(85,246,255,.12), transparent 60%),
    radial-gradient(900px 580px at 60% 90%, rgba(255,77,255,.10), transparent 65%),
    var(--bg);
  overflow-x: hidden;
}

/* background layers */
.bg-grid{
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 46px 46px;
  opacity: .20;
  pointer-events: none;
  mask-image: radial-gradient(circle at 50% 30%, rgba(0,0,0,1), rgba(0,0,0,0));
}

.bg-glow{
  position: fixed; inset: -60px;
  background: radial-gradient(closest-side at 50% 0%, rgba(85,246,255,.08), transparent 60%);
  filter: blur(18px);
  pointer-events: none;
}

/* topbar */
.topbar{
  position: sticky; top: 0;
  z-index: 10;
  padding: 18px 20px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  backdrop-filter: blur(10px);
  background: rgba(7,10,18,.55);
  border-bottom: 1px solid var(--border2);
}

.brand{ display:flex; align-items:center; gap: 12px; }

.logo{
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(85,246,255,.10), 0 0 28px rgba(85,246,255,.10);
  object-fit: contain;
}

.brand-title{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .4px;
  line-height: 1.1;
  text-shadow: 0 0 18px rgba(85,246,255,.20);
}
.brand-sub{
  font-size: 12px;
  color: var(--muted);
}

.controls{
  display:flex;
  align-items:center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.control{
  display:flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.control input{
  width: 180px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: rgba(255,255,255,.04);
  color: var(--text);
  outline: none;
}
.control.small input{ width: 110px; }

.btn{
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(85,246,255,.25);
  background: linear-gradient(135deg, rgba(85,246,255,.10), rgba(255,77,255,.08));
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(85,246,255,.06), 0 14px 30px rgba(0,0,0,.35);
}
.btn:hover{ filter: brightness(1.05); }
.btn.ghost{
  border-color: var(--border2);
  background: rgba(255,255,255,.04);
  box-shadow: none;
}

.pill{
  display:flex; align-items:center; gap: 10px;
  border: 1px solid var(--border2);
  background: rgba(255,255,255,.03);
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
}
.dot{
  width: 10px; height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.25);
  box-shadow: 0 0 12px rgba(255,255,255,.12);
}

/* ---- Topbar controls: keep one line, no huge wrap ---- */
.topbar .controls{
  display:flex;
  align-items:center;
  gap: 12px;
  flex-wrap: nowrap;           /* ✅ évite que ça fasse 2 lignes sur desktop */
  justify-content: flex-end;
}

/* Account chip inside topbar */
.top-acct{
  padding: 8px 10px;           /* ✅ compact */
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(12,16,32,.58), rgba(10,14,28,.30));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 22px rgba(0,0,0,.22);
}
.top-acct .acct-avatar{ width: 30px; height: 30px; }
.top-acct .acct-name{ font-size: 12.5px; }
.top-acct .acct-sub{ font-size: 11.5px; }
.top-acct .acct-action{
  padding: 7px 9px;
  font-size: 12px;
}

/* Mobile: topbar can wrap, chip takes full width if needed */
@media (max-width: 680px){
  .topbar{ padding: 14px 14px; }
  .topbar .controls{ flex-wrap: wrap; gap: 10px; }
  .top-acct{
    width: 100%;
    justify-content: space-between;
  }
  #statusPill{ order: 2; }
  #acctChip{ order: 1; }
}



/* layout */
.layout{
  max-width: 1250px;
  margin: 22px auto 36px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}

@media (max-width: 680px){
  .layout{ margin: 14px auto 28px; }
}

.card{
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* account chip (base) */
.acct-chip{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  box-shadow: 0 0 0 1px rgba(85,246,255,.05);
}
.acct-avatar{
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  object-fit: cover;
}
.acct-text{ display:flex; flex-direction:column; line-height:1.1; }
.acct-name{ font-weight: 900; font-size: 13px; letter-spacing:.2px; }
.acct-sub{ font-size: 12px; color: rgba(233,238,255,.65); }
.acct-action{
  margin-left: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(85,246,255,.25);
  background: linear-gradient(135deg, rgba(85,246,255,.10), rgba(255,77,255,.08));
  color: var(--text);
  font-weight: 800;
  cursor:pointer;
}
.acct-action:hover{ filter: brightness(1.06); }



/* ===== Modern SaaS User Bar ===== */
.userbar{
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  padding: 10px 0;
  margin-bottom: 12px;  /* ✅ séparation KPIs */
}
.userbar.hidden{ display: none !important; }

.userbar-inner{
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(12,16,32,.65), rgba(10,14,28,.35));
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

/* CTA buttons */
.ub-cta{
  position: relative;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(233,238,255,.92);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 900;
  letter-spacing: .4px;
  cursor: pointer;
  overflow: hidden;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}
.ub-deposit{
  border-color: rgba(85,246,255,.30);
  box-shadow: 0 0 0 1px rgba(85,246,255,.08), 0 18px 34px rgba(0,0,0,.35);
}
.ub-withdraw{
  border-color: rgba(255,209,102,.35);
  background: rgba(255,209,102,.05);
  color: rgba(255,239,200,.95);
  box-shadow: 0 0 0 1px rgba(255,209,102,.10), 0 14px 28px rgba(0,0,0,.35);
}
.ub-ref{ border-color: rgba(255,77,255,.25); }

.ub-cta-glow{
  position: absolute;
  inset: -60px;
  background:
    radial-gradient(closest-side at 30% 50%, rgba(85,246,255,.18), transparent 65%),
    radial-gradient(closest-side at 70% 50%, rgba(255,77,255,.10), transparent 70%);
  opacity: .55;
  transform: translateX(-8%);
  animation: ubGlow 2.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ubGlow{
  0%,100%{ transform: translateX(-8%); opacity:.40; }
  50%{ transform: translateX(8%); opacity:.70; }
}
.ub-cta-text{ position: relative; z-index: 1; }

.ub-chips{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}
.ub-chip{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  display: grid;
  gap: 6px;
  min-width: 0;
}
.ub-chip-label{
  font-size: 11px;
  color: rgba(233,238,255,.60);
}
.ub-chip-value{
  font-size: 14px;
  font-weight: 900;
  color: rgba(233,238,255,.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ub-cta:hover, .ub-chip:hover{ filter: brightness(1.06); }

/* responsive userbar (NO top offset) */
@media (max-width: 980px){
  .userbar{ padding: 6px 0; margin-bottom: 10px; }
  .userbar-inner{
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "deposit referral"
      "chips chips";
  }
  #depositBtn{ grid-area: deposit; }
  #referralBtn{ grid-area: referral; }
  .ub-chips{
    grid-area: chips;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px){
  .userbar-inner{ padding: 10px; gap: 10px; }
  .ub-cta{ min-height: 40px; padding: 9px 12px; }
  .ub-chip{ padding: 9px 10px; }
}

@media (max-width: 520px){
  .ub-chips{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ub-chip:nth-child(3){ grid-column: 1 / -1; }
}

/* ===== Hover: thicker border (no layout shift) ===== */
.ub-cta{
  transition: filter .12s ease, transform .12s ease, box-shadow .12s ease;
}

/* deposit hover = cyan border thicker */
.ub-deposit:hover{
  box-shadow:
    0 0 0 2px rgba(85,246,255,.55) inset,   /* "border" thicker */
    0 0 0 1px rgba(85,246,255,.10),         /* keep your existing feel */
    0 18px 34px rgba(0,0,0,.35);            /* keep depth */
}

/* withdraw hover = gold border thicker */
.ub-withdraw:hover{
  box-shadow:
    0 0 0 2px rgba(245,197,66,.55) inset,
    0 0 0 1px rgba(255,209,102,.10),
    0 14px 28px rgba(0,0,0,.35);
}


/* KPIs */
.kpis{
  grid-column: 1 / -1;
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.05);
}
.kpi{
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, rgba(10,14,28,.70), rgba(10,14,28,.45));
}
.kpi-label{ font-size: 12px; color: var(--muted); }
.kpi-value{
  margin-top: 8px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .2px;
}
.kpi-sub{ margin-top: 6px; font-size: 12px; color: var(--muted); }
.mono{ font-family: var(--mono); }

.card-head{
  padding: 14px 16px;
  display:flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border2);
}
.card-title{ font-weight: 900; letter-spacing: .2px; }
.card-sub{ margin-top: 4px; font-size: 12px; color: var(--muted); }

/* chart + trades cards forced equal height */
.card.chart, .card.trades{
  height: var(--panelH);
  display:flex;
  flex-direction: column;
}
.card.chart .chartWrap{
  position: relative;
  height: var(--chartInnerH);
  flex: 0 0 auto;
}
#chartCanvas{
  width: 100%;
  height: 100%;
  display:block;
  background:
    radial-gradient(600px 280px at 20% 20%, rgba(85,246,255,.08), transparent 60%),
    radial-gradient(680px 320px at 80% 40%, rgba(255,77,255,.07), transparent 60%),
    rgba(0,0,0,.15);
}

/* chart top controls */
.chartTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.tabs{
  display:flex;
  gap:8px;
  padding:6px;
  border-radius:14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 0 24px rgba(85,246,255,.05);
}
.tab{
  cursor:pointer;
  padding:8px 10px;
  border-radius:12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.18);
  color: rgba(233,238,255,.85);
  font-weight: 600;
}
.tab.active{
  border-color: rgba(85,246,255,.35);
  box-shadow: 0 0 18px rgba(85,246,255,.15);
}

/* tooltip */
.chartTooltip, #chartTooltip{
  position:absolute;
  pointer-events:none;
  z-index: 5;
  padding:8px 10px;
  border-radius:12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,12,18,.88);
  color: rgba(233,238,255,.92);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 12px;
  box-shadow: 0 0 24px rgba(85,246,255,.10);
  white-space: nowrap;
}
#chartTooltip{
  display:none;
  white-space:pre;
  line-height:1.25;
}

/* trades table scroll inside */
.card.trades{ display:flex; flex-direction: column; }
.card.trades .table-wrap{
  flex: 1;
  min-height: 0;
  height: auto;
  overflow: auto;
}

/* ratio bar */
.ratioBar{
  margin-top: 10px;
  display:flex;
  align-items:center;
  gap:10px;
}
.ratioTrack{
  flex:1;
  height: 12px;
  border-radius: 999px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  display:flex;
}
.ratioFillSol{ width:50%; background: rgba(124,92,255,.85); }
.ratioFillUsdc{ width:50%; background: rgba(85,246,255,.85); }
.ratioLeft, .ratioRight{
  display:flex;
  align-items:center;
  gap:8px;
  color: rgba(233,238,255,.85);
}
.coin{
  width:18px;
  height:18px;
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(255,255,255,.08);
}

/* tables */
table{ width: 100%; border-collapse: collapse; font-size: 12px; }
th, td{
  padding: 10px 10px;
  border-bottom: 1px solid var(--border2);
  vertical-align: top;
  white-space: nowrap;
}
th{
  text-align:left;
  color: rgba(233,238,255,.78);
  font-weight: 800;
  background: rgba(255,255,255,.03);
  position: sticky;
  top: 0;
}
td{ color: rgba(233,238,255,.88); }
td.mono{ max-width: 170px; overflow:hidden; text-overflow: ellipsis; }

.right{ display:flex; align-items:center; gap: 10px; }
.mini{ font-size: 12px; color: var(--muted); }

.badge{
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  font-weight: 800;
}
.badge.buy{ border-color: rgba(76,255,154,.35); color: var(--good); background: rgba(76,255,154,.06); }
.badge.sell{ border-color: rgba(255,77,109,.35); color: var(--bad); background: rgba(255,77,109,.06); }

/* terminal */
.terminal{ grid-column: 1 / -1; }
.terminal-controls{ display:flex; align-items:center; gap: 10px; }
.terminal-box{
  padding: 14px 16px 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  height: 380px;
  overflow:auto;
  background: rgba(0,0,0,.28);
}
.line{ padding: 2px 0; display:flex; gap: 10px; }
.ts{ color: rgba(233,238,255,.55); width: 210px; flex: 0 0 auto; }
.msg{ flex: 1 1 auto; }

.tag{
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  color: rgba(233,238,255,.75);
  margin-right: 8px;
}
.tag.tick{ border-color: rgba(85,246,255,.25); color: var(--cyan); background: rgba(85,246,255,.05); }
.tag.trade{ border-color: rgba(255,77,255,.25); color: var(--mag); background: rgba(255,77,255,.05); }
.tag.info{ border-color: rgba(124,92,255,.25); color: var(--vio); background: rgba(124,92,255,.05); }
.tag.warn{ border-color: rgba(255,209,102,.28); color: var(--warn); background: rgba(255,209,102,.05); }
.tag.err{ border-color: rgba(255,77,109,.28); color: var(--bad); background: rgba(255,77,109,.05); }

@media (max-width: 680px){
  .terminal-box .ts{
    width: 48px;
    font-size: 11px;
    white-space: nowrap;
    opacity: .85;
  }
}

/* footer */
.footer{
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 18px 24px;
  display:flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: rgba(233,238,255,.55);
}

/* global responsive */
@media (max-width: 1050px){
  .layout{ grid-template-columns: 1fr; }
  .kpis{ grid-template-columns: repeat(2, 1fr); }
}

/* ===== Toasts ===== */
.toast-host{
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display:flex;
  flex-direction:column;
  gap:10px;
  pointer-events:none;
}
.toast{
  pointer-events:none;
  min-width: 260px;
  max-width: 360px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,12,18,.88);
  backdrop-filter: blur(12px);
  box-shadow: 0 0 24px rgba(85,246,255,.12), 0 18px 50px rgba(0,0,0,.45);
  animation: toastIn .22s ease-out;
}
.toast .t1{ font-weight: 900; letter-spacing:.2px; }
.toast .t2{ margin-top:4px; color: rgba(233,238,255,.72); font-size:12px; }
.toast.ok{ border-color: rgba(76,255,154,.28); box-shadow: 0 0 24px rgba(76,255,154,.12), 0 18px 50px rgba(0,0,0,.45); }
.toast.err{ border-color: rgba(255,77,109,.28); box-shadow: 0 0 24px rgba(255,77,109,.12), 0 18px 50px rgba(0,0,0,.45); }
.toast.warn{ border-color: rgba(255,209,102,.28); box-shadow: 0 0 24px rgba(255,209,102,.12), 0 18px 50px rgba(0,0,0,.45); }
@keyframes toastIn{
  from{ transform: translateY(-8px); opacity:0; }
  to{ transform: translateY(0); opacity:1; }
}

@media (max-width: 520px){
  .toast-host{ left: 12px; right: 12px; top: 12px; }
  .toast{ min-width: unset; max-width: unset; width: 100%; }
}

/* ===== Modal ===== */
.modal-backdrop{
  position: fixed;
  inset: 0;
  z-index: 9998;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
}
.modal-backdrop.hidden{ display:none; }

.modal{
  width: min(560px, 100%);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(12,16,32,.92), rgba(10,14,28,.72));
  box-shadow: 0 0 0 1px rgba(85,246,255,.10), 0 30px 90px rgba(0,0,0,.65);
  overflow:hidden;
}
.neon-pop{ animation: popIn .18s ease-out; }
@keyframes popIn{
  from{ transform: translateY(8px) scale(.985); opacity:0; }
  to{ transform: translateY(0) scale(1); opacity:1; }
}

.modal-head{
  padding: 16px 16px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.modal-title{
  font-size: 18px;
  font-weight: 950;
  letter-spacing:.2px;
  text-shadow: 0 0 18px rgba(85,246,255,.18);
}
.modal-sub{ margin-top:4px; font-size:12px; color: rgba(233,238,255,.68); }

.icon-btn{
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(233,238,255,.88);
  cursor:pointer;
}
.icon-btn:hover{ filter: brightness(1.08); }

.auth-grid{
  padding: 14px 16px 16px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.auth-btn{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  cursor:pointer;
  text-decoration:none;
  color: inherit;
  transition: transform .12s ease, filter .12s ease, border-color .12s ease;
}
.auth-btn:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
  border-color: rgba(85,246,255,.22);
}
.auth-btn img{
  width: 34px; height: 34px;
  border-radius: 12px;
  object-fit: contain;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}
.auth-btn-title{ font-weight: 900; letter-spacing:.2px; }
.auth-btn-sub{ margin-top:2px; font-size: 12px; color: rgba(233,238,255,.68); }
.chev{
  margin-left:auto;
  font-size: 18px;
  color: rgba(233,238,255,.55);
}
.modal-foot{
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.fine{ font-size: 12px; }
.fine.muted{ color: rgba(233,238,255,.58); margin-top:6px; }

/* ===== Deposit modal ===== */
.modal-wide{ max-width: 640px; }
.dep-body{ padding: 14px 14px 18px; }

.dep-card{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(10,12,18,.62);
  border-radius: 18px;
  padding: 14px;
  box-shadow:
    0 0 0 1px rgba(85,246,255,.10) inset,
    0 18px 55px rgba(0,0,0,.45);
  position: relative;
  overflow: hidden;
}
.dep-card:before{
  content:"";
  position:absolute; inset:-60px;
  background:
    radial-gradient(closest-side, rgba(255,77,255,.18), transparent 70%),
    radial-gradient(closest-side, rgba(85,246,255,.14), transparent 70%);
  filter: blur(18px);
  opacity:.9;
  pointer-events:none;
}

.dep-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  position:relative;
  z-index:1;
}
.dep-label{
  font-weight: 700;
  letter-spacing:.2px;
  color: rgba(233,238,255,.85);
}
.dep-actions{ display:flex; gap:10px; }

.mini-btn{
  height: 38px;
  width: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(233,238,255,.85);
  cursor:pointer;
  display:grid;
  place-items:center;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
}
.mini-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(85,246,255,.32);
  background: rgba(85,246,255,.08);
}
.mini-btn:active{ transform: translateY(0px) scale(.98); }
.mini-btn img{ width: 18px; height: 18px; opacity: .92; }

.dep-address{
  position:relative;
  z-index:1;
  margin-top: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.25);
  word-break: break-all;
  font-size: 13.5px;
  line-height: 1.25;
  box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset;
}

.dep-hint{
  position:relative;
  z-index:1;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
}
.hint-line{
  font-size: 12.5px;
  color: rgba(233,238,255,.75);
  margin: 4px 0;
}
.hint-line.warn{
  color: rgba(255,209,102,.95);
  text-shadow: 0 0 18px rgba(255,209,102,.15);
}

.dep-stats{
  position:relative;
  z-index:1;
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dep-stat{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  padding: 10px 12px;
}
.dep-stat-label{
  font-size: 12px;
  color: rgba(233,238,255,.62);
}
.dep-stat-val{
  margin-top: 4px;
  font-size: 15px;
  color: rgba(233,238,255,.92);
}

@media (max-width: 560px){
  .modal-wide{ max-width: 94vw; }
  .dep-stats{ grid-template-columns: 1fr; }
  .mini-btn{ width: 42px; }
}

/* hide scrollbars */
*{ scrollbar-width: none; }
*::-webkit-scrollbar{ width: 0px; height: 0px; }
*::-webkit-scrollbar-thumb{ background: transparent; }


/* ===== Withdraw modal bits ===== */
.wd-input{
  width: 100%;
  margin-top: 10px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
  color: rgba(233,238,255,.92);
  outline: none;
  font-size: 14px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset;
}
.wd-input:focus{
  border-color: rgba(85,246,255,.28);
  box-shadow: 0 0 0 1px rgba(85,246,255,.10), 0 0 24px rgba(85,246,255,.08);
}

.wd-row2{ margin-top: 12px; }
.wd-field-label{ font-size: 12px; color: rgba(233,238,255,.70); }
.wd-field-sub{ margin-top: 6px; font-size: 12px; color: rgba(233,238,255,.58); }

.wd-actions{
  margin-top: 14px;
  display:flex;
  gap: 10px;
  justify-content: flex-end;
}
.wd-actions .btn{ min-width: 110px; }

.wd-confirm-line{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.wd-confirm-line:last-child{ border-bottom: none; }
.wd-confirm-k{ color: rgba(233,238,255,.70); font-size: 12px; }
.wd-confirm-v{ color: rgba(233,238,255,.92); font-weight: 900; font-size: 12px; }

@media (max-width: 560px){
  .wd-actions{ flex-direction: column; }
  .wd-actions .btn{ width: 100%; }
}



/* ===== Ultra-small phones (<= 370px) ===== */
@media (max-width: 370px){

  /* Topbar becomes 2 rows */
  .topbar{
    padding: 12px 12px;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
  }

  .brand{
    min-width: 0;
    gap: 10px;
  }
  .brand-text{ min-width: 0; }

  /* allow wrapping of brand lines */
  .brand-title{
    font-size: 16px;
    line-height: 1.05;
  }
  .brand-sub{
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 210px; /* prevents overflow on tiny widths */
  }

  /* Right side controls: take full width */
  .controls{
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  /* Status pill: shrink a lot */
  .pill{
    padding: 8px 10px;
    gap: 8px;
    font-size: 11px;
    max-width: 100%;
  }
  #statusText{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
  }

  /* Account chip: full width and compact */
  .acct-chip{
    width: 100%;
    border-radius: 14px;
    padding: 8px 10px;
    gap: 8px;
  }
  .acct-avatar{ width: 28px; height: 28px; }

  /* truncate long name/sub */
  .acct-text{
    min-width: 0;
    flex: 1 1 auto;
  }
  .acct-name,
  .acct-sub{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .acct-action{
    padding: 7px 9px;
    font-size: 12px;
    flex: 0 0 auto;
  }

  /* Userbar: stack buttons + chips to avoid horizontal overflow */
  .userbar-inner{
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  /* Deposit/Withdraw full width */
  .ub-cta{
    width: 100%;
    justify-content: center;
  }

  /* chips become 1 column on ultra small */
  .ub-chips{
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* reduce chip padding a bit */
  .ub-chip{
    padding: 9px 10px;
    border-radius: 14px;
  }
}


/* ===== Chart legend (swatches) ===== */
.legend{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap: 14px;
  flex-wrap: wrap;
  min-width: 0;
}

.legend-item{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.swatch{
  width: 10px;
  height: 10px;
  border-radius: 4px;
  display:inline-block;
  flex: 0 0 auto;
  box-shadow: 0 0 18px rgba(255,255,255,.10);
}

.swatch.s1{ background: var(--cyan); }
.swatch.s2{ background: var(--vio); }
.swatch.s3{ background: var(--mag); }


/* KPI value can contain an icon */
.kpi-value{
  margin-top: 8px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .2px;

  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

.kpi-icon{
  width: 18px;
  height: 18px;
  border-radius: 6px;
  object-fit: contain;
  transform: translateY(2px);
  box-shadow: 0 0 14px rgba(255,255,255,.10);
  opacity: .95;
}


/* ===== KPI value with icon ===== */
.kpi-value.with-icon{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* icône monétaire alignée avec le texte */
.kpi-value.with-icon img{
  width: 22px;          /* ✅ taille visuelle idéale */
  height: 22px;
  flex: 0 0 auto;
  transform: translateY(1px); /* ✅ alignement optique */
  filter: drop-shadow(0 0 6px rgba(255,255,255,.25));
}

/* un poil plus gros sur desktop large */
@media (min-width: 900px){
  .kpi-value.with-icon img{
    width: 24px;
    height: 24px;
  }
}

/* légèrement plus compact sur mobile */
@media (max-width: 520px){
  .kpi-value.with-icon img{
    width: 20px;
    height: 20px;
  }
}




/* ===== Trades table: sticky header that actually stays visible ===== */

/* le conteneur scroll doit être le parent sticky */
.card.trades .table-wrap,
.card.trades .trades-table-wrap{
  position: relative;      /* important pour z-index/sticky */
  overflow: auto;          /* scroll ici */
  min-height: 0;
}

/* sticky + collapse = glitch possible => separate */
.card.trades table{
  border-collapse: separate;
  border-spacing: 0;
}

/* applique sticky sur le header */
.card.trades thead th{
  position: sticky;
  top: 0;
  z-index: 10; /* ✅ au-dessus des rows */
  background: rgba(10, 14, 28, .92);   /* ✅ opaque */
  backdrop-filter: blur(10px);
}

/* petite séparation propre sous le header (optionnel mais clean) */
.card.trades thead th{
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}

/* KPIs: 4 colonnes desktop, 2 colonnes mobile */
.kpis{
  grid-column: 1 / -1;
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.05);
}

@media (max-width: 1050px){
  .kpis{ grid-template-columns: repeat(2, 1fr); }
}


/* refresh button spin */
.mini-btn.spin{
  animation: spin 0.9s linear infinite;
}
@keyframes spin { from{ transform: rotate(0deg);} to{ transform: rotate(360deg);} }

/* deposit success pop */
.dep-success{
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
}
.dep-success.hidden{ display:none; }

.dep-success-inner{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-radius:14px;
  background: rgba(10,12,18,.92);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 10px 40px rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
}

.dep-success-coin{
  width:28px;
  height:28px;
}
.dep-success-amt{
  font-size: 16px;
  font-weight: 700;
}
.dep-success-sub{
  font-size: 12px;
  opacity: .75;
}

.dep-success-tick{
  width:26px;
  height:26px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(76,255,154,.18);
  color: rgba(76,255,154,.95);
  border: 1px solid rgba(76,255,154,.35);
  box-shadow: 0 0 18px rgba(76,255,154,.22);
  font-weight: 900;
}

/* pop animation */
.dep-success.pop .dep-success-inner{
  animation: popIn .18s ease-out, popOut .22s ease-in 1.55s forwards;
}
@keyframes popIn{
  from{ transform: translateY(10px) scale(.98); opacity:0; }
  to{ transform: translateY(0) scale(1); opacity:1; }
}
@keyframes popOut{
  to{ transform: translateY(8px) scale(.99); opacity:0; }
}

.success-modal { max-width: 620px; }
.success-card { padding: 22px; }

.success-center{
  position: relative;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:10px;
  padding: 14px 8px 8px;
}

.success-amt{
  font-size: 44px;
  font-weight: 900;
  letter-spacing: .5px;
}

.success-coin img{
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 0 18px rgba(85,246,255,.25));
}

.success-tick{
  margin-top: 6px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 34px;
  font-weight: 900;
  color: rgba(10,12,18,.95);
  background: rgba(76,255,154,.92);
  box-shadow: 0 0 22px rgba(76,255,154,.25);
}

.success-meta{
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
}

.success-meta-label{
  font-size: 12px;
  color: rgba(233,238,255,.65);
  margin-bottom: 6px;
}

.success-meta-val{
  font-size: 14px;
  word-break: break-all;
  color: rgba(233,238,255,.92);
}

/* =========================================================
   USERBAR bottom row (Totals + History button)
   Add near your .userbar / .ub-chips section
   ========================================================= */
.ub-bottom{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px; /* optique */
}

.ub-totals{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.ub-t{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  padding: 10px 12px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.ub-t span{
  font-size: 11px;
  color: rgba(233,238,255,.60);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ub-t b{
  font-size: 12.5px;
  font-weight: 950;
  color: rgba(233,238,255,.92);
  white-space: nowrap;
}

/* History button: reuse mini-btn but more “SaaS” */
#historyBtn.mini-btn{
  width: auto;
  padding: 0 14px;
  gap: 8px;
  font-weight: 900;
  letter-spacing: .2px;
}
#historyBtn.mini-btn:before{
  content:"";
  width: 10px;
  height: 10px;
  border-radius: 6px;
  background: rgba(85,246,255,.75);
  box-shadow: 0 0 18px rgba(85,246,255,.18);
  display:inline-block;
  margin-right: 8px;
}

/* Responsive totals */
@media (max-width: 980px){
  .ub-bottom{
    flex-direction: column;
    align-items: stretch;
  }
  .ub-totals{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #historyBtn.mini-btn{
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 520px){
  .ub-totals{
    grid-template-columns: 1fr;
  }
}



/* =========================================================
   HISTORY modal list
   Add near your modal / deposit modal styles
   ========================================================= */
.history-list{
  position: relative;
  z-index: 1;
  display:flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow:auto;
  padding-right: 2px;
}

.hrow{
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  padding: 10px 12px;
  display:grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "t amt"
    "ts ts";
  gap: 6px 10px;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
}

.hrow b{
  grid-area: t;
  font-weight: 950;
  letter-spacing: .2px;
  color: rgba(233,238,255,.92);
}

.hrow .mono{
  grid-area: amt;
  font-weight: 950;
  color: rgba(233,238,255,.90);
}

.hrow .mini{
  grid-area: ts;
  font-size: 11.5px;
  color: rgba(233,238,255,.58);
}

/* Subtle type accents (optional but nice) */
.hrow[data-type="DEPOSIT"]{
  border-color: rgba(85,246,255,.18);
  box-shadow: 0 0 0 1px rgba(85,246,255,.06), 0 10px 22px rgba(0,0,0,.18);
}
.hrow[data-type="WITHDRAW"]{
  border-color: rgba(255,209,102,.20);
  box-shadow: 0 0 0 1px rgba(255,209,102,.06), 0 10px 22px rgba(0,0,0,.18);
}
.hrow[data-type="PROFIT"]{
  border-color: rgba(76,255,154,.18);
  box-shadow: 0 0 0 1px rgba(76,255,154,.06), 0 10px 22px rgba(0,0,0,.18);
}

@media (max-width: 560px){
  .history-list{ max-height: 58vh; }
}



/* =========================================================
   Withdraw input “quick buttons” row (MIN / 50% / MAX)
   Add near your withdraw modal bits
   ========================================================= */
.wd-quick{
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content: flex-end;
  gap: 8px;
}

.wd-qbtn{
  height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  color: rgba(233,238,255,.86);
  font-weight: 900;
  letter-spacing: .25px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
}
.wd-qbtn:hover{
  border-color: rgba(85,246,255,.28);
  background: rgba(85,246,255,.08);
}
.wd-qbtn:active{ transform: translateY(1px) scale(.99); }

.wd-qbtn.primary{
  border-color: rgba(85,246,255,.28);
  background: linear-gradient(135deg, rgba(85,246,255,.10), rgba(255,77,255,.06));
}

/* Disabled state for 0 available */
.wd-qbtn:disabled{
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.2);
  box-shadow: none;
}

/* Make MIN/MAX buttons consistent if you already have them */
.wd-quick .wd-qbtn{ min-width: 62px; }

@media (max-width: 560px){
  .wd-quick{ justify-content: space-between; }
  .wd-qbtn{ flex: 1 1 auto; }
}



/* =========================================================
   Withdraw “no funds” message emphasis (optional)
   If you display a text line in the modal
   ========================================================= */
.wd-empty{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,209,102,.22);
  background: rgba(255,209,102,.06);
  color: rgba(255,239,200,.92);
  font-size: 12.5px;
  box-shadow: 0 0 18px rgba(255,209,102,.10);
}

/* =========================================================
   USERBAR LAYOUT FIX (desktop 1-row + bottom row under)
   Paste at END of styles.css
   ========================================================= */

/* Desktop / large: deposit + chips + withdraw on same row,
   bottom row spans full width underneath */
.userbar-inner{
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "deposit chips withdraw"
    "bottom  bottom  bottom";
  align-items: center;
}

#depositBtn{ grid-area: deposit; }
.ub-chips{ grid-area: chips; }
#withdrawBtn{ grid-area: withdraw; }

/* Force the bottom block to be FULL-WIDTH under everything */
.ub-bottom{
  grid-area: bottom;
  width: 100%;
  margin-top: 10px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

/* Totals row: 3 cards on desktop */
.ub-totals{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

/* Make sure history doesn’t crush layout */
#historyBtn{
  flex: 0 0 auto;
  white-space: nowrap;
}

/* --- Tablet / Mobile behaviour --- */
@media (max-width: 720px){
  /* top row: deposit + withdraw side by side */
  .userbar-inner{
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "deposit withdraw"
      "chips   chips"
      "bottom  bottom";
    gap: 10px;
  }

  #depositBtn, #withdrawBtn{
    width: 100%;
    justify-content: center;
  }

  /* chips always in 3 columns (if room), otherwise will wrap via next rule */
  .ub-chips{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* bottom: totals then history full width under */
  .ub-bottom{
    flex-direction: column;
    align-items: stretch;
  }
  #historyBtn{
    width: 100%;
    justify-content: center;
  }
}

/* If really narrow: chips become 2+1, totals become 2x2 (or 2 then 1) */
@media (max-width: 520px){
  .ub-chips{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ub-chip:nth-child(3){
    grid-column: 1 / -1;
  }

  /* NEW totals responsive: 2x2 when possible */
  .ub-totals{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  /* 3 totals => third spans full width (clean) */
  .ub-t:nth-child(3){
    grid-column: 1 / -1;
  }
}

/* Ultra tiny: totals in 1 column */
@media (max-width: 360px){
  .ub-totals{
    grid-template-columns: 1fr;
  }
  .ub-t:nth-child(3){
    grid-column: auto;
  }
}

/* Fix: dot next to "History" (not above) */
#historyBtn.mini-btn{
  display: inline-flex;      /* override .mini-btn { display:grid } */
  align-items: center;
  justify-content: center;
  gap: 8px;                  /* spacing between dot and text */
  padding: 0 14px;
  width: auto;
}

#historyBtn.mini-btn:before{
  margin-right: 0;           /* use gap instead */
  transform: translateY(1px);/* tiny optical align */
}

/* ===== History empty state ===== */
.history-empty{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding: 38px 18px;
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,.12);
  background: rgba(255,255,255,.03);
  color: rgba(233,238,255,.75);
}

.history-empty-icon{
  font-size: 28px;
  margin-bottom: 10px;
  opacity: .9;
}

.history-empty-title{
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .2px;
  color: rgba(233,238,255,.92);
}

.history-empty-sub{
  margin-top: 6px;
  font-size: 12.5px;
  color: rgba(233,238,255,.65);
  max-width: 320px;
}

/* Green gains (same as "Gains") */
.ub-t.gain b{
  color: var(--good);
  text-shadow: 0 0 12px rgba(76,255,154,.25);
}


/* ===== Success modal – centered confirmation layout ===== */

.success-center{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 8px 8px;
}

/* Amount + coin inline */
.success-amount-row{
  display: flex;
  align-items: center;
  gap: 14px;
}

.success-amt{
  font-size: 44px;
  font-weight: 900;
  letter-spacing: .5px;
}

.success-coin-inline{
  width: 38px;
  height: 38px;
  filter: drop-shadow(0 0 18px rgba(85,246,255,.30));
}

/* SENT + tick inline */
.success-status-row{
  display: flex;
  align-items: center;
  gap: 10px;
}

.success-status-text{
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .6px;
  color: rgba(233,238,255,.75);
}

.success-tick-inline{
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: rgba(10,12,18,.95);
  background: rgba(76,255,154,.95);
  box-shadow: 0 0 18px rgba(76,255,154,.35);
}


.ub-chip-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.ub-refresh{
  width:34px;
  height:34px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;

  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.9);
  cursor:pointer;

  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.ub-refresh:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.18);
}

.ub-refresh:active{
  transform: translateY(0px) scale(0.98);
}

.ub-refresh.spin{
  animation: ubspin 0.9s linear infinite;
}

@keyframes ubspin{
  from{ transform: rotate(0deg); }
  to{ transform: rotate(360deg); }
}


/* ===== History modal ===== */
.history-list{
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.hrow{
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  grid-template-areas:
    "label amt"
    "ts    ts";
  gap: 6px 10px;

  padding: 12px 12px;
  border-radius: 16px;

  border: 2px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.18);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.05) inset,
    0 14px 40px rgba(0,0,0,.35);
}

.hrow b{
  grid-area: label;
  font-weight: 950;
  letter-spacing: .2px;
}
.hrow .h-amt{
  grid-area: amt;
  font-weight: 950;
  letter-spacing: .2px;
  text-align: right;
}
.hrow .mini{
  grid-area: ts;
  opacity: .9;
}

/* ===== DEPOSIT → GREEN ===== */
.hrow[data-type="DEPOSIT"]{
  border-color: color-mix(in srgb, var(--good) 55%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--good) 18%, transparent) inset,
    0 0 22px color-mix(in srgb, var(--good) 20%, transparent),
    0 14px 40px rgba(0,0,0,.35);
}
.hrow[data-type="DEPOSIT"] b,
.hrow[data-type="DEPOSIT"] .h-amt{
  color: var(--good);
}

/* ===== WITHDRAW → GOLD ===== */
.hrow[data-type="WITHDRAW"]{
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--gold) 18%, transparent) inset,
    0 0 22px color-mix(in srgb, var(--gold) 22%, transparent),
    0 14px 40px rgba(0,0,0,.35);
}
.hrow[data-type="WITHDRAW"] b,
.hrow[data-type="WITHDRAW"] .h-amt{
  color: var(--gold);
}

/* ===== PROFIT → GREEN (accentué) ===== */
.hrow[data-type="PROFIT"]{
  border-color: color-mix(in srgb, var(--good) 65%, transparent);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--good) 22%, transparent) inset,
    0 0 26px color-mix(in srgb, var(--good) 28%, transparent),
    0 14px 40px rgba(0,0,0,.35);
}
.hrow[data-type="PROFIT"] b,
.hrow[data-type="PROFIT"] .h-amt{
  color: var(--good);
}


/* ===== Guest card (not connected) ===== */
.guest-card{
  grid-column: 1 / -1;
  margin-bottom: 12px;
}
.guest-card.hidden{ display:none !important; }

.guest-card-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(180deg, rgba(12,16,32,.65), rgba(10,14,28,.35));
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0,0,0,.35);
}

.guest-left{ min-width: 0; }
.guest-title{
  font-weight: 950;
  font-size: 16px;
  letter-spacing: .2px;
  text-shadow: 0 0 18px rgba(85,246,255,.15);
}
.guest-sub{
  margin-top: 6px;
  color: rgba(233,238,255,.72);
  font-size: 12.5px;
  line-height: 1.35;
  max-width: 720px;
}
.guest-points{
  margin-top: 10px;
  display:grid;
  gap: 6px;
  color: rgba(233,238,255,.72);
  font-size: 12px;
}
.guest-right{
  display:flex;
  flex-direction: column;
  align-items:flex-end;
  gap: 8px;
}
.guest-fine{
  font-size: 11.5px;
  color: rgba(233,238,255,.55);
  text-align: right;
  max-width: 240px;
}

@media (max-width: 680px){
  .guest-card-inner{
    flex-direction: column;
    align-items: stretch;
  }
  .guest-right{
    align-items: stretch;
  }
  .guest-right .btn{
    width: 100%;
  }
  .guest-fine{
    text-align: left;
    max-width: none;
  }
}

/* ===== Socials row (above userbar) ===== */
.socialbar{
  grid-column: 1 / -1;
  margin: 4px 0 6px;  /* petit spacing avant la userbar */
  position: relative;
  z-index: 1;
}

.socialbar-inner{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  backdrop-filter: blur(10px);
}

.socialbar-label{
  font-size: 12px;
  font-weight: 900;
  color: rgba(233,238,255,.70);
  letter-spacing: .2px;
  margin-right: 4px;
}

.social-ico{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 10px 22px rgba(0,0,0,.18);
  transition: transform .12s ease, filter .12s ease, border-color .12s ease, background .12s ease;
}

.social-ico img{
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: .92;
  filter: drop-shadow(0 0 10px rgba(255,255,255,.10));
}

.social-ico:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
  border-color: rgba(85,246,255,.22);
  background: rgba(85,246,255,.06);
}

.social-ico:active{
  transform: translateY(0px) scale(.98);
}

@media (max-width: 520px){
  .socialbar-inner{
    justify-content: flex-start; /* ✅ toujours à gauche */
  }
  .socialbar-label{
    margin-right: 0;
  }
}


/* ===== Busy overlay (fullscreen spinner + blur) ===== */
.busy-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999; /* above modals/toasts */
  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(7, 11, 18, .35); /* dark glass */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  /* nicer entrance */
  opacity: 1;
  transition: opacity .18s ease;
}

.busy-overlay.hidden{
  display: none;
}

.busy-panel{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 26px;
  border-radius: 18px;
  background: rgba(10, 14, 22, .55);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 20px 70px rgba(0,0,0,.55);
}

.busy-spinner{
  width: 62px;
  height: 62px;
  border-radius: 999px;

  border: 5px solid rgba(233,238,255,.18);
  border-top-color: rgba(85,246,255,.95); /* cyan accent */
  filter: drop-shadow(0 0 18px rgba(85,246,255,.20));

  animation: busySpin .85s linear infinite;
}

@keyframes busySpin{
  to { transform: rotate(360deg); }
}

.busy-text{
  font-weight: 800;
  letter-spacing: .2px;
  color: rgba(233,238,255,.92);
  font-size: 14px;
  text-align: center;
}

/* optional: block interactions behind overlay */
.busy-overlay{
  pointer-events: all;
}


/* =========================
   History chart modal
========================= */
.hist-card{ padding:16px; }

.hist-top{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.hist-kpis{
  display:grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap:10px;
}
.hk{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(8,10,16,.55);
  border-radius: 14px;
  padding:10px 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.hk-l{ font-size:12px; color: rgba(233,238,255,.55); }
.hk-v{ font-size:14px; font-weight:900; margin-top:4px; }

.hist-legend{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  color: rgba(233,238,255,.7);
  font-size:12px;
}
.hleg{ display:inline-flex; align-items:center; gap:7px; }
.hleg .dot{
  width:10px; height:10px; border-radius:999px;
  box-shadow: 0 0 18px rgba(255,255,255,.12);
}
.hleg .dot.dep{ background: rgba(76,255,154,.95); box-shadow:0 0 18px rgba(76,255,154,.28); }
.hleg .dot.wd { background: rgba(255,77,109,.95); box-shadow:0 0 18px rgba(255,77,109,.28); }
.hleg .dot.pf { background: rgba(255,77,255,.95); box-shadow:0 0 18px rgba(255,77,255,.22); }
.hleg .dot.pr { background: rgba(76,255,154,.35); border:1px dashed rgba(76,255,154,.8); }

.hist-grid{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap:14px;
}

.hist-chart{
  position:relative;
  height: 340px;
  border:1px solid rgba(255,255,255,.08);
  background: radial-gradient(1200px 400px at 20% 20%, rgba(85,246,255,.06), transparent 60%),
              rgba(10,12,18,.45);
  border-radius:16px;
  overflow:hidden;
}

#histCanvas{ width:100%; height:100%; display:block; }

.hist-side{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(10,12,18,.35);
  border-radius:16px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.hist-side-title{
  font-weight:900;
  letter-spacing:.2px;
  color: rgba(233,238,255,.85);
  margin-bottom:2px;
}

.proj-row{
  border:1px solid rgba(255,255,255,.08);
  background: rgba(8,10,16,.55);
  border-radius:14px;
  padding:10px 12px;
}
.proj-k{ font-size:12px; color: rgba(233,238,255,.55); }
.proj-v{ font-size:16px; font-weight:950; margin-top:4px; color: var(--good); }
.proj-sub{ margin-top:2px; color: rgba(233,238,255,.65); }

.hist-note{ margin-top:auto; color: rgba(233,238,255,.55); }

@media (max-width: 920px){
  .hist-top{ align-items:stretch; flex-direction:column; }
  .hist-kpis{ grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .hist-grid{ grid-template-columns: 1fr; }
  .hist-chart{ height: 320px; }
}

/* History modal: wider (height unchanged) */
#historyModal .modal.modal-wide{
  width: min(80vw, 1180px);   /* ✅ 80% écran, cap à 1180px */
  max-width: 80vw;           /* force */
}

/* Mobile: plein écran quasi */
@media (max-width: 920px){
  #historyModal .modal.modal-wide{
    width: calc(100vw - 18px);
    max-width: calc(100vw - 18px);
  }
}


/* Legend INSIDE the chart */
.hist-chart-legend{
  position:absolute;
  left:12px;
  top:12px;
  z-index:4;
  display:flex;
  gap:10px;
  align-items:center;

  padding:8px 10px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(10,12,18,.55);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);

  font-size:12px;
  color: rgba(233,238,255,.72);
}

.hist-chart-legend .hcl{
  display:inline-flex;
  align-items:center;
  gap:7px;
  white-space:nowrap;
}

.hist-chart-legend .hcl-dot{
  width:10px;
  height:10px;
  border-radius:999px;
}

/* mêmes couleurs que tes points */
.hist-chart-legend .hcl-dot.dep{
  background: rgba(76,255,154,.95);
  box-shadow:0 0 18px rgba(76,255,154,.25);
}
.hist-chart-legend .hcl-dot.wd{
  background: rgba(255,77,109,.95);
  box-shadow:0 0 18px rgba(255,77,109,.25);
}
.hist-chart-legend .hcl-dot.pf{
  background: rgba(255,77,255,.95);
  box-shadow:0 0 18px rgba(255,77,255,.20);
}

/* sur mobile: éviter que ça prenne trop de place */
@media (max-width: 520px){
  .hist-chart-legend{
    top:auto;
    bottom:10px;
    left:10px;
    gap:8px;
    padding:7px 9px;
    font-size:11px;
  }
}

.hist-chart-legend .hcl-dot.pr{
  background: rgba(76,255,154,.20);
  border:1px dashed rgba(76,255,154,.85);
  box-shadow:0 0 18px rgba(76,255,154,.18);
}


/* =========================================================
   HISTORY MODAL — MOBILE SCROLL FIX
   Objectif:
   - la modale scrolle (pas la page)
   - la croix reste accessible (header sticky)
   - pas de scroll "bloqué" sur iOS
   ========================================================= */

/* 1) Overlay : prend tout l’écran */
.modalOverlay,
#historyModalOverlay,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

/* 4) Header sticky (titre + croix) : toujours visible */
.modalHeader,
#historyModalHeader {
  position: sticky;
  top: 0;
  z-index: 5;

  /* important: un fond pour masquer le contenu qui passe dessous */
  background: rgba(10,12,18,.92);
  backdrop-filter: blur(10px);

  /* un peu de padding */
  padding: 14px 14px 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* 5) Croix cliquable, pas cachée */
.modalClose,
#historyClose {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 6;
  touch-action: manipulation;
}

/* 6) Corps de la modale */
.modalBody,
#historyModalBody {
  padding: 14px;
}

/* 7) IMPORTANT: si tu as un container interne qui force overflow:hidden, neutralise-le */
.modalBody * {
  /* ne mets pas ça si tu as besoin de hidden ailleurs,
     mais souvent un parent a overflow:hidden et casse le scroll */
}

/* 8) Bonus: si tu as une "card" interne qui prend 100% height, évite de bloquer */
.historyModalInner,
#historyInner {
  min-height: 0;
}

/* bloque le fond quand une modale est ouverte */
html.modal-open, body.modal-open{
  overflow: hidden;
  height: 100%;
}


/* Overlay */
#historyModal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.55);
}

#historyModal.hidden{ display: none; }

/* Card */
#historyModal .modalCard{
  width: min(1120px, 96vw);
  max-height: min(760px, 90vh);
  overflow: auto;                 /* ✅ scroll intérieur */
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(10,12,18,.92);
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  position: relative;             /* ✅ pour positionner la croix */
}

/* Header zone pour éviter que le contenu touche le bord */
#historyModal .modalHeader{
  position: sticky;               /* ✅ reste visible quand on scroll */
  top: 0;
  z-index: 2;
  padding: 18px 18px 12px 18px;
  background: linear-gradient(to bottom, rgba(10,12,18,.98), rgba(10,12,18,.65));
  backdrop-filter: blur(10px);
}

/* Close button: toujours dans le coin */
#historyClose{
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
}


/* ===========================
   HISTORY MODAL (CLEAN FIX)
   #historyModal = BACKDROP
   .modal = DIALOG
=========================== */

/* Backdrop always full screen */
#historyModal.modal-backdrop{
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
}

#historyModal.modal-backdrop.hidden{ display:none; }

/* Dialog (the actual window) */
#historyModal .modal{
  width: min(80vw, 1180px);
  max-height: calc(100vh - 36px);
  overflow: hidden;            /* important: keep header sticky clean */
  position: relative;
}

/* Make the modal content scroll (not the page) */
#historyModal .hist-card{
  max-height: calc(100vh - 36px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* Keep header + close visible */
#historyModal .modal-head{
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(10,12,18,.92);
  backdrop-filter: blur(10px);
}

/* Mobile full screen */
@media (max-width: 920px){
  #historyModal.modal-backdrop{ padding: 0; }
  #historyModal .modal{
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }
  #historyModal .hist-card{
    max-height: 100vh;
  }
}




.social-ref-btn{
  margin-left: 10px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(233,238,255,.18);
  background: rgba(12, 16, 32, .62);
  color: rgba(233,238,255,.9);
  font-weight: 900;
  letter-spacing: .5px;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.social-ref-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(85,246,255,.45);
  background: rgba(12, 16, 32, .78);
}

.ref-explain{
  color: rgba(233,238,255,.78);
  line-height: 1.35;
  margin-bottom: 12px;
}

.ref-link-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.ref-link-label{
  color: rgba(233,238,255,.72);
  font-weight: 700;
}
.ref-link-actions{
  display:flex;
  gap: 8px;
}

.ref-stats{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.ref-stat{
  border: 1px solid rgba(233,238,255,.12);
  background: rgba(10, 14, 28, .45);
  border-radius: 14px;
  padding: 10px 12px;
}
.ref-stat-label{
  color: rgba(233,238,255,.6);
  font-size: 12px;
  margin-bottom: 6px;
}
.ref-stat-val{
  font-weight: 900;
  font-size: 18px;
}


/* =========================
   Z-LAYERS (FINAL OVERRIDES)
   Toasts must stay visible above modals
========================= */
:root{
  --z-modal: 10000;
  --z-toast: 11000;
  --z-busy:  12000;
}

/* Modal overlays/backdrops */
.modal-backdrop,
#historyModal.modal-backdrop,
#historyModal{
  z-index: var(--z-modal) !important;
}

/* Dialog itself (optional, keeps it above its backdrop) */
.modal,
#historyModal .modal{
  z-index: calc(var(--z-modal) + 1) !important;
}

/* Toasts always on top of modals */
.toast-host{
  z-index: var(--z-toast) !important;
  position: fixed; /* safety */
  isolation: isolate; /* prevents weird stacking context surprises */
}

/* Busy overlay remains above everything (including toasts if you want)
   -> if you WANT toasts visible even during busy overlay, swap z values */
.busy-overlay{
  z-index: var(--z-busy) !important;
}


/* ===== Google Identity Services: always above our modals ===== */
#credential_picker_container,
#credential_picker_iframe,
iframe[src*="accounts.google.com"],
div[id^="g_id_onload"],
.g_id_signin,
.g_id_signin iframe{
  z-index: 200000 !important;
  position: fixed !important; /* helps on iOS Safari */
}

/* (optionnel) empêche certains blur iOS sur iframe */
#credential_picker_container{
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}



.faq .faq-list { display: grid; gap: 10px; margin-top: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: var(--card2); }
.faq-item summary { cursor: pointer; font-weight: 700; list-style: none; }
.faq-item summary::-webkit-details-marker { display:none; }
.faq-body { margin-top: 10px; color: var(--muted); line-height: 1.5; }
.faq a { color: var(--cyan); text-decoration: none; }
.faq a:hover { text-decoration: underline; }

/* FAQ must span full grid and respect the same margins as the app */
.faq{
  grid-column: 1 / -1;   /* ✅ prend toute la largeur de la grille */
  width: 100%;
}

/* avoid any horizontal overflow from long words/links */
.faq .faq-body{
  overflow-wrap: anywhere;
  word-break: break-word;
}

.faq details,
.faq .faq-item{
  min-width: 0;
}

.faq .faq-item summary{
  white-space: normal;  /* ✅ wrap du texte */
  line-height: 1.25;
}

.socialbar-inner{
  flex-wrap: wrap;      /* ✅ autorise retour ligne propre */
}

.social-ref-btn{
  margin-left: 0;       /* ✅ enlève le décalage qui peut casser */
}


/* === Social pills: force PERFECT alignment === */
.socialbar-inner{
  display: flex;
  align-items: center;   /* ✅ alignement vertical strict */
  gap: 10px;
}

/* Buttons & links MUST behave identically */
.social-ref-btn{
  display: inline-flex;          /* ✅ identique pour <a> et <button> */
  align-items: center;
  justify-content: center;

  height: 34px;                  /* ✅ hauteur verrouillée */
  padding: 0 14px;               /* ✅ padding identique */
  line-height: 1;                /* ✅ empêche tout décalage texte */

  text-decoration: none;         /* ✅ enlève underline des <a> */
  white-space: nowrap;

  border-radius: 999px;
  border: 1px solid rgba(233,238,255,.18);
  background: rgba(12, 16, 32, .62);
  color: rgba(233,238,255,.9);
  font-weight: 900;
  letter-spacing: .5px;

  box-sizing: border-box;
}

/* === Smaller pills for secondary actions (FAQ / DOCS) === */
.social-ref-btn.is-small{
  height: 28px;          /* 🔽 plus petit */
  padding: 0 10px;       /* 🔽 moins large */
  font-size: 12px;       /* 🔽 texte plus discret */
  font-weight: 800;      /* légèrement moins bold */
  letter-spacing: .35px;
  opacity: .85;          /* optiquement secondaire */
}

/* Hover stays consistent */
.social-ref-btn.is-small:hover{
  opacity: 1;
}

.social-ref-btn.is-small{
  background: rgba(12,16,32,.45);
  border-color: rgba(233,238,255,.14);
}














