:root{
  --bg:#070b14;
  --panel: rgba(255,255,255,.06);
  --panel2: rgba(0,0,0,.20);
  --border: rgba(255,255,255,.10);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.70);
  --muted2: rgba(255,255,255,.55);
  --cyan: rgba(0,255,204,.95);
  --indigo: rgba(99,102,241,.95);
  --green: rgba(52,211,153,1);
  --red: rgba(251,113,133,1);
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  color-scheme: dark;
  font-synthesis-weight:none;
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(0, 255, 204, .10), transparent 60%),
    radial-gradient(900px 600px at 90% 0%, rgba(99, 102, 241, .12), transparent 55%),
    var(--bg);
  color:var(--text);
}

a{color:inherit}
.container{max-width:1100px;margin:0 auto;padding:18px 16px 92px}
.glass{
  background:var(--panel);
  border:1px solid var(--border);
  backdrop-filter: blur(10px);
}
.card{border-radius:24px; box-shadow:var(--shadow)}
.row{display:flex;gap:12px;align-items:center}
.header{
  display:flex;justify-content:space-between;align-items:flex-end;gap:12px;
}
.h1{font-size:24px;font-weight:700;letter-spacing:-0.02em}
.sub{font-size:13px;color:var(--muted);margin-top:6px}
.pills{display:flex;gap:10px;flex-wrap:wrap}
.pill{
  border-radius:16px;
  padding:10px 14px;
  background:var(--panel);
  border:1px solid var(--border);
  cursor:pointer;
  user-select:none;
  transition:transform .08s ease, opacity .2s ease;
}
.pill:active{transform:scale(.98)}
.pill.muted{opacity:.6}
.grid3{display:grid;grid-template-columns:1fr;gap:12px}
@media(min-width:900px){.grid3{grid-template-columns:1fr 1fr 1fr}}

.metric{padding:14px 14px 12px}
.metric .label{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted2)}
.metric .value{font-size:18px;font-weight:700;margin-top:8px}
.metric .hint{font-size:12px;color:var(--muted2);margin-top:6px}

.controls{padding:14px}
.controlsTop{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.search{
  flex:1;
  min-width:240px;
  border-radius:18px;
  padding:12px 14px;
  background:var(--panel2);
  border:1px solid var(--border);
  outline:none;
  color:var(--text);
}
.select, .sel, .num{
  border-radius:18px;
  padding:12px 12px;
  background:var(--panel2);
  border:1px solid var(--border);
  outline:none;
  color:var(--text);
}
.toggle{
  display:flex;gap:8px;align-items:center;
  border-radius:18px;
  padding:10px 12px;
  background:var(--panel);
  border:1px solid var(--border);
}
.tableWrap{margin-top:12px;border-radius:24px;overflow:auto;border:1px solid var(--border)}
table{width:100%;border-collapse:separate;border-spacing:0;min-width:1040px}
thead th{
  position:sticky;top:0;
  background:rgba(0,0,0,.40);
  backdrop-filter: blur(10px);
  font-size:12px;
  color:var(--muted);
  text-align:left;
  padding:12px 14px;
}

/* Sortable headers */
.thSort{cursor:pointer; user-select:none;}
.thSort .thInner{display:flex; align-items:center; justify-content:space-between; gap:10px;}
.thSort .thLeft{display:inline-flex; align-items:center; gap:8px; min-width:0;}
.thSort.active{color:var(--text);}
.thArrow{font-size:12px; color:var(--muted2); min-width:10px; text-align:right;}

/* Tooltip (hover + focus) */
.tip{position:relative; display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:999px; border:1px solid rgba(255,255,255,.12); background:rgba(255,255,255,.06);}
.tipIcon{font-size:12px; line-height:1; color:var(--muted2);}
.tipBox{
  position:absolute;
  left:50%;
  bottom:calc(100% + 10px);
  width:min(320px, 72vw);
  padding:10px 12px;
  border-radius:14px;
  background:rgba(10,12,18,.92);
  border:1px solid rgba(255,255,255,.12);
  color:rgba(255,255,255,.88);
  font-size:12px;
  line-height:1.35;
  box-shadow:var(--shadow);
  opacity:0;
  transform:translate(-50%, 4px);
  pointer-events:none;
  z-index:80;
}
.tip:hover .tipBox,
.tip:focus .tipBox,
.tip:focus-within .tipBox{opacity:1; transform:translate(-50%, 0); pointer-events:auto;}

.controlsNote{margin-top:10px; display:flex; gap:10px; flex-wrap:wrap;}
.kpi{display:inline-flex; align-items:center; gap:8px;}
.kpiMain{white-space:nowrap;}

tbody td{padding:12px 14px;font-size:13px;border-top:1px solid rgba(255,255,255,.06)}
tbody tr{cursor:pointer}
tbody tr:hover{background:rgba(255,255,255,.04)}
.sym{font-weight:700}

/* Symbol links (open Bybit) */
.symLink{
  display:inline-flex; align-items:center; gap:6px;
  color:inherit; text-decoration:none;
}
.symLink:hover{text-decoration:underline}
.symExt{font-size:12px; opacity:.75}
.spotInline{display:inline-flex; align-items:center; gap:6px; white-space:nowrap}

/* Non-sortable headers keep alignment but aren't clickable */
.thStatic{user-select:none;}
.thStatic .thInner{display:flex; align-items:center; justify-content:space-between; gap:10px;}
.thStatic .thLeft{display:inline-flex; align-items:center; gap:8px; min-width:0;}

.pos{color:var(--green)}
.neg{color:var(--red)}
.dim{color:var(--muted)}

/* Top bar actions (Settings button) */
.topActions{display:flex;gap:10px;align-items:center}
.iconBtn{
  width:38px;height:34px;border-radius:999px;
  background:rgba(255,255,255,.07);
  border:1px solid var(--border);
  color:var(--muted);
  display:inline-flex;align-items:center;justify-content:center;
  cursor:pointer;
}
.iconBtn:hover{color:var(--text)}
.iconBtn:active{transform:scale(.99)}
.iconBtn.active{color:var(--text);background:rgba(255,255,255,.10)}


.bottomNav{
  position:fixed;left:0;right:0;bottom:14px;padding:0 16px;z-index:30;
}
.navBar{
  max-width:640px;margin:0 auto;
  display:flex;justify-content:flex-start;gap:6px;
  padding:8px 10px;border-radius:26px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  box-shadow:var(--shadow);
}
.navBtn{
  flex:0 0 108px;
  background:transparent;border:0;color:var(--muted);
  padding:8px 6px;border-radius:18px;
  display:flex;flex-direction:column;gap:4px;align-items:center;
  cursor:pointer;
}
.navBtn.active{color:var(--text);background:rgba(255,255,255,.07);border:1px solid var(--border)}
.navBtn span{font-size:11px}

.drawerOverlay{
  position:fixed;inset:0;background:rgba(0,0,0,.62);z-index:60;
}
.drawer{
  position:fixed;left:0;right:0;bottom:0;z-index:61;
  max-width:900px;margin:0 auto;
  border-radius:34px 34px 0 0;
  padding:16px 16px 18px;
  box-shadow:var(--shadow);
}
.drawerTop{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.drawerTitle{font-size:20px;font-weight:800}
.drawerSub{font-size:13px;color:var(--muted);margin-top:6px}
.drawerBtns{display:flex;gap:10px;flex-wrap:wrap}
.btn{
  border-radius:18px;padding:10px 14px;
  background:rgba(255,255,255,.09);
  border:1px solid var(--border);
  color:var(--text);
  cursor:pointer;
}
.btn.muted{opacity:.75}
.btn:active{transform:scale(.99)}
.chartBox{margin-top:12px;padding:10px;border-radius:24px;border:1px solid var(--border);background:rgba(255,255,255,.05)}
.note{margin-top:10px;font-size:12px;color:var(--muted)}
.kpiRow{margin-top:10px;display:flex;gap:10px;flex-wrap:wrap}
.kpi{padding:8px 10px;border-radius:16px;background:rgba(0,0,0,.18);border:1px solid rgba(255,255,255,.08);font-size:12px;color:var(--muted)}


/* Smaller text cells */
.mini{font-size:12px; white-space:nowrap;}

.navBar::-webkit-scrollbar{display:none}


/* ---------- Global tooltip layer (always on top) ---------- */
.tipBtn{
  display:inline-flex;align-items:center;justify-content:center;
  width:18px;height:18px;border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  padding:0;cursor:pointer;
}
.tipBtn:active{transform:translateY(1px)}
.tipLayer{position:fixed;inset:0;z-index:99999;pointer-events:none}
.tipPop{
  position:fixed;
  width:min(340px, 86vw);
  padding:10px 12px;border-radius:14px;
  background:rgba(10,12,18,.94);
  border:1px solid rgba(255,255,255,.14);
  color:rgba(255,255,255,.9);
  font-size:12px;line-height:1.35;
  box-shadow:var(--shadow);
  pointer-events:auto;
}

/* Bottom nav labels (multi-line) */
.navLbl{font-size:10px;line-height:1.05;text-align:center;color:inherit}
.navLbl br{content:"";}

.badge.warn{border-color:rgba(255,136,0,.35);background:rgba(255,136,0,.10);color:rgba(255,210,150,.95)}

/* Opportunity badge */
.oppCell{display:flex;gap:6px;align-items:center;justify-content:flex-start}
.oppBadge{
  display:inline-flex;align-items:center;gap:6px;
  padding:6px 10px;border-radius:999px;
  font-weight:700;font-size:11px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
}
.oppBadge.oppWarn{border-color:rgba(255,136,0,.35);background:rgba(255,136,0,.12)}
.oppA{color:rgba(180,255,220,.95)}
.oppB{color:rgba(190,220,255,.95)}
.oppC{color:rgba(255,240,190,.95)}
.oppD{color:rgba(255,190,190,.95)}

/* Top opportunities pills */
.topOpp{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px;margin-bottom:10px}
.topPill{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  border-radius:18px;padding:10px 12px;
  display:flex;flex-direction:column;gap:4px;
  min-width:160px;
  cursor:pointer;
}
.topPill:active{transform:translateY(1px)}
.tpSym{font-weight:800}
.tpSub{font-size:12px;color:var(--muted2)}
.tpScore{font-size:12px;font-weight:700}

/* Tutorial + risk boxes */
.tutorial{margin-top:12px;padding-top:10px;border-top:1px solid rgba(255,255,255,.10)}
.tTitle{font-weight:800;margin-bottom:6px}
.tList{margin:0;padding-left:18px;color:rgba(255,255,255,.88);font-size:13px;line-height:1.35}
.tList li{margin:4px 0}
.tRisk{margin-top:8px;color:rgba(255,190,190,.92);font-size:12px}

.riskBox{margin-top:12px;padding:12px;border-radius:18px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.05)}
.rbTitle{font-weight:800;margin-bottom:6px}
.rbText{color:rgba(255,255,255,.86);font-size:12px;line-height:1.4}

