[hidden]{ display:none !important; }

:root{
  --bg:#0A0D12;
  --surface:#12161D;
  --surface-2:#171C25;
  --surface-3:#1D2330;
  --border:#232A35;
  --border-soft:#1A202B;
  --text:#E6E9EE;
  --text-muted:#8891A1;
  --text-faint:#5C6472;
  --accent:#E3A130;
  --accent-strong:#F2B94A;
  --accent-soft:rgba(227,161,48,0.14);
  --accent-soft-2:rgba(227,161,48,0.07);
  --positive:#4FAE7A;
  --positive-soft:rgba(79,174,122,0.14);
  --negative:#E0616B;
  --negative-soft:rgba(224,97,107,0.14);
  --candidate:#4FC1C8;
  --candidate-soft:rgba(79,193,200,0.14);
  color-scheme: dark;
}
@media (prefers-color-scheme: light){
  :root{
    --bg:#F2F3F6;
    --surface:#FFFFFF;
    --surface-2:#F7F8FA;
    --surface-3:#EEF0F4;
    --border:#E1E4E9;
    --border-soft:#EAECF0;
    --text:#171B22;
    --text-muted:#5B6472;
    --text-faint:#8A93A1;
    --accent:#B87A1B;
    --accent-strong:#96620F;
    --accent-soft:rgba(184,122,27,0.12);
    --accent-soft-2:rgba(184,122,27,0.06);
    --positive:#2F8F5B;
    --positive-soft:rgba(47,143,91,0.12);
    --negative:#C43D48;
    --negative-soft:rgba(196,61,72,0.12);
    --candidate:#1B8E94;
    --candidate-soft:rgba(27,142,148,0.10);
    color-scheme: light;
  }
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background:var(--bg);
  color:var(--text);
  font-family:'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing:antialiased;
}
.mono{ font-family:'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric:tabular-nums; }

/* ---- Report widget (fixed top-left) ---- */
.report-widget{ position:fixed; top:16px; left:16px; z-index:50; }
.report-widget-btn{
  position:relative; width:38px; height:38px; border-radius:10px; border:1px solid var(--border);
  background:var(--surface); color:var(--text-muted); cursor:pointer; display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 10px rgba(0,0,0,0.15);
}
.report-widget-btn:hover{ color:var(--text); border-color:var(--text-faint); }
.report-widget-btn svg{ width:18px; height:18px; }
.report-widget-badge{
  position:absolute; top:-5px; right:-5px; min-width:16px; height:16px; padding:0 3px; border-radius:8px;
  background:var(--accent); color:var(--bg); font-size:9.5px; font-weight:700; display:flex; align-items:center; justify-content:center;
}
.report-widget-progress{ position:absolute; left:0; right:0; bottom:-6px; height:3px; background:var(--surface-3); border-radius:2px; overflow:hidden; }
.report-widget-progress-fill{ height:100%; background:var(--accent); transition:width 0.4s ease; }
.report-widget-panel{
  position:absolute; top:46px; left:0; width:280px; max-height:360px; overflow-y:auto;
  background:var(--surface); border:1px solid var(--border); border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,0.25); padding:10px;
}
.report-widget-panel-title{ font-size:11px; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-faint); font-weight:600; margin-bottom:8px; padding:0 4px; }
.report-widget-list{ display:flex; flex-direction:column; gap:8px; }
.report-job{ padding:8px 9px; border-radius:7px; background:var(--surface-2); border:1px solid var(--border-soft); }
.report-job-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; }
.report-job-symbol{ font-weight:700; }
.report-job-status{ color:var(--text-muted); font-size:11px; }
.report-job-bar{ height:3px; background:var(--surface-3); border-radius:2px; overflow:hidden; margin-top:6px; }
.report-job-bar-fill{ height:100%; background:var(--accent); transition:width 0.4s ease; }
.report-job-download{ display:inline-block; font-size:11.5px; font-weight:600; color:var(--positive); text-decoration:none; }
.report-job-download:hover{ text-decoration:underline; }
.report-job-error{ display:inline-block; margin-top:6px; font-size:11.5px; font-weight:600; color:var(--negative); cursor:help; }
.report-job-actions{ display:flex; align-items:center; gap:10px; margin-top:6px; }
.report-job-backtest{
  background:var(--candidate-soft); border:1px solid var(--candidate); color:var(--candidate); border-radius:14px;
  padding:3px 10px; font-size:10.5px; font-weight:700; cursor:pointer; font-family:inherit;
}
.report-job-watched{ font-size:10.5px; font-weight:600; color:var(--candidate); }

/* ---- View tabs ---- */
.view-tabs{ display:flex; gap:4px; margin-bottom:18px; border-bottom:1px solid var(--border); }
.view-tab{
  background:transparent; border:none; border-bottom:2px solid transparent; color:var(--text-faint);
  font-size:13px; font-weight:600; font-family:inherit; padding:9px 4px; margin-right:18px; cursor:pointer;
  display:flex; align-items:center; gap:6px;
}
.view-tab:hover{ color:var(--text-muted); }
.view-tab.active{ color:var(--accent); border-bottom-color:var(--accent); }
.view-tab-badge{
  background:var(--candidate); color:#fff; font-size:9.5px; font-weight:700; border-radius:8px;
  padding:1px 5px; min-width:14px; text-align:center;
}

/* ---- Charts (backtest) view ---- */
.charts-list{ display:grid; grid-template-columns:repeat(auto-fill, minmax(360px, 1fr)); gap:14px; margin-bottom:16px; }
.chart-card{ background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:14px; }
.chart-card-header{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:8px; }
.chart-card-symbol{ font-weight:700; font-size:14px; margin-right:8px; }
.chart-card-status{ font-size:11px; color:var(--text-faint); }
.chart-card-actions{ display:flex; align-items:center; gap:8px; flex:none; }
.chart-pnl{ font-family:'IBM Plex Mono', monospace; font-weight:700; font-size:13px; }
.chart-pnl.pos{ color:var(--positive); }
.chart-pnl.neg{ color:var(--negative); }
.chart-remove-btn{
  width:20px; height:20px; border-radius:50%; border:1px solid var(--border); background:var(--surface-2);
  color:var(--text-faint); font-size:14px; line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.chart-remove-btn:hover{ color:var(--negative); border-color:var(--negative); }
.chart-svg{ width:100%; height:150px; display:block; background:var(--surface-2); border-radius:6px; }
.chart-card-footer{
  display:flex; flex-wrap:wrap; gap:10px; margin-top:8px; font-size:10.5px; color:var(--text-muted); font-family:'IBM Plex Mono', monospace;
}
.milestone-row{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.milestone-badge{ font-size:10px; font-weight:600; padding:2px 8px; border-radius:10px; }
.milestone-badge.pos{ background:var(--positive-soft); color:var(--positive); }
.milestone-badge.neg{ background:var(--negative-soft); color:var(--negative); }

/* ---- Report selection ---- */
.select-cell{ width:32px; }
.row-select{ cursor:pointer; }
.btn-report{
  background:linear-gradient(155deg, var(--accent-strong), var(--accent) 70%); color:#0A0D12; border:none; border-radius:20px;
  padding:7px 14px; font-size:12px; font-weight:700; cursor:pointer; font-family:inherit; white-space:nowrap;
}
.btn-report:disabled{ opacity:0.6; cursor:default; }

.wrap{ max-width:1180px; margin:0 auto; padding:28px 24px 64px; }

/* ---- Auth gate ---- */
.gate-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.gate-card{ width:100%; max-width:340px; background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:28px 26px; text-align:center; }
.gate-brand{ font-size:15px; font-weight:700; color:var(--accent); margin-bottom:12px; }
.gate-card p{ font-size:13px; color:var(--text-muted); margin-bottom:16px; }
.gate-card .btn{ display:inline-flex; align-items:center; justify-content:center; background:linear-gradient(155deg, var(--accent-strong), var(--accent) 70%); color:#0A0D12; border:none; border-radius:7px; padding:10px 16px; font-size:13.5px; font-weight:600; text-decoration:none; }

/* ---- Top bar ---- */
.topbar{ display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding-bottom:20px; border-bottom:1px solid var(--border); margin-bottom:20px; }
.brand{ display:flex; align-items:center; gap:11px; }
.brand-mark{ width:30px;height:30px; border-radius:7px; background:linear-gradient(155deg, var(--accent-strong), var(--accent) 65%, #8a5c14); display:flex; align-items:center; justify-content:center; flex:none; box-shadow:0 0 0 1px rgba(0,0,0,0.15) inset; }
.brand-mark svg{ width:16px; height:16px; }
.brand-name{ font-size:16.5px; font-weight:700; letter-spacing:-0.01em; }
.brand-sub{ font-size:11.5px; color:var(--text-faint); margin-top:1px; letter-spacing:0.01em; }
.top-right{ display:flex; align-items:center; gap:14px; }
.status{ display:flex; align-items:center; gap:7px; font-size:12px; color:var(--text-muted); }
.status-dot{ width:6px; height:6px; border-radius:50%; background:var(--text-faint); box-shadow:0 0 0 3px var(--surface-3); }

.preview-banner{ display:flex; align-items:center; gap:9px; background:var(--accent-soft-2); border:1px solid var(--accent-soft); color:var(--text-muted); font-size:12.5px; border-radius:8px; padding:9px 13px; margin-bottom:22px; }
.preview-banner svg{ flex:none; width:14px; height:14px; color:var(--accent); }

/* ---- Stat tiles ---- */
.tiles{ display:grid; grid-template-columns:repeat(4,1fr); gap:1px; background:var(--border); border:1px solid var(--border); border-radius:10px; overflow:hidden; margin-bottom:26px; }
.tile{ background:var(--surface); padding:14px 16px; }
.tile-label{ font-size:10.5px; text-transform:uppercase; letter-spacing:0.07em; color:var(--text-faint); font-weight:600; margin-bottom:8px; }
.tile-value{ font-size:21px; font-weight:600; letter-spacing:-0.01em; }
.tile-value.accent{ color:var(--accent); }
.tile-value.pos{ color:var(--positive); }
.tile-sub{ font-size:11.5px; color:var(--text-muted); margin-top:3px; }

/* ---- Controls ---- */
.controls{ display:flex; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.search{ position:relative; flex:1; min-width:180px; }
.search svg{ position:absolute; left:10px; top:50%; transform:translateY(-50%); width:13px; height:13px; color:var(--text-faint); }
.search input{ width:100%; background:var(--surface); border:1px solid var(--border); border-radius:7px; padding:8px 10px 8px 30px; color:var(--text); font-size:13px; font-family:inherit; }
.search input::placeholder{ color:var(--text-faint); }
.search input:focus{ outline:2px solid var(--accent); outline-offset:-1px; }

.chip-group{ display:flex; gap:6px; }
.chip{ background:var(--surface); border:1px solid var(--border); color:var(--text-muted); font-size:12px; font-weight:500; padding:7px 12px; border-radius:20px; cursor:pointer; font-family:inherit; white-space:nowrap; }
.chip:hover{ border-color:var(--text-faint); color:var(--text); }
.chip.active{ background:var(--accent-soft); border-color:var(--accent); color:var(--accent); }
.chip:focus-visible{ outline:2px solid var(--accent); outline-offset:1px; }
.chip-candidate.active{ background:var(--candidate-soft); border-color:var(--candidate); color:var(--candidate); }

/* ---- Table ---- */
.table-scroll{ overflow-x:auto; border:1px solid var(--border); border-radius:10px; background:var(--surface); }
table{ width:100%; border-collapse:collapse; min-width:980px; }
thead th{ position:sticky; top:0; background:var(--surface-2); z-index:1; text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-faint); font-weight:600; padding:11px 14px; border-bottom:1px solid var(--border); cursor:pointer; user-select:none; white-space:nowrap; }
thead th:hover{ color:var(--text-muted); }
thead th.num, td.num{ text-align:right; }
thead th .sort-arrow{ margin-left:4px; opacity:0.5; font-size:9px; }
thead th.sorted{ color:var(--accent); }
thead th.sorted .sort-arrow{ opacity:1; }

tbody tr.row{ border-bottom:1px solid var(--border-soft); cursor:pointer; border-left:2px solid transparent; }
tbody tr.row:last-child{ border-bottom:none; }
tbody tr.row:hover{ background:var(--surface-2); }
tbody tr.row.expanded{ background:var(--surface-2); }
tbody tr.row.strong-candidate{ border-left-color:var(--candidate); background:var(--candidate-soft); }
tbody tr.row.early-watch{ border-left-color:var(--accent); }
td{ padding:11px 14px; font-size:13px; vertical-align:middle; }

.rank{ color:var(--text-faint); font-size:12px; width:28px; display:flex; align-items:center; gap:4px; }
.research-icon{ width:13px; height:13px; flex:none; }
.research-icon.candidate{ color:var(--candidate); }
.research-icon.watch{ color:var(--accent); }
.coin-cell{ display:flex; align-items:center; gap:10px; min-width:170px; }
.coin-badge{ width:26px; height:26px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:700; color:var(--bg); background:var(--accent-strong); }
.coin-name{ font-weight:600; font-size:13px; }
.coin-sym{ color:var(--text-faint); font-size:11.5px; margin-left:5px; font-weight:500; }

.coin-track{ font-size:10.5px; margin-top:2px; font-weight:600; display:flex; align-items:center; gap:4px; }
.coin-track .dot{ width:5px; height:5px; border-radius:50%; flex:none; }
.coin-track.streak{ color:var(--positive); }
.coin-track.streak .dot{ background:var(--positive); }
.coin-track.newcomer{ color:var(--accent); }
.coin-track.newcomer .dot{ background:var(--accent); }
.coin-track.flyer{ color:var(--text-faint); font-weight:500; }
.coin-track.flyer .dot{ background:var(--text-faint); }

.pct{ font-weight:500; }
.pct.pos{ color:var(--positive); }
.pct.neg{ color:var(--negative); }

.score-cell{ display:flex; align-items:center; gap:9px; justify-content:flex-end; }
.score-num{ font-weight:700; font-size:14px; width:26px; text-align:right; }
.score-bar{ width:52px; height:5px; border-radius:3px; background:var(--surface-3); overflow:hidden; flex:none; }
.score-bar-fill{ height:100%; background:linear-gradient(90deg, var(--accent-strong), var(--accent)); border-radius:3px; }

.driver-cell{ display:flex; align-items:center; gap:6px; }
.driver-tag{ display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:600; padding:3px 8px 3px 6px; border-radius:5px; white-space:nowrap; }
.driver-tag .dot{ width:6px; height:6px; border-radius:50%; flex:none; }
.driver-tag.momentum{ background:var(--accent-soft); color:var(--accent); }
.driver-tag.momentum .dot{ background:var(--accent); }
.driver-tag.volume{ background:rgba(125,167,217,0.14); color:#7DA7D9; }
.driver-tag.volume .dot{ background:#7DA7D9; }
.driver-tag.volatility{ background:rgba(184,146,217,0.14); color:#B892D9; }
.driver-tag.volatility .dot{ background:#B892D9; }
.risk-icon{ width:14px; height:14px; color:var(--negative); flex:none; }

/* ---- Expanded detail ---- */
tr.detail-row td{ padding:0; }
.detail-inner{ display:none; padding:16px 18px 18px 52px; background:var(--surface-2); border-bottom:1px solid var(--border-soft); }
tr.detail-row.open .detail-inner{ display:block; }
.detail-grid{ display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:22px; max-width:560px; }
.detail-item-label{ font-size:10px; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-faint); font-weight:600; margin-bottom:7px; }
.detail-bar-track{ height:6px; border-radius:3px; background:var(--surface-3); overflow:hidden; margin-bottom:5px; }
.detail-bar-fill{ height:100%; border-radius:3px; }
.detail-bar-fill.momentum{ background:var(--accent); }
.detail-bar-fill.volume{ background:#7DA7D9; }
.detail-bar-fill.volatility{ background:#B892D9; }
.detail-item-val{ font-size:12.5px; color:var(--text-muted); }
.detail-item-val b{ color:var(--text); }

.analysis-box{ max-width:640px; margin-bottom:16px; padding:12px 14px; border-radius:8px; background:var(--surface); border:1px solid var(--border); }
.analysis-headline{ font-size:13px; font-weight:600; margin-bottom:6px; display:flex; align-items:center; gap:7px; }
.analysis-headline .dot{ width:7px; height:7px; border-radius:50%; flex:none; }
.watchlist{ list-style:none; margin:9px 0 0; padding:0; display:flex; flex-direction:column; gap:5px; }
.watchlist li{ font-size:12px; color:var(--text-muted); display:flex; gap:7px; line-height:1.5; }
.watchlist li svg{ flex:none; width:12px; height:12px; margin-top:2.5px; color:var(--accent); }
.watchlist li b{ color:var(--text); font-weight:600; }
.no-flags{ font-size:12px; color:var(--text-faint); margin-top:8px; font-style:italic; }
.analysis-track{ font-size:12px; color:var(--text-muted); margin-bottom:9px; padding-bottom:9px; border-bottom:1px solid var(--border-soft); }
.analysis-track b{ color:var(--text); font-weight:600; }

.research-verdict{ display:flex; align-items:flex-start; gap:9px; font-size:12.5px; line-height:1.5; padding:9px 10px; border-radius:7px; margin-bottom:10px; }
.research-verdict svg{ flex:none; width:15px; height:15px; margin-top:1px; }
.research-verdict b{ font-weight:700; }
.research-verdict.candidate{ background:var(--candidate-soft); color:var(--text); }
.research-verdict.candidate svg{ color:var(--candidate); }
.research-verdict.watch{ background:var(--accent-soft-2); color:var(--text); }
.research-verdict.watch svg{ color:var(--accent); }

.analysis-btc{ font-size:12px; color:var(--text-muted); margin-bottom:9px; }
.analysis-btc .pct{ font-weight:700; }

.empty{ padding:40px; text-align:center; color:var(--text-faint); font-size:13px; }
footer.note{ margin-top:16px; font-size:11.5px; color:var(--text-faint); text-align:center; }

@media (max-width:640px){
  .tiles{ grid-template-columns:repeat(2,1fr); }
  .wrap{ padding:20px 14px 48px; }
}
@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; }
}
