:root {
  --bg:      #0a0c12;
  --surface: #12151e;
  --surf2:   #1a1e2a;
  --border:  #222736;
  --text:    #dde3f0;
  --muted:   #6b7490;
  --green:   #00c896;
  --red:     #ff4757;
  --blue:    #ff4d7d;
  --amber:   #f59e0b;
  --r:       10px;
  --nav-h:   54px;
}

*{box-sizing:border-box;margin:0;padding:0}

body{
  background:var(--bg);color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:13px;line-height:1.5;overflow:hidden;height:100vh;
}

/* ─── TOP NAV ─── */
#topnav{
  position:fixed;top:0;left:0;right:0;z-index:100;
  height:var(--nav-h);
  background:var(--surface);border-bottom:1px solid var(--border);
  display:flex;align-items:center;gap:14px;padding:0 20px;
}
.nav-left{display:flex;align-items:center;gap:8px;flex-shrink:0}
.logo{font-weight:800;font-size:15px;letter-spacing:.3px;color:var(--text)}
.portal-logo{display:flex;align-items:center;justify-content:center;width:40px;height:32px;flex-shrink:0}
.portal-logo img{width:40px;height:32px;object-fit:contain;display:block}
.top-tabs{
  display:flex;align-items:center;gap:2px;flex-shrink:0;
  height:32px;
  padding:3px;
  background:var(--surf2);
  border:1px solid var(--border);
  border-radius:8px;
}
.top-tab{
  height:24px;
  min-width:76px;
  padding:0 10px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  line-height:24px;
  cursor:pointer;
  transition:background .15s,color .15s,box-shadow .15s;
}
.top-tab:hover{color:var(--text)}
.top-tab.active{
  color:var(--text);
  background:rgba(255,77,125,.15);
  box-shadow:0 1px 2px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,77,125,.22);
}

.dot-live      {color:var(--green);font-size:10px;animation:pulse 2s infinite}
.dot-connecting{color:var(--amber);font-size:10px}
.dot-error     {color:var(--red);  font-size:10px}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.3}}

.search-wrap{
  position:absolute;
  left:50%;
  top:50%;
  width:min(480px,calc(100vw - 360px));
  min-width:260px;
  transform:translate(-50%,-50%);
}
#search{
  width:100%;background:var(--surf2);border:1px solid var(--border);
  border-radius:8px;color:var(--text);font-size:12px;padding:8px 12px;
  outline:none;transition:border-color .15s;
}
#search::placeholder{color:var(--muted)}
#search:focus{border-color:var(--blue)}

.nav-search-status{
  font-size:11px;color:var(--muted);min-width:80px;flex-shrink:0;
}

/* Mobile-only search icon + close (hidden on desktop; shown via the phone query) */
#mobile-search-btn,#mobile-search-close{display:none}
#mobile-search-btn{
  align-items:center;justify-content:center;flex-shrink:0;
  width:34px;height:34px;border-radius:8px;cursor:pointer;
  background:var(--surf2);border:1px solid var(--border);color:var(--text);
}
#mobile-search-close{
  align-items:center;justify-content:center;flex-shrink:0;
  width:34px;height:34px;border-radius:8px;cursor:pointer;
  background:var(--surf2);border:1px solid var(--border);color:var(--text);font-size:14px;
}

/* ─── HOME ─── */
#home{
  margin-top:var(--nav-h);
  height:calc(100vh - var(--nav-h));
  overflow-y:auto;
  padding:20px 24px 40px;
}

.home-trending-row{
  display:grid;
  grid-template-columns:minmax(0, 2fr) minmax(180px, .72fr);
  gap:14px;
  align-items:start;
  width:100%;
  margin:0;
}
.home-trending-card,
.home-news-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
  min-width:0;
}
.home-trending-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
}
.home-trending-body{
  padding:12px;
  min-height:324px;
}
.home-trending-body.is-swiping{animation:homeTrendSwipe .22s ease}
.home-trending-body.te-fading{opacity:0;transition:opacity .18s ease}
@keyframes homeTrendSwipe{
  from{opacity:.45;transform:translateX(18px)}
  to{opacity:1;transform:translateX(0)}
}
.home-trending-empty{
  height:330px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}
.home-polymarket-embed{
  position:relative;
  display:block;
  margin:0;
}
.home-polymarket-embed iframe{
  display:block;
  width:100%;
  height:300px;
  border:0;
  border-radius:6px;
  background:var(--surf2);
}
.home-polymarket-embed > a{
  position:absolute;
  top:16px;
  right:20px;
  width:120px;
  height:24px;
  z-index:10;
}
.home-polymarket-embed figcaption{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.home-trending-controls{
  display:flex;
  justify-content:center;
  gap:10px;
  padding:0 12px 12px;
}
.trend-nav-btn{
  width:38px;
  height:32px;
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--surf2);
  color:var(--text);
  cursor:pointer;
  font-size:15px;
  font-weight:900;
  line-height:1;
  transition:background .14s,border-color .14s,transform .14s;
}
.trend-nav-btn:hover{
  background:var(--surface);
  border-color:var(--accent);
  transform:translateY(-1px);
}
.home-news-card{
  padding:12px 14px;
  height:500px;                 /* match the trending event scorecard height */
  display:flex;flex-direction:column;
}
.home-news-head{display:flex;align-items:center;gap:8px;margin-bottom:8px;flex-shrink:0}
.news-live-dot{width:7px;height:7px;border-radius:50%;background:#22c55e;box-shadow:0 0 8px #22c55e;animation:pulse 1.8s infinite}
.home-news-body{flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:2px;min-height:0}
.news-empty{color:var(--muted);font-size:12px;padding:10px 2px}
.news-item{display:block;padding:9px 6px;border-top:1px solid var(--border);text-decoration:none;color:inherit;transition:background .12s}
.news-item:first-child{border-top:0}
.news-item:hover{background:var(--surf2)}
.news-item-top{display:flex;align-items:baseline;gap:8px}
.news-title{flex:1;min-width:0;font-size:12.5px;font-weight:700;color:var(--text);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.news-ago{flex-shrink:0;font-size:10.5px;color:var(--muted);font-weight:600;white-space:nowrap}
.news-text{font-size:11px;color:var(--muted);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.news-item.news-new{animation:newsIn .4s ease}
@keyframes newsIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}

/* ─── BROADCASTS ─── */
#broadcasts-page{
  position:fixed;top:var(--nav-h);left:0;right:0;bottom:0;
  display:flex;flex-direction:column;
  background:var(--bg);
  overflow:hidden;z-index:45;
}
#broadcasts-page-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 24px;
  border-bottom:1px solid var(--border);
  background:var(--surface);
}
#broadcasts-page-header h2{font-size:18px;line-height:1;margin:0}
#broadcasts-grid{
  flex:1;
  overflow-y:auto;
  padding:18px 16px 40px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
}
/* One scorecard per row, stacked and centered like a feed.
   flex:0 0 auto stops the column from shrinking cards to fit the viewport —
   without it, flex-shrink squishes each card and overflow:hidden clips it down
   to just the username row. The cards keep full height; the grid scrolls. */
#broadcasts-grid > .broadcast-card{flex:0 0 auto;width:100%;max-width:540px}
.broadcast-load-more{
  position:sticky;bottom:12px;z-index:2;
  width:min(220px,80vw);height:38px;border:1px solid var(--border);border-radius:8px;
  background:var(--surface);color:var(--text);font-weight:800;cursor:pointer;
  box-shadow:0 10px 28px rgba(0,0,0,.28);
}
.broadcast-load-more:hover{background:var(--surf2)}
.broadcast-card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:8px;
  padding:13px;
  min-width:0;
  position:relative;
  overflow:hidden;
}
.broadcast-top{margin-bottom:10px}
/* Username and the relative time share one row. */
.broadcast-userline{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.broadcast-user{font-size:13px;font-weight:800;color:var(--text);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.broadcast-time-actions{display:flex;flex-direction:column;align-items:flex-end;gap:5px;flex:none}
.broadcast-time{font-size:11px;color:var(--muted);font-weight:600;white-space:nowrap;flex:none}
.broadcast-actions{display:flex;align-items:center;gap:6px}
.broadcast-source{font-size:11px;color:var(--muted);margin-top:1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.broadcast-side{font-size:10px;font-weight:800;padding:2px 7px;border-radius:999px;background:var(--surf2)}
.broadcast-titlerow{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.broadcast-img{
  flex:0 0 auto;width:44px;height:44px;border-radius:10px;
  background:var(--surf2) center/cover no-repeat;
  border:1px solid var(--border);
}
.broadcast-img.has-img{border-color:rgba(255,255,255,.1)}
.broadcast-titlerow .broadcast-title{margin-bottom:0;flex:1;min-width:0}
.broadcast-title{font-size:13px;font-weight:700;line-height:1.35;min-height:36px;margin-bottom:8px}
.broadcast-option{font-size:11px;font-weight:800;color:var(--muted);margin:-3px 0 8px;text-transform:capitalize}
.broadcast-token{font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:9px}
/* 45° diagonal corner ribbon (top-left) for a closed/resolved event. */
.broadcast-closed-banner{
  position:absolute;top:14px;left:-34px;
  transform:rotate(-45deg);
  background:var(--red);color:#fff;
  font-size:10px;font-weight:800;letter-spacing:.5px;text-transform:uppercase;
  padding:3px 40px;
  box-shadow:0 1px 4px rgba(0,0,0,.35);
  z-index:2;pointer-events:none;
}
.broadcast-card.is-closed{opacity:.92}
.pnl-pos{color:var(--green)}
.pnl-neg{color:var(--red)}
.pnl-zero{color:var(--muted)}
.broadcast-card.is-clickable{cursor:pointer;transition:border-color .15s,transform .05s}
.broadcast-card.is-clickable:hover{border-color:var(--blue)}
.broadcast-card.is-clickable:active{transform:scale(.998)}
.broadcast-chart{
  position:relative;
  height:140px;
  width:100%;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--surf2);
  overflow:hidden;
  margin-bottom:10px;
}
/* Crosshair tooltip: outcome label + price at the cursor. */
.broadcast-tip{
  position:absolute;top:6px;left:6px;z-index:3;pointer-events:none;
  display:flex;align-items:center;gap:6px;
  background:var(--surface);border:1px solid var(--border);border-radius:5px;
  padding:3px 7px;font-size:11px;font-weight:700;
  box-shadow:0 2px 6px rgba(0,0,0,.3);
}
.broadcast-tip-oc{color:var(--muted);text-transform:capitalize}
.broadcast-tip-px{color:var(--text)}
.broadcast-chart .empty-msg{font-size:11px;color:var(--muted);display:block;text-align:center;padding-top:36px}
.broadcast-prices{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.broadcast-prices.has-pnl{grid-template-columns:1fr 1fr 1fr}
.broadcast-prices div{background:var(--surf2);border:1px solid var(--border);border-radius:6px;padding:8px}
.broadcast-prices span{display:block;font-size:10px;color:var(--muted);margin-bottom:2px}
.broadcast-prices strong{font-size:14px;color:var(--text)}
.broadcast-copy-modal{
  position:fixed;inset:0;z-index:1200;display:none;align-items:center;justify-content:center;
  background:rgba(0,0,0,.62);padding:18px;
}
.broadcast-copy-modal.open{display:flex}
.broadcast-copy-card{
  width:min(620px,100%);max-height:calc(100vh - 36px);overflow:auto;
  background:var(--surface);border:1px solid var(--border);border-radius:12px;
  padding:18px;position:relative;box-shadow:0 22px 70px rgba(0,0,0,.55);
}
.broadcast-copy-head{padding-right:34px;margin-bottom:12px}
.broadcast-copy-head h2{font-size:17px;line-height:1.25;margin:0 0 6px}
.broadcast-copy-sub{font-size:12px;color:var(--muted)}
.broadcast-copy-options{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:12px}
.broadcast-copy-ended{grid-column:1 / -1;text-align:center;font-size:14px;color:var(--muted);padding:22px 8px;margin:0}
.broadcast-copy-ended-result{grid-column:1 / -1;display:flex;flex-direction:column;gap:8px}
.broadcast-copy-ended-result .broadcast-copy-ended{padding:6px 8px 2px}
.broadcast-copy-result{display:flex;flex-direction:column;gap:6px}
.broadcast-copy-result-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 11px;border:1px solid var(--border);border-radius:8px;background:var(--surf2);font-size:13px;font-weight:700;color:var(--text)}
.broadcast-copy-result-row.win{border-color:var(--green);color:var(--green)}
.broadcast-copy-choice{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  background:var(--surf2);border:1px solid var(--border);border-radius:8px;
  color:var(--text);padding:12px;cursor:pointer;text-align:left;
}
.broadcast-copy-choice span{font-size:12px;font-weight:800;text-transform:capitalize}
.broadcast-copy-choice strong{font-size:18px}
.broadcast-copy-choice.active{border-color:var(--blue);box-shadow:0 0 0 1px rgba(255,77,125,.25)}
.broadcast-copy-chart{
  height:220px;background:var(--surf2);border:1px solid var(--border);
  border-radius:8px;overflow:hidden;margin-bottom:12px;
}
.broadcast-copy-order{
  display:grid;grid-template-columns:1fr 1fr;gap:9px;
  border-top:1px solid var(--border);padding-top:12px;
}
.broadcast-copy-order[hidden]{display:none}
.broadcast-copy-selected,.broadcast-copy-calc,.broadcast-copy-status{grid-column:1/-1}
.broadcast-copy-selected{font-size:12px;font-weight:800;color:var(--text)}
.broadcast-copy-order label{font-size:11px;color:var(--muted);font-weight:700}
.broadcast-copy-order input{
  width:100%;background:var(--bg);border:1px solid var(--border);border-radius:7px;
  color:var(--text);padding:9px 10px;font-size:13px;
}
.broadcast-copy-calc,.broadcast-copy-status{font-size:12px;color:var(--muted)}
.broadcast-copy-place{
  grid-column:1/-1;background:var(--blue);border:none;color:#fff;
  border-radius:8px;padding:10px 12px;font-size:13px;font-weight:800;cursor:pointer;
}
.broadcast-copy-place:disabled{opacity:.6;cursor:not-allowed}

/* ─── CATEGORY ROW ─── */
.cat-row{margin-bottom:28px}

.row-header{
  display:flex;align-items:center;justify-content:space-between;
  margin-bottom:10px;
}
.row-title-group{display:flex;align-items:baseline;gap:8px}
.row-title{font-size:15px;font-weight:700;color:var(--text);letter-spacing:.2px}
.row-badge{
  font-size:10px;font-weight:600;color:var(--muted);
  background:var(--surf2);border:1px solid var(--border);
  padding:2px 8px;border-radius:20px;letter-spacing:.4px;
}

/* Nav arrows */
.row-nav{display:flex;align-items:center;gap:8px;flex-shrink:0}
.nav-btn{
  width:28px;height:28px;border-radius:50%;
  background:var(--surf2);border:1px solid var(--border);
  color:var(--text);font-size:13px;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  transition:background .12s,border-color .12s;line-height:1;padding:0;
}
.nav-btn:hover:not(:disabled){background:var(--border);border-color:var(--muted)}
.nav-btn:disabled{opacity:.35;cursor:default}
.view-all-btn{
  background:transparent;
  border:1px solid var(--border);color:var(--muted);font-size:11px;font-weight:600;
  padding:6px 12px;border-radius:6px;cursor:pointer;
  transition:color .12s,border-color .12s,background .12s;flex-shrink:0;
}
.view-all-btn:hover{color:var(--text);border-color:var(--blue);background:var(--surf2)}
.nav-count{font-size:11px;color:var(--muted);min-width:52px;text-align:center}

/* 5-card grid (fixed columns) */
.row-cards{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:10px;
}

/* AI models row renders a full-width SVG graph, not a card grid */
#cards-ai_models{
  display:block;
  position:relative;
  aspect-ratio:1000 / 520;                 /* match the SVG viewBox so the graph
                                              fills the whole card — no letterbox
                                              bands, one cohesive background */
  background:
    radial-gradient(120% 90% at 50% -10%,rgba(79,163,227,.10),transparent 60%),
    linear-gradient(180deg,rgba(28,37,66,.55),rgba(10,12,18,.25));
  border:1px solid var(--border);
  border-radius:var(--r);
  overflow:hidden;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 18px 48px rgba(0,0,0,.26);
}
.ai-graph-svg{display:block;width:100%;height:100%;touch-action:none;background:radial-gradient(circle at 50% 45%,rgba(255,77,125,.08),transparent 55%)}

/* Engaging backdrop + friendly legend */
.ai-graph-legend{
  position:absolute;left:12px;bottom:12px;z-index:2;pointer-events:none;
  display:flex;flex-direction:column;gap:4px;
  padding:9px 11px;border-radius:10px;
  background:rgba(12,15,22,.62);border:1px solid rgba(255,255,255,.08);
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  font-size:11px;font-weight:600;color:var(--text);
  box-shadow:0 6px 18px rgba(0,0,0,.3);
}
.ai-legend-row{display:flex;align-items:center;gap:7px}
.ai-legend-dot{width:9px;height:9px;border-radius:50%;flex-shrink:0;box-shadow:0 0 6px currentColor}
.ai-legend-hint{margin-top:2px;font-size:10px;font-weight:600;color:var(--muted)}
@media (prefers-reduced-motion:reduce){
  .ai-bg animate,.ai-bg animateTransform{display:none}
}
@media (max-width:640px){
  .ai-graph-legend{left:8px;bottom:8px;padding:7px 9px;font-size:10px}
}
.ai-edge{
  fill:none;stroke-linecap:round;transition:opacity .16s,stroke-width .16s,filter .16s;
  stroke-dasharray:7 9;animation:aiEdgeFlow 14s linear infinite;
}
.ai-edge.is-active{opacity:.9!important;stroke-width:5!important;filter:url(#aiSoftGlow)}
.ai-relation{opacity:.28;stroke-width:1;stroke-dasharray:2 7;stroke-linecap:round}
.ai-cluster{pointer-events:none}
.ai-hub{filter:url(#aiNodeShadow)}
.ai-node{cursor:grab;transition:opacity .16s,filter .16s}
.ai-node.dragging{cursor:grabbing}
.ai-node.is-dimmed{opacity:.34;filter:saturate(.6)}
.ai-node .ai-node-circle{transition:filter .12s,stroke-width .12s,stroke .12s}
.ai-node .ai-node-aura{transition:opacity .16s,transform .16s}
.ai-node:hover .ai-node-circle{filter:brightness(1.22);stroke-width:4}
.ai-node:hover .ai-node-aura{opacity:.18}
.ai-node image{pointer-events:none}
.ai-node text{pointer-events:none}
.ai-node rect{pointer-events:none}
.ai-node.dragging .ai-node-circle{filter:brightness(1.3)}
@keyframes aiEdgeFlow{to{stroke-dashoffset:-120}}

/* ─── SCORECARD ─── */
.scorecard{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px 14px 14px;
  cursor:pointer;
  display:flex;flex-direction:column;gap:0;
  transition:border-color .15s,background .15s,transform .15s,box-shadow .15s;
  min-height:148px;
}
.scorecard:hover{
  border-color:var(--blue);background:var(--surf2);transform:translateY(-3px);
  box-shadow:0 8px 24px rgba(0,0,0,.28);
}
.sc-top{display:flex;align-items:center;gap:9px;margin-bottom:12px}
.sc-avatar{
  width:34px;height:34px;border-radius:50%;flex-shrink:0;
  display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:13px;color:#fff;
}
.sc-name{
  font-weight:600;font-size:12.5px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  color:var(--text);flex:1;min-width:0;
}
.copy-name-row,.ai-model-name-row{display:flex;align-items:center;gap:8px;min-width:0}
.copy-name-row{flex-wrap:wrap}
.copy-btn{
  background:var(--blue);border:1px solid var(--blue);color:#fff;
  border-radius:6px;padding:3px 7px;font-size:10px;font-weight:700;
  cursor:pointer;line-height:1.2;flex-shrink:0;
}
.copy-btn:hover{filter:brightness(1.08)}
.copy-btn.copied{background:var(--green);border-color:var(--green)}
.follow-btn{
  background:transparent;border:1px solid var(--border);color:var(--text);
  border-radius:6px;padding:3px 8px;font-size:10px;font-weight:700;
  cursor:pointer;line-height:1.2;flex-shrink:0;
}
.follow-btn:hover{filter:brightness(1.08)}
.follow-btn.following{background:var(--green);border-color:var(--green);color:#fff}
.uncopy-btn{
  background:transparent;border:1px solid var(--border);color:var(--muted);
  border-radius:6px;padding:4px 10px;font-size:11px;font-weight:600;
  cursor:pointer;line-height:1.2;white-space:nowrap;
  transition:color .12s,border-color .12s,background .12s;
}
.uncopy-btn:hover{color:var(--red);border-color:var(--red);background:rgba(255,71,87,.08)}

/* Live Copy toggle + filter panel */
.lc-switch{position:relative;display:inline-block;width:36px;height:20px;cursor:pointer}
.lc-switch input{opacity:0;width:0;height:0;position:absolute}
.lc-slider{
  position:absolute;inset:0;border-radius:20px;background:var(--border);
  transition:background .15s;
}
.lc-slider::before{
  content:"";position:absolute;left:2px;top:2px;width:16px;height:16px;
  border-radius:50%;background:#fff;transition:transform .15s;
}
.lc-switch input:checked + .lc-slider{background:var(--green)}
.lc-switch input:checked + .lc-slider::before{transform:translateX(16px)}
.lc-switch.lc-disabled{cursor:not-allowed;opacity:.45}
.lc-switch.lc-disabled .lc-slider{cursor:not-allowed}
.lc-config-row.hidden{display:none}
.lc-config{
  display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end;
  padding:12px 14px;background:rgba(255,255,255,.02);
  border-top:1px solid var(--border);border-radius:0 0 8px 8px;
}
.lc-field{display:flex;flex-direction:column;gap:4px;min-width:150px}
.lc-field > label{font-size:11px;font-weight:600;color:var(--muted)}
.lc-field small{font-size:10px;color:var(--muted);opacity:.75}
.lc-field input[type=number]{
  background:var(--bg);border:1px solid var(--border);color:var(--text);
  border-radius:6px;padding:6px 8px;font-size:12px;width:140px;
}
.lc-check{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:600;color:var(--text);cursor:pointer}
.lc-check input{margin:0}
.lc-actions{display:flex;align-items:center;gap:10px}
.lc-save-btn{
  background:var(--blue);border:1px solid var(--blue);color:#fff;
  border-radius:6px;padding:7px 14px;font-size:12px;font-weight:700;cursor:pointer;
}
.lc-save-btn:hover{filter:brightness(1.08)}
.lc-save-btn:disabled{opacity:.6;cursor:default}
.lc-status{font-size:11px;color:var(--green);font-weight:600}
.sc-divider{height:1px;background:var(--border);margin-bottom:10px}
.sc-stats{display:flex;flex-direction:column;gap:7px}
.sc-stat{
  display:flex;justify-content:space-between;align-items:baseline;
  font-size:11px;gap:8px;
}
.sc-lbl{color:var(--muted);font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sc-val{font-weight:700;font-size:11.5px;text-align:right;white-space:nowrap}
.sc-muted{color:var(--muted);font-weight:400}

/* skeleton scorecard (5-col grid) */
.skeleton-card{
  min-height:148px;
  background:linear-gradient(90deg,var(--surface) 25%,var(--surf2) 50%,var(--surface) 75%);
  background-size:400% 100%;animation:shimmer 1.4s infinite;
  border-radius:var(--r);border:1px solid var(--border);
}

/* ─── AI MODELS GRAPH ─── */
#ai-models-graph{
  position:relative;
}
.vis-network{
  background:var(--surface) !important;
}
.vis-label{
  color:var(--text) !important;
  font-size:11px !important;
}
.vis-tooltip{
  background:var(--bg) !important;
  border:1px solid var(--border) !important;
  color:var(--text) !important;
}

#ai-model-popup{
  position:absolute;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r);
  padding:12px;
  z-index:1000;
  box-shadow:0 4px 12px rgba(0,0,0,0.3);
  font-size:12px;
  color:var(--text);
}
.ai-popup-row{
  display:flex;
  justify-content:space-between;
  margin-bottom:6px;
  gap:12px;
}
.ai-popup-lbl{
  color:var(--muted);
  min-width:120px;
}
.ai-popup-val{
  font-weight:600;
  text-align:right;
}

/* ─── AI MODEL CIRCLES ─── */
.ai-model-card{
  flex:0 0 160px;
  display:flex;flex-direction:column;align-items:center;gap:8px;
  padding:12px;cursor:pointer;
  transition:transform .12s;
}
.ai-model-card:hover{transform:translateY(-2px)}
.ai-model-avatar{
  width:60px;height:60px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:18px;color:#fff;
  border:2px solid var(--blue);
}
.ai-model-name{
  font-weight:600;font-size:12px;text-align:center;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  width:100%;color:var(--text);
}
.ai-model-name-row{width:100%;justify-content:center}
.ai-model-name-row .ai-model-name{width:auto;min-width:0}
.ai-model-wr{
  font-size:11px;font-weight:600;
  padding:3px 8px;border-radius:12px;
  background:var(--surf2);
}
@keyframes shimmer{0%{background-position:100% 0}100%{background-position:-100% 0}}

/* ─── DETAIL PANEL ─── */
#detail-panel{
  position:fixed;top:var(--nav-h);left:0;right:0;bottom:0;
  display:flex;flex-direction:column;
  background:linear-gradient(135deg,var(--bg) 0%,#0f1119 100%);
  overflow-y:auto;-webkit-overflow-scrolling:touch;z-index:50;
  animation:slideInFromRight .3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes slideInFromRight{
  from{transform:translateX(100%);opacity:0}
  to{transform:translateX(0);opacity:1}
}

#detail-header{
  display:flex;align-items:center;gap:14px;
  padding:18px 24px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  flex-shrink:0;
  box-shadow:0 4px 12px rgba(0,0,0,0.2);
}

.back-btn{
  background:linear-gradient(135deg,rgba(255,77,125,0.1) 0%,rgba(255,77,125,0.05) 100%);
  border:1px solid rgba(255,77,125,0.2);
  color:var(--text);
  font-size:13px;
  padding:8px 14px;
  border-radius:8px;
  cursor:pointer;
  flex-shrink:0;
  transition:all .2s cubic-bezier(0.4,0,0.2,1);
  white-space:nowrap;
  font-weight:600;
}

.back-btn:hover{
  background:rgba(255,77,125,0.15);
  border-color:rgba(255,77,125,0.4);
  transform:translateX(-2px);
}

#detail-user-info{
  display:flex;align-items:center;gap:14px;
  flex:1;
  min-width:0;
}

.dh-avatar{
  width:48px;height:48px;
  border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-weight:800;font-size:18px;
  color:#fff;
  flex-shrink:0;
  box-shadow:0 6px 20px rgba(255,77,125,0.3);
  animation:avatarPulse 3s ease-in-out infinite;
}

.dh-text{flex:1;min-width:0}
.dh-name{font-size:16px;font-weight:700}
.dh-sub{
  font-size:11px;
  color:var(--muted);
  font-family:monospace;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:380px;
  margin-top:3px;
}

.dh-stats{display:flex;gap:24px;flex-shrink:0}
.dh-stat{display:flex;flex-direction:column;align-items:flex-end;gap:2px}
.dh-lbl{
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.6px;
  color:var(--muted);
  font-weight:600;
}
.dh-val{
  font-size:15px;
  font-weight:700;
  color:var(--text);
}

/* ─── TABS ─── */
.tabs{
  display:flex;
  padding:0 24px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  flex-shrink:0;
  gap:4px;
  /* The page header scrolls away with the content; the tabs stick just under
     the top nav so they stay reachable while scrolling. */
  position:sticky;
  top:0;
  z-index:8;
}

.tab{
  background:none;
  border:none;
  color:var(--muted);
  font-size:13px;
  font-weight:600;
  padding:12px 16px;
  cursor:pointer;
  border-bottom:2px solid transparent;
  transition:all .25s cubic-bezier(0.4,0,0.2,1);
  position:relative;
}

.tab:hover{
  color:var(--text);
}

.tab.active{
  color:var(--blue);
  border-bottom-color:var(--blue);
  background:rgba(255,77,125,0.08);
}

/* TAB PANES ─── */
#detail-content{flex:0 0 auto;overflow:visible;position:relative}
.tab-pane{
  display:none;
  position:absolute;
  inset:0;
  overflow-y:auto;
  padding:18px 22px;
  animation:tabSlideIn .3s ease-out;
}

@keyframes tabSlideIn{
  from{opacity:0;transform:translateX(10px)}
  to{opacity:1;transform:translateX(0)}
}

.tab-pane.active{
  display:block;
  position:static;
  overflow:visible;
  animation:none;
}

/* ─── TABLES ─── */
.tbl-wrap{
  overflow-x:auto;
  border-radius:12px;
  border:1px solid var(--border);
  margin-bottom:18px;
  box-shadow:0 4px 12px rgba(0,0,0,0.1);
  transition:all .3s;
}

.tbl-wrap:hover{
  box-shadow:0 8px 20px rgba(0,0,0,0.15);
  border-color:rgba(255,77,125,0.3);
}

table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

thead th{
  background:linear-gradient(135deg,rgba(255,77,125,0.08) 0%,rgba(255,77,125,0.04) 100%);
  color:var(--muted);
  text-transform:uppercase;
  font-size:10px;
  letter-spacing:.7px;
  font-weight:700;
  padding:12px 13px;
  text-align:left;
  position:sticky;
  top:0;
  z-index:1;
  border-bottom:1px solid rgba(255,77,125,0.2);
}

tbody tr{
  border-bottom:1px solid var(--border);
  transition:all .15s;
}

tbody tr:last-child{border-bottom:none}

tbody tr:hover{
  background:rgba(255,77,125,0.06);
  transform:translateX(2px);
}

td{padding:11px 13px;vertical-align:middle}

.side-buy {color:var(--green);font-weight:700}
.side-sell{color:var(--red);  font-weight:700}

.pnl-pos {color:var(--green);font-weight:600}
.pnl-neg {color:var(--red);  font-weight:600}
.pnl-zero{color:var(--muted)}

.wr-pos{color:var(--green);font-weight:600}
.wr-neg{color:var(--red);  font-weight:600}
.wr-na {color:var(--muted)}

.mkt{max-width:280px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mono{font-family:monospace;font-size:11px}

/* ─── STAT GRID (categories tab) ─── */
.stat-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));
  gap:10px;
}
.stat-card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r);padding:12px 14px;
}
.stat-card .sc-lbl{font-size:9px;text-transform:uppercase;letter-spacing:.7px;color:var(--muted);margin-bottom:4px;display:block}
.stat-card .sc-val{font-size:17px;font-weight:700}
.sec-title{font-size:10px;text-transform:uppercase;letter-spacing:.6px;color:var(--muted);font-weight:600;margin:14px 0 8px}

/* ─── LOAD MORE ─── */
.load-more-btn{
  display:block;width:100%;
  background:var(--surf2);border:1px solid var(--border);
  color:var(--muted);font-size:12px;padding:9px;
  border-radius:var(--r);cursor:pointer;
  transition:background .12s,color .12s;margin-top:4px;
}
.load-more-btn:hover{background:var(--border);color:var(--text)}
.load-more-btn:disabled{opacity:.5;cursor:default}

/* ─── SEARCH RESULTS PANEL ─── */
#search-results{
  position:fixed;
  top:calc(var(--nav-h) + 8px);
  left:50%;
  width:min(480px,calc(100vw - 28px));
  max-height:min(520px,calc(100vh - var(--nav-h) - 24px));
  transform:translateX(-50%);
  display:flex;flex-direction:column;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  box-shadow:0 18px 48px rgba(0,0,0,.34);
  overflow:hidden;
  z-index:80;
}
.sr-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:10px 12px;
  background:var(--surf2);border-bottom:1px solid var(--border);
  flex-shrink:0;
}
.sr-title{font-size:15px;font-weight:700}

#sr-list{flex:1;overflow-y:auto;padding:10px;display:flex;flex-direction:column;gap:8px}
.sr-tabs{
  display:flex;gap:4px;
  padding:3px;
  background:var(--surf2);
  border:1px solid var(--border);
  border-radius:8px;
  margin-bottom:2px;
}
.sr-tab{
  flex:1;height:30px;
  border:0;border-radius:6px;
  background:transparent;color:var(--muted);
  font-size:12px;font-weight:700;
  cursor:pointer;
}
.sr-tab.active{background:var(--surface);color:var(--text);box-shadow:0 1px 2px rgba(0,0,0,.18)}
.sr-tab span{color:var(--muted);font-weight:600;margin-left:4px}
.sr-tab-panel{display:flex;flex-direction:column;gap:8px}

.sr-card{
  display:flex;align-items:center;gap:12px;
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r);padding:12px 14px;
  cursor:pointer;transition:border-color .12s,background .12s;
}
.sr-card:hover{border-color:var(--blue);background:var(--surf2)}
.sr-avatar{
  width:38px;height:38px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:14px;color:#fff;flex-shrink:0;
  overflow:hidden;
}
.sr-event-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.sr-info{flex:1;min-width:0}
.sr-name{font-weight:600;font-size:13px}
.sr-meta{font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:360px;margin-top:2px}
.sr-stats{display:flex;flex-direction:column;align-items:flex-end;gap:3px;flex-shrink:0}
.sr-wr{font-size:14px;font-weight:700}
.sr-pv{font-size:11px;color:var(--muted)}

/* ─── EVENT DETAIL ─── */
#event-detail{
  position:fixed;top:var(--nav-h);left:0;right:0;bottom:0;
  display:flex;flex-direction:column;
  background:var(--bg);
  overflow:hidden;z-index:50;
}
#event-detail-header{
  display:flex;align-items:center;gap:14px;
  padding:16px 22px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  flex-shrink:0;
}
#event-detail-info{min-width:0;flex:1;display:flex;align-items:center;gap:13px}
.event-header-image{
  width:52px;
  height:52px;
  border-radius:8px;
  object-fit:cover;
  flex-shrink:0;
  border:1px solid var(--border);
}
.event-heading{min-width:0}
#event-detail-info h2{
  margin:2px 0 0;
  font-size:18px;
  line-height:1.25;
  font-weight:750;
}
.event-kicker{
  color:var(--muted);
  font-size:11px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.event-meta{font-size:12px;color:var(--muted);margin-top:5px}
#event-detail-content{
  flex:1;
  overflow-y:auto;
  padding:18px 22px 28px;
}
.event-description{
  margin:0;
  width:100%;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
  white-space:pre-line;
}
.event-description-section{width:100%}
.event-section{margin-bottom:20px}
.event-chart{min-height:314px}
.event-options-table td,.event-options-table th{vertical-align:top}
.event-options-table .mono{font-size:10px;word-break:break-all}
.event-price{font-size:12px;font-weight:700;white-space:nowrap}
.event-price.yes{color:var(--green)}
.event-price.no{color:var(--red)}

/* ─── BADGE ─── */
.badge{font-size:9px;font-weight:700;padding:1px 5px;border-radius:3px;text-transform:uppercase;letter-spacing:.5px}
.badge-polymarket{background:rgba(255,77,125,.15);color:var(--blue)}
.badge-kalshi    {background:rgba(245,158,11,.15); color:var(--amber)}

/* ─── OVERVIEW TAB ─── */
.ov-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:24px;
}

.ov-card{
  background:linear-gradient(135deg,rgba(255,77,125,0.05) 0%,rgba(255,77,125,0.02) 100%);
  border:1px solid rgba(255,77,125,0.2);
  border-radius:12px;padding:20px 18px;
  position:relative;overflow:hidden;
  transition:all .3s cubic-bezier(0.34,1.56,0.64,1);
  cursor:default;
}

.ov-card::before{
  content:'';position:absolute;inset:0;
  background:radial-gradient(circle at 50% 50%,rgba(255,77,125,0.1) 0%,transparent 100%);
  opacity:0;transition:opacity .3s;pointer-events:none;
}

.ov-card:hover{
  transform:translateY(-4px) scale(1.02);
  border-color:rgba(255,77,125,0.4);
  box-shadow:0 12px 48px rgba(255,77,125,0.2);
}

.ov-card:hover::before{opacity:1}

.ov-card-inner{position:relative;z-index:1}

.ov-lbl{
  font-size:10px;text-transform:uppercase;letter-spacing:.8px;
  color:var(--muted);margin-bottom:8px;font-weight:600;
  display:block;
}

.ov-val{
  font-size:24px;font-weight:800;
  background:linear-gradient(135deg,var(--text) 0%,var(--blue) 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
}

/* Circular scorecards inside an expanded trade group: one row, title underneath */
.trade-group .ov-grid{
  display:flex;flex-wrap:wrap;gap:14px;justify-content:space-evenly;
  width:100%;margin-bottom:14px;
}
.trade-group .ov-card{
  background:none;border:none;padding:0;overflow:visible;
  display:flex;flex-direction:column-reverse;align-items:center;gap:8px;
  flex:1 1 100px;max-width:170px;min-width:96px;cursor:default;
}
.trade-group .ov-card::before{display:none}
.trade-group .ov-card:hover{transform:none;box-shadow:none;border-color:transparent}
.trade-group .ov-lbl{
  margin:0;text-align:center;line-height:1.3;font-size:10px;
}
.trade-group .ov-val{
  width:100%;min-height:46px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;text-align:center;
  padding:8px 14px;box-sizing:border-box;
  background:linear-gradient(135deg,rgba(255,77,125,0.10) 0%,rgba(255,77,125,0.04) 100%);
  border:1.5px solid rgba(255,77,125,0.35);
  -webkit-text-fill-color:initial;-webkit-background-clip:border-box;background-clip:border-box;
  color:var(--text);font-size:15px;font-weight:800;
  white-space:nowrap;font-variant-numeric:tabular-nums;
}
.trade-group .ov-val.pnl-pos{color:var(--green,#34d399);border-color:rgba(52,211,153,0.5)}
.trade-group .ov-val.pnl-neg{color:var(--red,#f87171);border-color:rgba(248,113,113,0.5)}
.trade-group .ov-val.pnl-zero{color:var(--muted)}

.ov-section{margin-top:6px}
.ov-section-title{
  font-size:11px;text-transform:uppercase;letter-spacing:.7px;
  color:var(--muted);font-weight:700;margin-bottom:14px;
  display:block;
}

.ov-tags{display:flex;flex-wrap:wrap;gap:8px;min-height:30px}
.ov-loading{color:var(--muted);font-size:12px;font-style:italic;align-self:center}

.cat-tag{
  display:inline-flex;align-items:center;gap:6px;
  background:linear-gradient(135deg,rgba(255,77,125,0.1) 0%,rgba(255,77,125,0.05) 100%);
  border:1px solid rgba(255,77,125,0.25);
  border-radius:20px;padding:6px 12px;font-size:12px;
  transition:all .2s;
  animation:tagFadeIn .4s ease-out;
}

@keyframes tagFadeIn{from{opacity:0;transform:scale(0.9)}to{opacity:1;transform:scale(1)}}

.cat-tag:hover{
  border-color:rgba(255,77,125,0.5);
  background:rgba(255,77,125,0.15);
}

.cat-tag strong{font-weight:700}
.cat-tag.wr-pos{
  border-color:rgba(0,200,150,.4);
  background:rgba(0,200,150,.12);
  color:var(--green);
}

.cat-tag.wr-neg{
  border-color:rgba(255,71,87,.4);
  background:rgba(255,71,87,.12);
  color:var(--red);
}

.cat-tag.wr-na{color:var(--muted)}

/* ─── CHART BOX (P&L / value charts) ─── */
.chart-box{
  width:100%;min-height:220px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:12px;
  padding:6px 8px;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;
  transition:border-color .2s;
}
.chart-box>div:not(.empty-msg):not(.ov-loading){width:100%}
.chart-box:hover{border-color:var(--muted)}
.chart-box .empty-msg,.chart-box .ov-loading{margin:auto}
.chart-range-controls{
  display:inline-flex;
  flex-wrap:wrap;
  gap:2px;
  margin:0 0 12px;
  padding:3px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:8px;
}
.chart-range-btn{
  height:28px;
  padding:0 11px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:var(--muted);
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  transition:background .15s,color .15s,box-shadow .15s;
}
.chart-range-btn:hover{color:var(--text);background:var(--surf2)}
.chart-range-btn.active{
  color:var(--text);
  background:var(--surf2);
  box-shadow:0 1px 2px rgba(0,0,0,.18);
}

.broadcast-btn{
  height:30px;
  padding:0 12px;
  border:1px solid var(--border);
  border-radius:6px;
  background:var(--surf2);
  color:var(--text);
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  transition:border-color .15s,background .15s,color .15s;
}
.broadcast-btn:hover{border-color:var(--blue)}
.broadcast-btn.active{
  border-color:var(--green);
  background:rgba(34,197,94,.10);
  color:var(--green);
}
.broadcast-btn:disabled{cursor:default;opacity:.72}

/* ─── CATEGORY DONUT ─── */
.pie-wrap{
  display:flex;align-items:center;gap:26px;flex-wrap:wrap;
  background:var(--surface);border:1px solid var(--border);
  border-radius:12px;padding:18px 20px;
}
.pie-svg{width:150px;height:150px;flex-shrink:0}
.pie-slice{transition:opacity .15s,transform .15s;transform-origin:80px 80px;cursor:default}
.pie-slice:hover{opacity:.82}
.pie-legend{display:flex;flex-direction:column;gap:9px;flex:1;min-width:200px}
.pie-leg{
  display:flex;align-items:center;gap:10px;font-size:12.5px;
  padding:3px 4px;border-radius:6px;transition:background .15s;
}
.pie-leg:hover{background:var(--surf2)}
.pie-dot{width:11px;height:11px;border-radius:3px;flex-shrink:0}
.pie-leg-name{flex:1;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pie-leg-val{font-weight:700;font-variant-numeric:tabular-nums}
.pie-leg-pct{color:var(--muted);font-variant-numeric:tabular-nums;min-width:36px;text-align:right}
.pie-leg-val.wr-pos{color:var(--green)}
.pie-leg-val.wr-neg{color:var(--red)}
.pie-leg-val.wr-na{color:var(--muted)}

/* ─── SKELETONS ─── */
@keyframes shimmer{0%{background-position:100% 0}100%{background-position:-100% 0}}
.sk-line{
  display:inline-block;border-radius:4px;
  background:linear-gradient(90deg,var(--surface) 25%,var(--surf2) 50%,var(--surface) 75%);
  background-size:400% 100%;animation:shimmer 1.4s infinite;
  color:transparent!important;
}
/* skeleton scorecard */
.skeleton-card{
  flex:0 0 160px;height:158px;
  background:linear-gradient(90deg,var(--surface) 25%,var(--surf2) 50%,var(--surface) 75%);
  background-size:400% 100%;animation:shimmer 1.4s infinite;
  border-radius:var(--r);border:1px solid var(--border);
}
/* skeleton category tags (overview) */
.cat-tag-sk{
  display:inline-block;width:90px;height:28px;border-radius:20px;
  background:linear-gradient(90deg,var(--surface) 25%,var(--surf2) 50%,var(--surface) 75%);
  background-size:400% 100%;animation:shimmer 1.4s infinite;
}

/* ─── CATEGORY LOADING STATE ─── */
.cat-loading{
  display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:14px;
  padding:60px 20px;
}
.cat-spinner{
  width:36px;height:36px;border-radius:50%;
  border:3px solid var(--border);
  border-top-color:var(--blue);
  animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
.cat-loading-title{font-size:14px;font-weight:600;color:var(--text)}
.cat-loading-sub{font-size:11px;color:var(--muted)}

/* ─── AI MODEL DETAIL ─── */
#ai-model-detail{
  position:fixed;top:var(--nav-h);left:0;right:0;bottom:0;
  display:flex;flex-direction:column;
  background:linear-gradient(135deg,var(--bg) 0%,#0f1119 100%);
  overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;z-index:50;
}

#ai-detail-header{
  display:flex;align-items:center;gap:16px;
  padding:18px 24px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  flex-shrink:0;
  box-shadow:0 4px 12px rgba(0,0,0,0.2);
}

#ai-detail-info{
  display:flex;align-items:center;gap:14px;
  flex:1;
  min-width:0;
}

.ai-detail-avatar{
  width:48px;height:48px;
  border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-weight:800;font-size:18px;
  color:#fff;
  flex-shrink:0;
  border:2px solid var(--blue);
  box-shadow:0 6px 20px rgba(255,77,125,0.3);
  animation:avatarPulse 3s ease-in-out infinite;
}

.ai-detail-text{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.ai-detail-name{
  font-weight:700;
  font-size:14px;
  color:var(--text);
}

.ai-detail-sub{
  font-size:11px;
  color:var(--muted);
  font-family:monospace;
}

.ai-detail-stats{
  display:flex;
  gap:20px;
  flex-shrink:0;
}

.ai-detail-stat{
  display:flex;
  flex-direction:column;
  gap:3px;
  align-items:flex-end;
}

.ai-detail-stat-lbl{
  font-size:10px;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.5px;
  font-weight:600;
}

.ai-detail-stat-val{
  font-size:14px;
  font-weight:700;
  color:var(--text);
}

/* ── Profile page ── */
#profile-page{position:fixed;top:var(--nav-h);left:0;right:0;bottom:0;display:flex;flex-direction:column;background:linear-gradient(135deg,var(--bg) 0%,#0f1119 100%);overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;z-index:50}
#profile-page-header{display:flex;align-items:center;gap:12px;padding:14px 22px;background:var(--surface);border-bottom:1px solid var(--border);flex-shrink:0}
#profile-page-content{flex:0 0 auto;display:flex;flex-direction:column;overflow:visible}

/* Profile Hero with 3D Effect */
.profile-hero{
  display:flex;align-items:center;gap:24px;
  padding:32px 24px;
  background:linear-gradient(135deg,rgba(255,77,125,0.08) 0%,rgba(255,77,125,0.04) 100%);
  border-bottom:1px solid var(--border);
  position:relative;overflow:visible;
  transition:opacity .16s ease,max-height .18s ease,padding .18s ease,border-color .18s ease;
  max-height:220px;
}
.profile-hero.profile-hero-hidden{
  opacity:0;max-height:0;padding-top:0;padding-bottom:0;border-bottom-color:transparent;
  pointer-events:none;overflow:hidden;
}

.profile-hero::before{
  content:'';position:absolute;top:0;right:-100px;width:300px;height:300px;
  background:radial-gradient(circle,rgba(255,77,125,0.15) 0%,transparent 70%);
  border-radius:50%;animation:float 6s ease-in-out infinite;pointer-events:none;
}

.profile-hero::after{
  content:'';position:absolute;bottom:-50px;left:-100px;width:250px;height:250px;
  background:radial-gradient(circle,rgba(0,200,150,0.1) 0%,transparent 70%);
  border-radius:50%;animation:float 8s ease-in-out infinite reverse;pointer-events:none;
}

@keyframes float{0%,100%{transform:translateY(0) translateX(0)}50%{transform:translateY(-20px) translateX(10px)}}

.profile-avatar{
  width:80px;height:80px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-size:32px;font-weight:800;color:#fff;flex-shrink:0;
  box-shadow:0 8px 32px rgba(255,77,125,0.3),inset 0 1px 0 rgba(255,255,255,0.1);
  position:relative;z-index:1;
  animation:avatarPulse 3s ease-in-out infinite;
}

@keyframes avatarPulse{0%,100%{box-shadow:0 8px 32px rgba(255,77,125,0.3),inset 0 1px 0 rgba(255,255,255,0.1)}50%{box-shadow:0 12px 48px rgba(255,77,125,0.5),inset 0 1px 0 rgba(255,255,255,0.15)}}

.profile-hero-text{min-width:0;position:relative;z-index:1}
.profile-username{font-size:28px;font-weight:800;color:var(--text);margin:0}
.profile-email{font-size:13px;color:var(--muted);margin-top:6px}

/* Circular stat badges in the banner, in the same row as the username */
.hero-stats{
  flex:1;display:flex;flex-wrap:wrap;gap:18px;align-items:center;
  justify-content:center;position:relative;z-index:1;
}
.hero-stat{display:flex;flex-direction:column;align-items:center;gap:7px}
.hero-circle{
  width:76px;height:76px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;text-align:center;
  padding:6px;font-size:14px;font-weight:800;color:var(--text);line-height:1.1;
  background:radial-gradient(circle at 30% 25%,rgba(255,77,125,0.18),rgba(255,77,125,0.05));
  border:2px solid rgba(255,77,125,0.35);
  box-shadow:0 6px 20px rgba(255,77,125,0.18),inset 0 1px 0 rgba(255,255,255,0.08);
  overflow:hidden;word-break:break-word;
  transition:transform .2s ease,box-shadow .2s ease;
}
.hero-circle:hover{transform:translateY(-2px);box-shadow:0 10px 28px rgba(255,77,125,0.28)}
.hero-circle.wr-pos{border-color:rgba(0,200,150,0.5);color:var(--green)}
.hero-circle.wr-neg{border-color:rgba(255,107,107,0.5);color:var(--red)}
/* Polymarket username: modern rectangular box (not a circle) on every device. */
.hero-box{
  min-width:96px;max-width:220px;min-height:48px;
  display:flex;align-items:center;justify-content:center;text-align:center;
  padding:8px 16px;border-radius:12px;
  font-size:14px;font-weight:800;color:var(--text);line-height:1.15;
  background:linear-gradient(135deg,rgba(255,77,125,0.16),rgba(255,77,125,0.05));
  border:1.5px solid rgba(255,77,125,0.35);
  box-shadow:0 6px 20px rgba(255,77,125,0.16),inset 0 1px 0 rgba(255,255,255,0.08);
  overflow:hidden;overflow-wrap:anywhere;
  transition:transform .2s ease,box-shadow .2s ease;
}
.hero-box:hover{transform:translateY(-2px);box-shadow:0 10px 28px rgba(255,77,125,0.24)}
.hero-stat>span{font-size:11px;font-weight:600;color:var(--muted);letter-spacing:.02em}
@media(max-width:760px){
  /* Let the banner grow to fit the wrapped stat circles — the 220px desktop cap
     would otherwise overflow and overlap the tabs below it. */
  .profile-hero:not(.profile-hero-hidden){flex-wrap:wrap;max-height:none;padding:18px 16px;gap:14px}
  .profile-username{font-size:22px}
  /* Compact: every scorecard (circular + rectangular) stacks in one column,
     each as a small value + label row, so the header stays small on phones. */
  .hero-stats{order:3;width:100%;flex-direction:column;align-items:stretch;gap:8px}
  .hero-stat{flex-direction:row;align-items:center;gap:12px;width:100%}
  .hero-stat>span{font-size:12.5px;color:var(--muted)}
  .hero-circle{width:48px;height:48px;font-size:11px;flex-shrink:0;padding:4px}
  .hero-box{width:auto;min-width:48px;max-width:none;min-height:42px;font-size:12.5px;padding:7px 12px;flex-shrink:0}
}

.profile-settings{position:relative;z-index:3;flex-shrink:0}
.profile-settings-btn{
  width:42px;height:42px;display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,0.06);color:var(--text);
  border:1px solid rgba(255,255,255,0.14);border-radius:8px;
  cursor:pointer;transition:transform .2s ease,background .2s ease,border-color .2s ease;
}
.profile-settings-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.profile-settings-btn:hover{transform:translateY(-1px);background:rgba(255,255,255,0.1);border-color:rgba(255,255,255,0.24)}
.profile-settings-modal{
  position:fixed;top:var(--nav-h);left:0;right:0;bottom:0;z-index:1200;
  background:var(--bg);overflow-y:auto;
}
.profile-settings-modal[hidden]{display:none}
.profile-settings-panel{min-height:100%;padding:20px 24px 32px}
.profile-settings-head{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  margin-bottom:18px;padding-bottom:14px;border-bottom:1px solid var(--border);
}
.profile-settings-title{font-size:20px;font-weight:800;color:var(--text)}
.profile-settings-sub{font-size:12px;color:var(--muted);margin-top:3px}
.profile-settings-close{
  width:36px;height:36px;border:1px solid var(--border);border-radius:8px;
  background:var(--surface);color:var(--text);font-size:22px;line-height:1;cursor:pointer;
}
.settings-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.settings-action-btn{
  padding:10px 14px;border:1px solid var(--border);border-radius:8px;
  background:var(--surface);color:var(--text);font-weight:700;cursor:pointer;
}
.settings-action-btn.danger{color:var(--red);border-color:rgba(255,107,107,0.35)}
#profile-tabs{
  flex-shrink:0;
  display:flex;
  position:sticky;
  top:0;
  z-index:8;
  padding:0 24px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  gap:4px;
}

#profile-tab-body{
  padding:24px 24px;
  flex:0 0 auto;
  overflow:visible;
}

.tab{
  background:none;
  border:none;
  color:var(--muted);
  font-size:13px;
  font-weight:600;
  padding:12px 16px;
  cursor:pointer;
  border-bottom:2px solid transparent;
  transition:all .25s cubic-bezier(0.4,0,0.2,1);
  position:relative;
}

.tab:hover{
  color:var(--text);
}

.tab.active{
  color:var(--blue);
  border-bottom-color:var(--blue);
  background:rgba(255,77,125,0.08);
}

.profile-trades-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin-bottom:12px;
}
.profile-trades-wrap{overflow:auto}
.profile-trades-table{min-width:980px}
.profile-trades-table th,
.profile-trades-table td{vertical-align:top}
.copy-trade-time{white-space:nowrap;color:var(--muted)}
.copy-trade-source{max-width:180px;word-break:break-word;color:var(--text)}
.copy-trade-event{min-width:260px;max-width:420px}
.trade-status{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:68px;padding:3px 8px;border-radius:999px;
  font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.02em;
  border:1px solid var(--border);background:var(--surf2);color:var(--muted);
}
.trade-status.successful{color:var(--green);border-color:rgba(0,200,150,.4);background:rgba(0,200,150,.08)}
.trade-status.failed{color:var(--red);border-color:rgba(255,71,87,.45);background:rgba(255,71,87,.08)}
.trade-status.skipped{color:var(--amber);border-color:rgba(245,158,11,.45);background:rgba(245,158,11,.08)}
.trade-reason{
  margin-top:6px;padding:5px 7px;border-radius:6px;
  background:rgba(245,158,11,.08);border:1px solid rgba(245,158,11,.22);
  color:#d4a44f;font-size:11px;line-height:1.35;white-space:normal;
}
.copy-trade-row.failed .trade-reason{background:rgba(255,71,87,.08);border-color:rgba(255,71,87,.22);color:#ff8a95}

/* All-trades tab: type tags + live broadcast button */
.trade-tag{
  display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;
  padding:3px 9px;border-radius:999px;
  font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.03em;
  border:1px solid var(--border);background:var(--surf2);color:var(--muted);
}
.trade-tag.copy{color:var(--blue);border-color:rgba(64,128,255,.4);background:rgba(64,128,255,.1)}
.trade-tag.direct{color:var(--muted)}
.trade-tag.broadcasted{color:var(--green);border-color:rgba(0,200,150,.4);background:rgba(0,200,150,.1)}
.trade-broadcast-btn{
  display:inline-flex;align-items:center;gap:6px;white-space:nowrap;cursor:pointer;
  padding:5px 11px;border-radius:999px;
  font-size:11px;font-weight:800;letter-spacing:.02em;
  color:#fff;border:1px solid rgba(255,77,125,.55);
  background:linear-gradient(135deg,#ff4d7d,#ff6f61);
  transition:filter .15s,transform .05s;
}
.trade-broadcast-btn:hover{filter:brightness(1.08)}
.trade-broadcast-btn:active{transform:scale(.97)}
.trade-broadcast-btn:disabled{opacity:.6;cursor:default}
.trade-broadcast-btn .bc-countdown{
  font-variant-numeric:tabular-nums;font-weight:700;font-size:10px;
  padding:1px 6px;border-radius:999px;background:rgba(0,0,0,.22);
}

.poly-connect{
  display:flex;align-items:center;gap:12px;
  background:linear-gradient(135deg,rgba(255,77,125,0.08) 0%,rgba(255,77,125,0.04) 100%);
  border:1px solid rgba(255,77,125,0.2);
  border-radius:12px;
  padding:18px 20px;
  margin-top:8px;
  transition:all .3s;
}

.poly-connect:hover{
  border-color:rgba(255,77,125,0.4);
  background:rgba(255,77,125,0.12);
}

.poly-creds{
  background:linear-gradient(135deg,rgba(255,77,125,0.06) 0%,rgba(255,77,125,0.03) 100%);
  border:1px solid rgba(255,77,125,0.2);
  border-radius:12px;
  padding:20px 22px;
  margin-top:8px;
  animation:slideUp .3s ease-out;
}

@keyframes slideUp{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}

.poly-creds-head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  margin-bottom:18px;
  padding-bottom:14px;
  border-bottom:1px solid rgba(255,77,125,0.15);
}

.poly-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.poly-creds-user{color:var(--muted);font-size:12px;font-weight:500}

.poly-creds-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.poly-field{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:11px;
  color:var(--muted);
  font-weight:500;
}

.poly-field input{
  width:100%;
  background:var(--surf2);
  border:1px solid rgba(255,77,125,0.15);
  border-radius:8px;
  color:var(--text);
  font-size:12px;
  padding:10px 12px;
  outline:none;
  transition:all .2s;
}

.poly-field input:focus{
  border-color:var(--blue);
  box-shadow:0 0 0 3px rgba(255,77,125,0.1);
  background:rgba(255,77,125,0.04);
}

.poly-actions{
  display:flex;
  align-items:center;
  gap:14px;
  margin-top:18px;
  padding-top:14px;
  border-top:1px solid rgba(255,77,125,0.15);
}

#poly-status{color:var(--muted);font-size:12px;font-weight:500}

/* AI detail loading spinner */
.ai-loading{display:flex;align-items:center;justify-content:center;gap:10px;padding:40px 0;color:var(--muted);font-size:13px}
.ai-spinner{width:22px;height:22px;border-radius:50%;border:3px solid var(--border);border-top-color:var(--blue);animation:spin .8s linear infinite}

/* AI model beliefs / analysis */
.beliefs-header{font-size:14px;font-weight:700;color:var(--text);margin-bottom:12px}
.beliefs-count{font-size:12px;font-weight:500;color:var(--muted)}
.beliefs-list{display:flex;flex-direction:column;gap:10px}
.belief-item{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r);padding:12px 14px;
}
.belief-meta{display:flex;align-items:center;gap:10px;margin-bottom:7px;flex-wrap:wrap}
.belief-cat{
  font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.4px;
  color:var(--blue);background:rgba(255,77,125,.12);
  padding:2px 8px;border-radius:20px;
}
.belief-conf{font-size:11px;font-weight:700}
.belief-conf.conf-mid{color:var(--amber)}
.belief-time{font-size:11px;color:var(--muted);margin-left:auto}
.belief-text{
  font-size:12.5px;line-height:1.6;color:var(--text);
  white-space:pre-wrap;word-break:break-word;
}

#ai-detail-tabs{
  display:flex;
  padding:0 24px;
  border-bottom:1px solid var(--border);
  background:var(--surface);
  gap:4px;
}

#ai-detail-content{
  flex:0 0 auto;
  overflow:visible;
  position:relative;
}

#ai-detail-content .tab-pane{
  position:absolute;
  inset:0;
  overflow-y:auto;
  padding:18px 22px;
  display:none;
  animation:none;
}

#ai-detail-content .tab-pane.active{
  display:block;
  position:static;
  overflow:visible;
  animation:tabSlideIn .3s ease-out;
}

/* ─── CATEGORY FULL PAGE ─── */
#category-page{
  position:fixed;top:var(--nav-h);left:0;right:0;bottom:0;
  display:flex;flex-direction:column;
  background:var(--bg);overflow:hidden;z-index:50;
}
#category-page-header{
  display:flex;align-items:center;gap:12px;
  padding:14px 22px;
  background:var(--surface);border-bottom:1px solid var(--border);
  flex-shrink:0;
}
#category-page-title{font-size:18px;font-weight:700;margin:0}
#category-page-grid{
  flex:1;overflow-y:auto;
}
#category-page-loadmore-btn button{
  width:100%;padding:10px;background:var(--surf2);border:1px solid var(--border);
  color:var(--text);cursor:pointer;border-radius:var(--r);
  transition:background .12s;font-weight:600;
}
#category-page-loadmore-btn button:hover{background:var(--border)}

/* ─── MISC ─── */
.empty-msg{
  color:var(--muted);
  text-align:center;
  margin-top:60px;
  font-size:13px;
  line-height:1.8;
  animation:fadeIn .4s ease-out;
}

@keyframes fadeIn{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:translateY(0)}
}

::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{
  background:var(--border);
  border-radius:3px;
  transition:background .2s;
}
::-webkit-scrollbar-thumb:hover{background:rgba(255,77,125,0.3)}

/* ════════════════════════════════════════════════════════════════════════
   UI POLISH LAYER — visual + interaction only (no content/layout changes).
   Pure CSS, GPU-friendly transforms → stays fast and Vercel-ready.
   ════════════════════════════════════════════════════════════════════════ */
:root{
  --ease:cubic-bezier(.4,0,.2,1);
  --sh-1:0 2px 10px rgba(0,0,0,.28);
  --sh-2:0 10px 30px rgba(0,0,0,.40);
}
html{scroll-behavior:smooth}
*{scrollbar-width:thin;scrollbar-color:var(--border) transparent}

/* ── Cards: smooth lift + accent glow ── */
.scorecard{transition:border-color .2s var(--ease),background .2s var(--ease),transform .2s var(--ease),box-shadow .2s var(--ease)}
.scorecard:hover{transform:translateY(-3px);box-shadow:var(--sh-2);border-color:var(--blue)}
.ai-model-card{transition:transform .2s var(--ease),box-shadow .2s var(--ease)}
.ai-model-card:hover{transform:translateY(-3px);box-shadow:var(--sh-2)}

/* ── Buttons: tactile press + cleaner hover ── */
button{transition:filter .15s var(--ease),background .15s var(--ease),border-color .15s var(--ease),color .15s var(--ease),transform .1s var(--ease),box-shadow .15s var(--ease)}
button:active:not(:disabled){transform:translateY(1px) scale(.985)}
button:disabled{opacity:.55;cursor:default}
.view-all-btn:hover{box-shadow:0 0 0 1px rgba(255,77,125,.25)}
.load-more-btn:hover,#category-page-loadmore-btn button:hover{border-color:var(--blue);background:var(--surf2);color:var(--text)}

/* ── Keyboard accessibility ring ── */
button:focus-visible,input:focus-visible,.tab:focus-visible,.category-open-cell:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:6px}

/* ── Tables: interactive rows + crisp sticky headers ── */
thead th{position:sticky;top:0;z-index:1;background:var(--surface);text-transform:uppercase;font-size:10.5px;letter-spacing:.4px;color:var(--muted)}
tbody tr{transition:background .12s var(--ease)}
tbody tr:hover{background:var(--surf2)}
.category-open-cell{transition:color .12s var(--ease)}
.category-open-cell:hover{text-decoration:underline;filter:brightness(1.15)}

/* ── Tabs: animated active underline ── */
.tab{position:relative;transition:color .15s var(--ease)}
.tab::after{content:"";position:absolute;left:10px;right:10px;bottom:-1px;height:2px;background:var(--blue);border-radius:2px;transform:scaleX(0);transition:transform .22s var(--ease)}
.tab.active::after{transform:scaleX(1)}
.tab:hover{color:var(--text)}

/* ── Category tags + pie: gentle interactivity ── */
.cat-tag{transition:transform .12s var(--ease),box-shadow .12s var(--ease)}
.cat-tag:hover{transform:translateY(-1px);box-shadow:var(--sh-1)}
.pie-slice{transition:opacity .15s var(--ease);cursor:pointer}
.pie-slice:hover{opacity:.82}
.pie-leg{transition:background .12s var(--ease);border-radius:6px;padding:2px 5px;margin:0 -3px}
.pie-leg:hover{background:var(--surf2)}

/* ── Inputs: soft focus glow ── */
#search:focus,input:focus{box-shadow:0 0 0 3px rgba(255,77,125,.14)}

/* ── Smooth content entrance for view changes ── */
@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
#detail-panel,#ai-model-detail,#category-page,#event-detail,#search-results,.tab-pane.active{animation:fadeUp .26s var(--ease)}

/* ── Honor reduced-motion + keep paint cheap ── */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}
}

/* ════════════════════════════════════════════════════════════════════════
   MODERN THEME — refreshed palette, ambient backdrop, glass + gradient accents.
   Visual only (content/layout intact). Cascades via CSS variables.
   ════════════════════════════════════════════════════════════════════════ */
:root{
  --bg:#0a0d1a;
  --surface:#131a30;
  --surf2:#1c2542;
  --border:#2a3458;
  --text:#eaeffb;
  --muted:#858fb4;
  --green:#28d9a9;
  --red:#fb5d72;
  --blue:#ff4d7d;
  --amber:#fbbf24;
  --accent:#ff4d7d;
  --accent2:#ff85aa;
  --r:13px;
  --grad:linear-gradient(135deg,#ff4d7d,#ff85aa);
}

/* Ambient gradient backdrop */
body{
  background:
    radial-gradient(1100px 560px at 10% -8%, rgba(255,77,125,.12), transparent 58%),
    radial-gradient(900px 460px at 102% -4%, rgba(255,77,125,.08), transparent 55%),
    var(--bg);
  background-attachment:fixed;
}

/* Glassy top nav + gradient wordmark */
#topnav{
  background:rgba(19,26,48,.70);
  backdrop-filter:blur(14px) saturate(150%);
  -webkit-backdrop-filter:blur(14px) saturate(150%);
  border-bottom:1px solid rgba(255,77,125,.16);
}
.top-tabs{
  background:rgba(28,37,66,.55);
  border-color:rgba(255,77,125,.14);
}
.top-tab.active{
  background:linear-gradient(135deg,rgba(255,77,125,.22),rgba(255,77,125,.10));
  box-shadow:0 1px 2px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,77,125,.28);
}
.logo{
  background:var(--grad);-webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;color:transparent;font-weight:900;letter-spacing:.2px;
}

/* Search */
#search{background:rgba(28,37,66,.55);border-radius:11px}
#search:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(255,77,125,.18)}

/* Cards: soft gradient surface + accent glow on hover */
.scorecard{background:linear-gradient(180deg,rgba(28,37,66,.55),rgba(19,26,48,.55));border:1px solid var(--border)}
.scorecard:hover{
  border-color:transparent;transform:translateY(-4px);
  box-shadow:0 0 0 1px rgba(255,77,125,.50),0 16px 40px rgba(0,0,0,.50),0 0 30px rgba(255,77,125,.14);
}
.ai-model-card:hover{box-shadow:0 16px 40px rgba(0,0,0,.50),0 0 26px rgba(255,77,125,.14)}

/* Primary buttons → gradient */
.copy-btn,.lc-save-btn{background:var(--grad);border:none;color:#fff;font-weight:700;box-shadow:0 4px 14px rgba(255,77,125,.30)}
.copy-btn:hover,.lc-save-btn:hover{filter:brightness(1.07);box-shadow:0 7px 22px rgba(255,77,125,.45)}
.copy-btn.copied{background:var(--green);box-shadow:0 4px 14px rgba(40,217,169,.35)}

/* Outlined buttons → accent glow */
.view-all-btn:hover,.load-more-btn:hover,#category-page-loadmore-btn button:hover{
  border-color:var(--accent);color:var(--text);
  box-shadow:0 0 0 1px rgba(255,77,125,.30),0 0 16px rgba(255,77,125,.12);
}

/* Tabs: gradient active underline */
.tab::after{background:var(--grad);height:3px}
.tab.active{color:var(--text)}

/* Tables: accent headers + tinted row hover */
thead th{background:rgba(19,26,48,.94);color:var(--accent2);letter-spacing:.5px}
tbody tr:hover{background:rgba(255,77,125,.07)}

/* Category tags → modern pills */
.cat-tag{border-radius:999px;background:rgba(28,37,66,.70);border:1px solid var(--border)}
.cat-tag:hover{border-color:var(--accent);box-shadow:0 0 0 1px rgba(255,77,125,.25)}

/* Accents */
.dot-live{filter:drop-shadow(0 0 6px var(--green))}
::-webkit-scrollbar-thumb{background:linear-gradient(180deg,var(--accent),var(--accent2))}

/* ── Modal: glassy backdrop, modern card, close button ── */
#auth-modal,#username-modal{backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);background:rgba(6,9,20,.6)!important}
#auth-modal > div,#username-modal > div{animation:fadeUp .22s var(--ease)}
.modal-close{
  position:absolute;top:10px;right:12px;width:30px;height:30px;
  display:flex;align-items:center;justify-content:center;
  background:var(--surf2);border:1px solid var(--border);color:var(--muted);
  font-size:20px;line-height:1;cursor:pointer;border-radius:50%;padding:0;
  transition:color .12s var(--ease),background .12s var(--ease),transform .12s var(--ease);
}
.modal-close:hover{color:var(--text);background:var(--border);transform:rotate(90deg)}
/* Modal primary buttons → gradient (override inline blue) */
#auth-modal button[onclick*="Signup"],#auth-modal button[onclick*="Login"],#username-modal button[onclick]{
  background:var(--grad)!important;border:none!important;box-shadow:0 4px 14px rgba(255,77,125,.30)!important;
}

/* ════════════════════════════════════════════════════════════════════════
   MODERN V2 — elevated tables, cards, detail / model / profile / event views
   ════════════════════════════════════════════════════════════════════════ */

/* Tables: framed, rounded, tabular numbers, accent row hover bar */
.tbl-wrap{
  border:1px solid var(--border);border-radius:14px;overflow:hidden;
  background:linear-gradient(180deg,rgba(28,37,66,.32),rgba(19,26,48,.32));
  box-shadow:0 10px 30px rgba(0,0,0,.26);
}
thead th{
  background:rgba(13,18,36,.96);color:var(--accent2);
  font-size:10px;font-weight:700;letter-spacing:.7px;
  padding:12px 14px;border-bottom:1px solid var(--border);
}
td{padding:12px 14px;font-variant-numeric:tabular-nums}
tbody tr{position:relative;border-bottom:1px solid rgba(255,77,125,.06);transition:background .12s var(--ease),box-shadow .12s var(--ease)}
tbody tr:hover{background:rgba(255,77,125,.08);box-shadow:inset 3px 0 0 var(--accent)}
tbody tr:last-child{border-bottom:none}

/* Scorecards: crisper stats + gradient divider */
.sc-divider{height:1px;background:linear-gradient(90deg,transparent,var(--border),transparent)}
.sc-val,.dh-val,.ai-detail-stat-val,.stat-card .sc-val,.hero-circle{font-variant-numeric:tabular-nums}

/* Avatars get a soft gradient ring (detail / model / scorecard) */
.sc-avatar,.dh-avatar,.ai-detail-avatar{box-shadow:0 0 0 2px rgba(255,77,125,.42),0 4px 14px rgba(255,77,125,.18)}

/* Overview / stat cards → glassy with accent glow */
.ov-card,.stat-card{background:linear-gradient(180deg,rgba(28,37,66,.48),rgba(19,26,48,.48));border:1px solid var(--border);border-radius:14px}
.ov-card:hover{border-color:rgba(255,77,125,.45);box-shadow:0 12px 30px rgba(0,0,0,.4),0 0 22px rgba(255,77,125,.10)}
.ov-section-title,.sec-title{color:var(--text);font-weight:700;letter-spacing:.2px}

/* Tabs: bolder modern underline */
.tab{font-weight:600}
.tab.active{color:var(--text)}
.tab::after{height:3px;border-radius:3px;background:var(--grad)}

/* Chart frames */
.chart-box{border:1px solid var(--border);border-radius:14px;overflow:hidden;background:rgba(13,18,36,.35)}

/* Win-rate / PnL glow accents */
.wr-pos,.pnl-pos{text-shadow:0 0 14px rgba(40,217,169,.22)}
.wr-neg,.pnl-neg{text-shadow:0 0 14px rgba(251,93,114,.18)}

/* Section headers (detail/profile/event) */
.dh-name,.ai-detail-name{letter-spacing:.2px}
.hero-circle{box-shadow:0 0 0 1px var(--border),0 6px 20px rgba(0,0,0,.30)}

/* ════════════════════════════════════════════════════════════════════════
   UNIQUE ACCENT — violet / purple replaces blue (final palette override)
   ════════════════════════════════════════════════════════════════════════ */
:root{
  --blue:#ff4d7d;
  --accent:#ff4d7d;
  --accent2:#ff85aa;
  --grad:linear-gradient(135deg,#ff4d7d,#ff85aa);
}
::selection{background:rgba(255,77,125,.35);color:#fff}
tbody tr:hover{background:rgba(255,77,125,.09);box-shadow:inset 3px 0 0 var(--accent)}
.scorecard:hover{box-shadow:0 0 0 1px rgba(255,77,125,.45),0 16px 40px rgba(0,0,0,.5),0 0 30px rgba(255,77,125,.14)}
#search:focus{box-shadow:0 0 0 3px rgba(255,77,125,.18)}

/* ── Bright glossy "Social Predict" wordmark ── */
.logo{
  font-weight:900;font-size:18px;letter-spacing:.4px;
  background:linear-gradient(95deg,#ff5e9e 0%,#ff3d7d 42%,#ffb24d 100%);
  -webkit-background-clip:text;background-clip:text;
  -webkit-text-fill-color:transparent;color:transparent;
  filter:drop-shadow(0 0 9px rgba(255,95,196,.40)) drop-shadow(0 0 2px rgba(176,107,255,.5));
  background-size:200% auto;animation:logoShine 6s linear infinite;
}
@keyframes logoShine{to{background-position:200% center}}
@media (prefers-reduced-motion:reduce){.logo{animation:none}}

/* ── Copy button → original BLUE (the only blue allowed) ── */
.copy-btn{background:#4fa3e3!important;border:1px solid #4fa3e3!important;color:#fff!important;box-shadow:none!important}
.copy-btn:hover{filter:brightness(1.1)!important}

@media (max-width:760px){
  .home-trending-row{grid-template-columns:1fr}
  .home-news-card{height:auto;min-height:280px}
}
.copy-btn.copied{background:var(--green)!important;border-color:var(--green)!important}

/* ── Bright glossy warm wordmark (gold→orange→coral, no purple) ── */
.logo{
  background:linear-gradient(95deg,#ff5e9e 0%,#ff3d7d 45%,#ff8ab5 100%)!important;
  -webkit-background-clip:text!important;background-clip:text!important;
  -webkit-text-fill-color:transparent!important;color:transparent!important;
  filter:drop-shadow(0 0 9px rgba(255,94,158,.45)) drop-shadow(0 0 2px rgba(255,61,125,.5))!important;
  font-weight:900;font-size:18px;letter-spacing:.4px;
  background-size:200% auto!important;
}

/* ── Event page ── */
.event-head-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.event-view-btn{
  flex-shrink:0;align-self:flex-start;background:var(--grad);color:#fff;text-decoration:none;
  font-weight:700;font-size:12px;padding:8px 16px;border-radius:10px;
  box-shadow:0 4px 14px rgba(255,77,125,.30);white-space:nowrap;
  transition:filter .15s,transform .1s,box-shadow .15s;
}
.event-view-btn:hover{filter:brightness(1.07);box-shadow:0 6px 20px rgba(255,77,125,.45)}
.event-view-btn:active{transform:translateY(1px)}
.event-legend{display:flex;flex-wrap:wrap;gap:8px 16px;margin:2px 0 10px}
.evt-leg{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--text)}
.evt-leg i{width:11px;height:11px;border-radius:3px;flex-shrink:0}
.evt-mkt-row{cursor:pointer}
.evt-mkt-row.sel{background:rgba(255,77,125,.12);box-shadow:inset 3px 0 0 var(--accent)}
.evt-scope-reset{color:var(--accent);cursor:pointer;font-weight:700}
.evt-scope-reset:hover{text-decoration:underline}

/* Event chart: range filters, corner View button, crosshair legend values */
#event-detail-header{position:relative}
.event-view-btn{position:absolute;top:14px;right:20px;align-self:auto;z-index:5}
.event-chart-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:6px}
.evt-range-btns{display:inline-flex;gap:4px;background:var(--surf2);border:1px solid var(--border);border-radius:9px;padding:3px}
.evt-range-btns button{background:transparent;border:none;color:var(--muted);font-size:11px;font-weight:700;padding:5px 11px;border-radius:6px;cursor:pointer;transition:color .12s,background .12s,box-shadow .12s}
.evt-range-btns button:hover{color:var(--text)}
.evt-range-btns button.active{background:var(--grad);color:#fff;box-shadow:0 2px 8px rgba(255,77,125,.35)}
.event-legend{align-items:center}
.evt-leg-name{color:var(--muted)}
.evt-leg-val{color:var(--text);font-variant-numeric:tabular-nums;min-width:34px;text-align:right;font-weight:700}

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE — fits every screen (phone → tablet → laptop → monitor → TV).
   Minimal + additive; cascades on top of existing layout.
   ════════════════════════════════════════════════════════════════════════ */
html,body{overflow-x:hidden;max-width:100vw}
img,svg{max-width:100%}
.tbl-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
/* Cards fluidly fill the row instead of a fixed 5 columns */
.row-cards{grid-template-columns:repeat(auto-fit,minmax(165px,1fr))}

/* Real mobile viewport height (avoids the 100vh browser-chrome gap) */
@supports (height:100dvh){
  body{height:100dvh}
  #home{height:calc(100dvh - var(--nav-h))}
}

/* Ultrawide / TV: keep content centered, not stretched edge-to-edge */
@media (min-width:1700px){ #categories-container{max-width:1700px;margin:0 auto} }

/* Tablet */
@media (max-width:1024px){
  #home{padding:16px 16px 36px}
  .dh-stats{flex-wrap:wrap;gap:14px}
  .ov-grid{grid-template-columns:repeat(2,1fr)}
}

/* Phone */
@media (max-width:640px){
  /* Compact header that always fits: small logo, tight tabs, search as an icon. */
  #topnav{gap:7px;padding:0 10px}
  .logo{font-size:14px!important}
  .portal-logo,.portal-logo img{width:30px;height:26px}
  .top-tabs{height:28px;padding:2px;gap:1px}
  .top-tab{min-width:auto;padding:0 7px;font-size:11px;height:24px;line-height:24px}
  .nav-search-status{display:none}
  .nav-right{gap:8px!important}
  #signup-btn{padding:5px 9px!important;font-size:11px!important}

  /* Search collapses to an icon; tapping it opens a full-width search bar. */
  #mobile-search-btn{display:flex}
  .search-wrap{display:none}
  #topnav.msearch .search-wrap{
    display:flex;align-items:center;gap:8px;
    position:fixed;top:0;left:0;right:0;height:var(--nav-h);z-index:1300;
    width:100%;transform:none;min-width:0;
    background:var(--surface);border-bottom:1px solid var(--border);
    padding:0 12px;
  }
  #topnav.msearch .search-wrap #search{flex:1;width:auto}
  #topnav.msearch #mobile-search-close{display:flex}
  #home{padding:12px 12px 28px}
  .row-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .scorecard{min-width:0}
  .sc-top{min-width:0}
  .sc-name{min-width:0;overflow:hidden;text-overflow:ellipsis}
  .sc-stat{gap:6px}
  .sc-lbl{min-width:0;overflow:hidden;text-overflow:ellipsis}
  .row-title{font-size:14px}
  .ov-grid{grid-template-columns:1fr 1fr}
  .dh-name,.ai-detail-name{font-size:15px}

  /* AI model header: avatar/name on top, stat values stacked one under another. */
  #ai-detail-header{flex-wrap:wrap;align-items:flex-start;gap:12px;padding:14px 16px}
  #ai-detail-info{width:100%}
  .ai-detail-stats{flex-direction:column;align-items:flex-start;gap:8px;width:100%}
  .ai-detail-stat{flex-direction:row;align-items:baseline;gap:8px}
  .ai-detail-stat-lbl{min-width:96px}

  .pie-wrap{flex-direction:column;align-items:flex-start;gap:10px}
  .event-view-btn{top:10px;right:12px;padding:6px 12px;font-size:11px}
  .event-chart-head{gap:8px}
  .auth-card,#username-modal > div{max-width:94vw}

  /* Profile header: stack avatar/name/actions over the stats so nothing
     overlaps and there's no left/right scroll. */
  #detail-header{flex-wrap:wrap;gap:10px;padding:12px 14px}
  #detail-user-info{flex-wrap:wrap;gap:10px 12px;width:100%}
  .dh-text{flex:1 1 140px}
  .dh-sub{max-width:100%}
  .dh-stats{width:100%;justify-content:flex-start;gap:22px;flex-wrap:wrap}
  .dh-stat{align-items:flex-start}

  /* Header right cluster stays put and centered (avatar circle alignment). */
  .nav-right{flex-shrink:0;gap:8px}
  #profile-icon{flex-shrink:0}

  /* Search results become a full-screen sheet on phones. */
  #search-results{
    position:fixed;left:0!important;right:0;top:var(--nav-h)!important;bottom:0;
    width:100%!important;max-height:none;transform:none!important;
    border:0;border-radius:0;box-shadow:none;
  }
  .sr-card{padding:11px 12px}
  .sr-meta{max-width:100%}
}

.event-chart{width:100%}

/* ── Toast notification (bottom-right) ── */
#app-toast{
  position:fixed;bottom:20px;right:20px;z-index:2000;
  background:var(--surface);border:1px solid var(--border);color:var(--text);
  padding:12px 16px;border-radius:12px;font-size:13px;font-weight:600;
  box-shadow:0 12px 30px rgba(0,0,0,.45);max-width:min(90vw,340px);
  opacity:0;transform:translateY(12px);pointer-events:none;
  transition:opacity .25s var(--ease),transform .25s var(--ease);
}
#app-toast.toast-show{opacity:1;transform:none}
#app-toast.toast-info{border-color:var(--accent);box-shadow:0 12px 30px rgba(0,0,0,.45),0 0 18px rgba(255,77,125,.18)}
@media (max-width:640px){#app-toast{left:12px;right:12px;bottom:12px;max-width:none;text-align:center}}

/* ───────────────────────────────────────────────────────────────────────────
   RESPONSIVE REINFORCEMENT — additive only. Fills the gaps between the existing
   breakpoints (1024 / 640) so every tab and page stays aligned and readable from
   ultrawide desktop down to small phones, without changing any markup or logic.
   ─────────────────────────────────────────────────────────────────────────── */

/* Universal safety nets: nothing escapes its container, long strings wrap. */
img,video,canvas{max-width:100%;height:auto}
table{max-width:100%}
.mkt,.sr-meta,.broadcast-title{overflow-wrap:anywhere}

/* Laptop / small desktop */
@media (max-width:1280px){
  #home{padding:18px 20px 36px}
  .sec-inner,#categories-container{padding-left:18px;padding-right:18px}
}

/* iPad portrait / large phone — collapse dense 2-up areas to a comfortable width */
@media (max-width:820px){
  #broadcasts-page-header{padding:14px 16px}
  #broadcasts-grid{padding:14px 12px 32px}
  .broadcast-copy-card{padding:16px}
  .ov-grid{grid-template-columns:repeat(2,1fr)}
  .dh-stats{flex-wrap:wrap}
}

/* Small phone */
@media (max-width:400px){
  #topnav{gap:6px;padding:0 10px}
  .logo{font-size:14px!important}
  .top-tabs{height:28px}
  .top-tab{min-width:auto;padding:0 6px;font-size:10px}
  #home{padding:10px 10px 24px}
  /* One scorecard per row on the smallest phones so nothing is cramped. */
  .row-cards{grid-template-columns:1fr;gap:8px}
  .ov-grid{grid-template-columns:1fr}
  #broadcasts-page-header{padding:12px 12px}
  #broadcasts-page-header h2{font-size:16px}
  .broadcast-copy-options{grid-template-columns:1fr}
  .broadcast-copy-result-row{font-size:12px;padding:8px 9px}
  .broadcast-title{font-size:12.5px}
}

/* ─── LEADERBOARD ─── */
#leaderboard-page{
  position:fixed;top:var(--nav-h);left:0;right:0;bottom:0;
  display:flex;flex-direction:column;
  background:var(--bg);overflow:hidden;z-index:45;
}
#leaderboard-header{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:16px 24px;border-bottom:1px solid var(--border);background:var(--surface);
  flex-shrink:0;
}
#leaderboard-header h2{font-size:18px;line-height:1;margin:0}
.lb-filter-toggle{
  padding:7px 14px;border:1px solid var(--border);border-radius:8px;
  background:var(--surf2);color:var(--text);font-size:12px;font-weight:700;cursor:pointer;
}
.lb-filter-toggle:hover{border-color:var(--blue)}
.lb-filters{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;
  padding:14px 24px;border-bottom:1px solid var(--border);background:var(--surface);
  flex-shrink:0;
}
.lb-filter{display:flex;flex-direction:column;gap:5px;min-width:0}
.lb-filter > label{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.4px}
.lb-filter-row{display:flex;gap:6px}
.lb-op,.lb-th,#lb-cat-select{
  background:var(--surf2);border:1px solid var(--border);border-radius:7px;
  color:var(--text);font-size:12px;padding:7px 9px;outline:none;min-width:0;
}
.lb-op{flex:0 0 84px}
.lb-th{flex:1;width:100%}
#lb-cat-select{width:100%}
.lb-op:focus,.lb-th:focus,#lb-cat-select:focus{border-color:var(--blue)}
.lb-filter-clear{
  align-self:end;padding:8px 12px;border:1px solid var(--border);border-radius:7px;
  background:transparent;color:var(--muted);font-size:12px;font-weight:700;cursor:pointer;height:fit-content;
}
.lb-filter-clear:hover{color:var(--text);border-color:var(--blue)}

#leaderboard-body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:0 0 40px}
.lb-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
#leaderboard-table{width:100%;border-collapse:collapse;min-width:680px}
#leaderboard-table thead th{
  position:sticky;top:0;z-index:3;
  background:var(--surface);border-bottom:1px solid var(--border);
  font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.5px;color:var(--muted);
  text-align:left;padding:12px 14px;white-space:nowrap;
}
#leaderboard-table th.lb-num{text-align:right}
#leaderboard-table th.lb-sortable{cursor:pointer;user-select:none}
#leaderboard-table th.lb-sortable:hover{color:var(--text)}
#leaderboard-table th.lb-sortable::after{content:'';opacity:.35;margin-left:5px}
#leaderboard-table th.lb-sortable.sort-desc::after{content:'▼';opacity:1;color:var(--blue)}
#leaderboard-table th.lb-sortable.sort-asc::after{content:'▲';opacity:1;color:var(--blue)}
#leaderboard-table td{padding:11px 14px;border-bottom:1px solid var(--border);font-size:13px;white-space:nowrap}
#leaderboard-table td.lb-num{text-align:right;font-variant-numeric:tabular-nums}
.lb-rankcol{width:44px;color:var(--muted);font-size:12px;text-align:center}
.lb-row{cursor:pointer;transition:background .12s}
.lb-row:hover{background:var(--surf2)}
.lb-row-loading{cursor:default}
.lb-row-loading:hover{background:transparent}
.lb-row-loading .lb-avatar{opacity:.55;filter:saturate(.65)}
.lb-trader{display:flex;align-items:center;gap:9px;min-width:0}
.lb-avatar{width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:12px;color:#fff;flex-shrink:0}
.lb-name{font-weight:700;overflow:hidden;text-overflow:ellipsis}
.lb-skel{
  display:inline-block;height:12px;max-width:100%;border-radius:999px;vertical-align:middle;
  background:linear-gradient(90deg,rgba(255,255,255,.055) 0%,rgba(255,255,255,.14) 42%,rgba(255,255,255,.055) 84%);
  background-size:220% 100%;animation:lbSkel 1.25s ease-in-out infinite;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.035);
}
.lb-name .lb-skel{height:13px}
@keyframes lbSkel{0%{background-position:120% 0}100%{background-position:-120% 0}}
.lb-empty{text-align:center;color:var(--muted);padding:28px 12px!important}
#lb-loadmore-wrap{display:flex;justify-content:center;padding:16px}
.lb-loadmore{
  padding:10px 22px;border:1px solid var(--border);border-radius:8px;
  background:var(--surf2);color:var(--text);font-size:13px;font-weight:700;cursor:pointer;
}
.lb-loadmore:hover{border-color:var(--blue)}
.lb-loadmore:disabled{opacity:.5;cursor:default}
.lb-status{text-align:center;color:var(--muted);font-size:12px;padding:0 12px 18px}

@media (max-width:640px){
  #leaderboard-header{padding:14px 14px}
  .lb-filters{padding:12px 14px;grid-template-columns:1fr 1fr}
  #leaderboard-table td,#leaderboard-table thead th{padding:10px 10px}
}
@media (max-width:400px){
  .lb-filters{grid-template-columns:1fr}
}

/* ─── Trending event — modern black scorecard (Polymarket-style, on-site) ─── */
.home-trending-controls{display:none}            /* in-card pager replaces these */
.home-trending-body{padding:0;min-height:0;position:relative}
.te-card{
  position:relative;cursor:pointer;
  height:500px;overflow:hidden;              /* fixed height, max 4 outcomes */
  background:radial-gradient(120% 70% at 18% -20%,rgba(79,163,227,.10),transparent 55%),#0a0b0e;
  border:1px solid #1c2030;border-radius:14px;padding:16px;
  box-shadow:0 18px 48px rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.04);
  transition:border-color .15s;
}
.te-card:hover{border-color:#2b3350}

/* Floating prev/next controls — overlaid on the card edges, not in the frame */
.te-float{
  position:absolute;top:50%;transform:translateY(-50%);z-index:5;
  width:38px;height:38px;border-radius:50%;
  border:1px solid rgba(255,255,255,.14);background:rgba(10,12,18,.72);
  color:#fff;font-size:20px;line-height:1;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  backdrop-filter:blur(6px);box-shadow:0 6px 18px rgba(0,0,0,.5);
  transition:background .12s,border-color .12s;
}
.te-float:hover{background:rgba(26,32,48,.9);border-color:#3a4566}
.te-float-prev{left:8px}
.te-float-next{right:8px}
.te-float-count{
  position:absolute;bottom:10px;left:50%;transform:translateX(-50%);z-index:5;
  font-size:11.5px;font-weight:700;color:#cdd3df;
  background:rgba(10,12,18,.7);border:1px solid rgba(255,255,255,.1);
  padding:3px 10px;border-radius:999px;backdrop-filter:blur(6px);
}

/* Two columns: info+outcomes (left) · legend+chart (right) */
/* Desktop: info+outcomes+resolution stacked left, chart spanning the right. */
.te-grid{
  display:grid;height:100%;
  grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);
  grid-template-rows:auto auto 1fr;
  grid-template-areas:"head chart" "outcomes chart" "resolution chart";
  column-gap:18px;align-items:start;
}
.te-head{grid-area:head;margin-bottom:12px}
.te-outcomes{grid-area:outcomes}
.te-chartbox{grid-area:chart;min-width:0;min-height:0;display:flex;flex-direction:column;gap:10px;height:100%}
.te-resolution{grid-area:resolution;margin-top:12px}

.te-head{display:flex;gap:11px;align-items:flex-start}
.te-img{width:50px;height:50px;border-radius:10px;object-fit:cover;flex-shrink:0;background:#111}
.te-head-text{min-width:0;flex:1}
.te-tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:6px}
.te-tag{font-size:10px;font-weight:700;color:#c2c9d6;background:#161a24;border:1px solid #262c3c;border-radius:7px;padding:3px 9px}
.te-title{font-size:20px;font-weight:800;line-height:1.2;color:#fff;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.te-vol{font-size:12px;color:#8b93a7;font-weight:600;margin-top:5px}

/* Outcome rows */
.te-outcomes{display:flex;flex-direction:column}
.te-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto auto;gap:11px;align-items:center;padding:9px 4px;border-top:1px solid #14171f;cursor:pointer;transition:background .12s}
.te-row:first-child{border-top:0}
.te-row:hover{background:#11141b}
/* Empty placeholder slot — same height as a real row, no content/hover. */
.te-row-empty{pointer-events:none}
.te-row-empty .te-row-ic-empty{background:#0f121a}
.te-row-ic{width:34px;height:34px;border-radius:7px;object-fit:cover;background:#111}
.te-row-ic-empty{background:#161a24}
.te-row-main{min-width:0}
.te-row-name{font-size:14px;font-weight:700;color:#fff;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.te-row-vol{font-size:11px;color:#7a8298;font-weight:600;margin-top:1px}
.te-row-change{font-size:12px;font-weight:700;white-space:nowrap}
.te-row-change.te-up{color:#22c55e}
.te-row-change.te-down{color:#ff4d7d}
.te-row-change.te-flat{color:#6b7488}
.te-row-pct{font-size:20px;font-weight:800;color:#fff;font-variant-numeric:tabular-nums;text-align:right;min-width:52px}

/* Resolution */
.te-resolution{border-top:1px solid #14171f;padding-top:11px}
.te-res-title{font-size:13px;font-weight:800;color:#fff;margin-bottom:5px}
.te-res-text{font-size:12px;line-height:1.55;color:#8b93a7;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}

/* Legend + chart */
.te-legend{display:flex;flex-wrap:wrap;gap:8px 16px;margin-bottom:2px}
.te-leg{display:flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;color:#c2c9d6}
.te-leg b{color:#fff;font-weight:800}
.te-leg-dot{width:10px;height:10px;border-radius:3px;flex-shrink:0}
/* Chart fills the spanning right cell on desktop (flex), fixed height on phone. */
.te-chart{flex:1 1 auto;min-height:260px;overflow:hidden;border-radius:8px}
.te-chart .te-muted{display:flex;align-items:center;justify-content:center;height:100%}
.te-muted{color:#6b7488;font-size:12px}

@media (max-width:760px){
  /* Single column, nothing cut: event title → market options → chart →
     resolution. Card grows to fit; the chart shows in full at a fixed height. */
  .te-card{height:auto;overflow:visible}
  .te-grid{display:flex;flex-direction:column;height:auto;gap:14px}
  .te-head{order:1;margin-bottom:0}
  .te-outcomes{order:2}
  .te-chartbox{order:3;height:auto}
  .te-resolution{order:4;margin-top:0}
  .te-title{font-size:18px}
  .te-chart{flex:none;height:300px;min-height:0}
}
