/* SharpDesk — dark trading dashboard for sports whale flow.
   Same validated dark-mode tokens as FlowDesk (reference palette);
   green/red = buy/sell flow convention, blue/warm = diverging pair. */
:root {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #222220;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255, 255, 255, 0.10);
  --pos: #3987e5;   /* diverging cool pole: sharp money */
  --neg: #e66767;   /* diverging warm pole */
  --bull: #0ca30c;
  --bear: #d03b3b;
  --gold: #c98500;
  --accent: #3987e5;
  --violet: #9085e9;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.shell { display: flex; min-height: 100vh; }

/* ---- sidebar ---- */
.sidebar {
  width: 208px; flex: 0 0 208px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 10px;
  position: sticky; top: 0; height: 100vh;
}
.logo { font-size: 17px; font-weight: 700; letter-spacing: .02em; padding: 4px 10px 16px; }
.bolt { color: var(--gold); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; color: var(--ink-2);
  font: inherit; font-size: 13.5px; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; text-align: left;
}
.nav .ico { width: 18px; text-align: center; color: var(--muted); }
.nav:hover { background: rgba(255,255,255,.06); }
.nav.active { background: rgba(57,135,229,.14); color: var(--ink); }
.nav.active .ico { color: var(--accent); }
.sidefoot { margin-top: auto; padding: 10px; font-size: 12px; color: var(--muted); }
.sidefoot a { color: var(--accent); text-decoration: none; }

/* ---- content ---- */
.content { flex: 1; padding: 22px 26px 60px; min-width: 0; }
.view { display: none; }
.view.active { display: block; }
.pagetitle { font-size: 20px; font-weight: 650; margin: 0 0 16px; }
.dim { color: var(--muted); font-weight: 400; font-size: 13px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 21px; font-weight: 700; margin-top: 2px; }
.tile .v.bull { color: var(--bull); }
.tile .v.gold { color: var(--gold); }
.tile .v.pos { color: var(--pos); }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
@media (max-width: 1100px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 12px;
  overflow-x: auto;
}
.card h2 { font-size: 14px; font-weight: 650; margin: 0 0 10px; }

/* ---- tables ---- */
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 6px 8px; border-bottom: 1px solid var(--baseline);
  white-space: nowrap;
}
td { padding: 7px 8px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,.03); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ttl { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chip {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
}
.chip.buy  { background: rgba(12,163,12,.16); color: #52c452; }
.chip.sell { background: rgba(208,59,59,.16); color: #e88; }
.chip.lg   { background: rgba(144,133,233,.16); color: var(--violet); }
.chip.whale{ background: rgba(201,133,0,.18); color: #e8ae3c; }
.chip.steam{ background: rgba(57,135,229,.18); color: #6aa7ee; }
.chip.prop { background: rgba(255,255,255,.08); color: var(--ink-2); }
.chip.win  { background: rgba(12,163,12,.18); color: #52c452; }
.chip.loss { background: rgba(208,59,59,.18); color: #e88; }
.chip.push { background: rgba(255,255,255,.10); color: var(--ink-2); }
.chip.pending { background: rgba(255,255,255,.05); color: var(--muted); }

.cash { font-weight: 650; font-variant-numeric: tabular-nums; }
.cash.whale { color: #e8ae3c; }

/* score pill */
.score {
  display: inline-block; min-width: 34px; text-align: center;
  border-radius: 6px; padding: 1px 6px; font-weight: 700; font-size: 12px;
  background: var(--surface-2); color: var(--ink-2);
}
.score.hi { background: rgba(12,163,12,.2); color: #52c452; }
.score.md { background: rgba(201,133,0,.18); color: #e8ae3c; }

/* tickets vs money split bars (paired, labeled — identity not color-alone) */
.split { min-width: 170px; }
.split .row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.split .lab { width: 44px; }
.split .bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.split .bar i { display: block; height: 100%; border-radius: 4px; }
.split .money i { background: var(--pos); }
.split .tix i { background: var(--baseline); }
.split .pct { width: 34px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* filters */
.filters { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.fbtn {
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-2);
  font: inherit; font-size: 12.5px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
}
.fbtn:hover { background: var(--surface-2); }
.fbtn.active { background: rgba(57,135,229,.16); border-color: rgba(57,135,229,.5); color: var(--ink); }

/* ---- mobile ---- */
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: static; width: 100%; flex: none; height: auto;
    padding: 10px 12px 6px;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .logo { padding: 0 2px 8px; font-size: 15.5px; }
  .sidebar nav {
    flex-direction: row; overflow-x: auto; gap: 4px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .sidebar nav::-webkit-scrollbar { display: none; }
  .nav { white-space: nowrap; padding: 7px 10px; font-size: 12.5px; flex: 0 0 auto; }
  .sidefoot {
    margin-top: 6px; padding: 4px 2px;
    display: flex; justify-content: space-between; gap: 10px;
    font-size: 11px;
  }
  .content { padding: 14px 12px 48px; }
  .pagetitle { font-size: 17px; margin-bottom: 12px; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tile { padding: 10px 12px; }
  .tile .v { font-size: 18px; }
  .card { padding: 10px 12px; }
  table { font-size: 12px; }
  td, th { padding: 6px 6px; white-space: nowrap; }
  .ttl { max-width: 190px; }
  .split { min-width: 140px; }
  .bets { grid-template-columns: 1fr; }
  .filters { gap: 6px; }
}

/* best-bet cards */
.bets { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.bet {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.bet .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bet .pick { font-size: 15px; font-weight: 700; }
.bet .game { color: var(--muted); font-size: 12.5px; margin: 2px 0 8px; }
.bet .why { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.empty { color: var(--muted); padding: 18px 4px; }

/* comeback scanner chips */
.chip { display:inline-block; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:700; border:1px solid var(--line,#2a3242); color:var(--muted,#8a93a5); }
.chip.win { color:#31d07f; border-color:#31d07f55; background:#31d07f14; }
.chip.loss { color:#e5534b; border-color:#e5534b55; background:#e5534b14; }
.tile .v.bear { color: var(--neg,#e5534b); }

/* ==== mobile nav overhaul ==== */
.hamb { position: fixed; top: 10px; left: 10px; z-index: 60; width: 40px; height: 40px;
  border-radius: 8px; border: 1px solid rgba(255,255,255,.15); background: rgba(20,26,36,.92);
  color: #e8ecf4; font-size: 18px; cursor: pointer; display: flex; align-items: center;
  justify-content: center; }
.toolswitch { display: flex; margin: 12px 0 14px; border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px; overflow: hidden; }
.toolswitch a { flex: 1; text-align: center; padding: 7px 0; font-size: 12px; font-weight: 700;
  text-decoration: none; color: #8a93a5; letter-spacing: .04em; }
.toolswitch a.on { background: #e8ecf4; color: #10151d; }
.backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; }
@media (min-width: 901px) {
  body.navhide .sidebar { display: none; }
}
.sidebar .logo { margin-left: 44px; }
@media (max-width: 900px) {
  .shell { flex-direction: row; }
  .sidebar { display: block !important; position: fixed; top: 0; left: 0; bottom: 0;
    width: 250px; z-index: 50; transform: translateX(-105%); transition: transform .18s ease;
    overflow-y: auto; height: 100vh; }
  body.navopen .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.65); }
  .sidebar nav { flex-direction: column !important; flex-wrap: nowrap !important; }
  body.navopen .backdrop { display: block; }
  .content { padding: 58px 12px 60px !important; }
  .pagetitle { font-size: 19px; }
  .tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 12px; }
}
.toolswitch { height: 34px; }
.toolswitch a { display: flex; align-items: center; justify-content: center; height: 100%; }

.toolswitch.topfix { position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 55; width: 220px; margin: 0; background: rgba(16,21,29,.94); }
@media (min-width: 901px) { .content { padding-top: 58px !important; } }
@media (max-width: 480px) { .toolswitch.topfix { left: auto; right: 10px; transform: none; width: 180px; } }

.whalerow td { background: rgba(201,133,0,.08); }
.pos { color: #35c46a; } .neg { color: #e66767; }
.subtab { background:#141b26; border:1px solid #26344a; color:#c3cbd8; border-radius:6px; padding:5px 12px; font:inherit; font-size:12px; cursor:pointer; }
.subtab.active { background:#e8ecf4; color:#10151d; font-weight:700; }
/* ==================== MOTION LAYER ====================
   Every animation here encodes state: what's live, what's new,
   what changed. Nothing moves purely for decoration.
   Fully disabled under prefers-reduced-motion.            */

:root {
  --ease-out: cubic-bezier(.22,.61,.36,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --glow-bull: 0 0 0 1px rgba(53,196,106,.35), 0 0 18px -4px rgba(53,196,106,.5);
  --glow-bear: 0 0 0 1px rgba(230,103,103,.35), 0 0 18px -4px rgba(230,103,103,.5);
}

/* ---- view transitions: content settles in, no jarring swap ---- */
.view.active { animation: viewIn .26s var(--ease-out) both; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---- tiles: lift on hover, stagger on entry ---- */
.tile {
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out),
              border-color .18s var(--ease-out);
  animation: tileIn .32s var(--ease-out) both;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px -8px rgba(0,0,0,.6);
  border-color: rgba(255,255,255,.18);
}
.tiles .tile:nth-child(1){animation-delay:.02s}
.tiles .tile:nth-child(2){animation-delay:.06s}
.tiles .tile:nth-child(3){animation-delay:.10s}
.tiles .tile:nth-child(4){animation-delay:.14s}
.tiles .tile:nth-child(5){animation-delay:.18s}
@keyframes tileIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

/* ---- live pulse: the chip breathes only while data is fresh ---- */
/* keep position:fixed from the base rule - it also anchors the ::before dot */
.freshchip { padding-left: 20px !important; }
.freshchip::before {
  content: ""; position: absolute; left: 9px; top: 50%; width: 6px; height: 6px;
  margin-top: -3px; border-radius: 50%; background: currentColor;
}
.freshchip.ok::before { animation: livePulse 2s ease-in-out infinite; }
@keyframes livePulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(53,196,106,.55); opacity: 1; }
  70%     { box-shadow: 0 0 0 7px rgba(53,196,106,0); opacity: .75; }
}

/* ---- new print flash: green/red wash the instant a row arrives ---- */
@keyframes flashBull {
  from { background: rgba(53,196,106,.20); }
  to   { background: transparent; }
}
@keyframes flashBear {
  from { background: rgba(230,103,103,.20); }
  to   { background: transparent; }
}
tr.newBull td { animation: flashBull 1.6s var(--ease-out) both; }
tr.newBear td { animation: flashBear 1.6s var(--ease-out) both; }

/* ---- whale rows get a persistent left marker, not just a tint ---- */
.whalerow td:first-child { box-shadow: inset 3px 0 0 var(--gold,#c98500); }

/* ---- nav: active item slides its indicator ---- */
.sidebar .nav { position: relative; transition: color .15s var(--ease-out),
                background .15s var(--ease-out); }
.sidebar .nav::after {
  content: ""; position: absolute; left: 0; top: 50%; height: 0;
  width: 2px; background: var(--accent,#9dff3d); border-radius: 2px;
  transform: translateY(-50%); transition: height .22s var(--ease-spring);
}
.sidebar .nav.active::after { height: 62%; }
.sidebar .nav:hover { background: rgba(255,255,255,.04); }

/* ---- tables: rows fade in, hover raises ---- */
tbody tr { transition: background .12s var(--ease-out); }
tbody tr:hover { background: rgba(255,255,255,.045); }
.tablewrap table { animation: fadeIn .3s var(--ease-out) both; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

/* ---- clickable tickers: underline grows from left ---- */
.tkbtn { position: relative; border-bottom: none !important; }
.tkbtn::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 1px;
  background: currentColor; transition: width .2s var(--ease-out);
}
.tkbtn:hover::after { width: 100%; }

/* ---- drawer: slide + backdrop fade ---- */
.tkdrawer { animation: drawerIn .24s var(--ease-out) both; }
@keyframes drawerIn { from{transform:translateX(24px);opacity:0} to{transform:none;opacity:1} }
.tkdback { animation: fadeIn .2s var(--ease-out) both; }
.tkdsect { animation: tileIn .28s var(--ease-out) both; }
.tkdsect:nth-child(2){animation-delay:.04s}
.tkdsect:nth-child(3){animation-delay:.08s}
.tkdsect:nth-child(4){animation-delay:.12s}

/* ---- buttons / pills: press feedback ---- */
.pill, .subtab, .tkdbtn, .densbtn {
  transition: transform .12s var(--ease-out), background .15s var(--ease-out),
              border-color .15s var(--ease-out), color .15s var(--ease-out);
}
.pill:active, .subtab:active, .tkdbtn:active { transform: scale(.96); }
.pill.on, .subtab.active { box-shadow: 0 0 12px -4px var(--accent,#9dff3d); }

/* ---- directional glow on badges ---- */
.badge.bull { box-shadow: var(--glow-bull); }
.badge.bear { box-shadow: var(--glow-bear); }

/* ---- skeleton shimmer while a feed is loading ---- */
.skel {
  background: linear-gradient(90deg, rgba(255,255,255,.04) 25%,
    rgba(255,255,255,.09) 37%, rgba(255,255,255,.04) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease infinite;
  border-radius: 6px; height: 14px;
}
@keyframes shimmer { from{background-position:100% 0} to{background-position:0 0} }

/* ---- sortable headers ---- */
thead th[onclick] { transition: color .15s var(--ease-out); }
thead th[onclick]:hover { color: var(--accent,#9dff3d); }

/* ---- respect the user's motion setting ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}


/* ==================== VISUAL SYSTEM v2 ====================
   A cooler, deeper palette with real depth: glass on chrome,
   solid on data. Semantic green/red is untouched so numbers
   never become ambiguous. Density is identical to before.  */

:root {
  /* --- surfaces: cool near-black, subtle blue cast --- */
  --page:      #080b11;
  --page-2:    #0b0f16;
  --surface:   rgba(19, 25, 35, .72);
  --surface-2: rgba(26, 34, 47, .78);
  --surface-solid: #131923;
  --border:    rgba(255,255,255,.08);
  --border-2:  rgba(255,255,255,.14);

  /* --- type --- */
  --ink:   #eef2f8;
  --ink-2: #aab6c8;
  --muted: #6d7c92;

  /* --- accents --- */
  --accent:    #4d9fff;
  --accent-2:  #7c5cff;
  --cyan:      #22d3ee;
  --gold:      #f0b429;

  /* --- semantic (kept vivid + distinguishable) --- */
  --bull: #2ee08a;
  --bear: #ff5f6d;
  --pos:  #4d9fff;
  --neg:  #ff5f6d;
  --violet: #9085e9;

  /* --- gradients --- */
  --grad-accent: linear-gradient(135deg, #4d9fff 0%, #7c5cff 100%);
  --grad-bull:   linear-gradient(135deg, #2ee08a 0%, #12b981 100%);
  --grad-bear:   linear-gradient(135deg, #ff5f6d 0%, #e0344a 100%);
  --grad-sheen:  linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0));

  --radius: 12px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 8px 28px -10px rgba(0,0,0,.75);
  --shadow-glow: 0 0 40px -12px rgba(77,159,255,.45);
  --line: rgba(255,255,255,.12);   /* legacy alias used by older rules */
  --card: #131923;
  --grid: rgba(255,255,255,.07);
  --baseline: rgba(255,255,255,.14);
  --surface-2: rgba(26,34,47,.78);
}

/* ---- page: layered radial wash instead of flat black ---- */
body {
  background:
    radial-gradient(1100px 620px at 78% -8%, rgba(77,159,255,.10), transparent 62%),
    radial-gradient(900px 560px at 8% 105%, rgba(124,92,255,.09), transparent 60%),
    var(--page);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ---- sidebar: frosted glass rail ---- */
.sidebar {
  background: linear-gradient(180deg, rgba(19,25,35,.92), rgba(11,15,22,.92));
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-right: 1px solid var(--border);
}
.logo {
  background: var(--grad-accent);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -.02em; font-weight: 750;
}
.logo .bolt { -webkit-text-fill-color: initial; }

/* ---- nav: pill highlight + gradient indicator ---- */
.sidebar .nav {
  border-radius: 9px; margin: 1px 8px; padding-left: 12px;
  color: var(--ink-2); font-weight: 500;
}
.sidebar .nav.active {
  background: linear-gradient(90deg, rgba(77,159,255,.16), rgba(124,92,255,.05));
  color: #fff; font-weight: 650;
}
.sidebar .nav::after { background: var(--grad-accent) !important; left: 2px; }

/* ---- tiles: glass card, gradient top sheen, numeric emphasis ---- */
.tile {
  position: relative; overflow: hidden;
  background: var(--surface);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.tile::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
}
.tile::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--grad-sheen);
}
.tile:hover { border-color: var(--border-2); box-shadow: var(--shadow-2); }
.tile .v {
  font-size: 22px; font-weight: 680; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.tile .v.bull {
  background: var(--grad-bull); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tile .v.bear, .tile .v.neg {
  background: var(--grad-bear); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tile .l {
  font-size: 9.5px; letter-spacing: .1em; color: var(--muted);
  text-transform: uppercase; font-weight: 600;
}

/* ---- cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-1);
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.card:hover { border-color: var(--border-2); box-shadow: var(--shadow-2); }

/* ---- headings: gradient rule under the title ---- */
.pagetitle {
  font-size: 21px; font-weight: 700; letter-spacing: -.02em;
  position: relative; padding-bottom: 10px;
}
.pagetitle::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 2px;
  background: var(--grad-accent); border-radius: 2px;
}
.lede { color: var(--ink-2); }

/* ---- tables: solid (never glass) so numbers stay crisp ---- */
.tablewrap {
  background: rgba(11,15,22,.55); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: auto;
}
table { border-collapse: separate; border-spacing: 0; }
thead th {
  position: sticky; top: 0; z-index: 2;
  background: linear-gradient(180deg, #141b26, #111823);
  border-bottom: 1px solid var(--border-2) !important;
  font-size: 9.5px; letter-spacing: .09em; color: var(--muted);
  text-transform: uppercase; font-weight: 650;
}
td { font-variant-numeric: tabular-nums; border-bottom: 1px solid rgba(255,255,255,.045); }
tbody tr:hover { background: rgba(77,159,255,.055) !important; }
tbody tr:last-child td { border-bottom: none; }

/* ---- badges: gradient fills ---- */
.badge {
  border-radius: 999px; font-size: 9.5px; font-weight: 700;
  letter-spacing: .05em; padding: 3px 9px; border: none;
}
.badge.bull { background: rgba(46,224,138,.15); color: var(--bull);
  box-shadow: inset 0 0 0 1px rgba(46,224,138,.32); }
.badge.bear { background: rgba(255,95,109,.15); color: var(--bear);
  box-shadow: inset 0 0 0 1px rgba(255,95,109,.32); }
.badge.neut { background: rgba(255,255,255,.06); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }

/* ---- pills / subtabs: glass, gradient when active ---- */
.pill, .subtab {
  background: rgba(255,255,255,.045); border: 1px solid var(--border);
  border-radius: 999px; color: var(--ink-2); font-weight: 600;
}
.pill:hover, .subtab:hover { background: rgba(255,255,255,.09); color: var(--ink); }
.pill.on, .subtab.active {
  background: var(--grad-accent); border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px -4px rgba(77,159,255,.6);
}

/* ---- inputs ---- */
input, select {
  background: rgba(255,255,255,.045) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important; color: var(--ink) !important;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
input:focus, select:focus {
  outline: none; border-color: rgba(77,159,255,.55) !important;
  box-shadow: 0 0 0 3px rgba(77,159,255,.14);
}

/* ---- top chrome: glass ---- */
.toolswitch.topfix, .hamb {
  background: rgba(13,18,26,.72) !important;
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-1);
}
.toolswitch a.on {
  background: var(--grad-accent); color: #fff;
  box-shadow: 0 3px 12px -3px rgba(77,159,255,.65);
}
.hamb:hover { border-color: var(--border-2) !important; }

.freshchip {
  background: rgba(13,18,26,.78) !important;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-1);
}

/* ---- drawer ---- */
.tkdrawer {
  background: linear-gradient(180deg, rgba(16,22,31,.97), rgba(11,15,22,.97));
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-left: 1px solid var(--border-2);
}
.tkdhead { background: var(--grad-sheen); }
.tkdhead b {
  background: var(--grad-accent); -webkit-background-clip: text;
  background-clip: text; -webkit-text-fill-color: transparent;
}

/* ---- tags ---- */
.tag { border-radius: 5px; font-size: 9px; font-weight: 700; letter-spacing: .05em; }
.tag.whale { background: rgba(240,180,41,.16); color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(240,180,41,.35); }
.tag.aggressive { background: rgba(255,95,109,.14); color: var(--bear);
  box-shadow: inset 0 0 0 1px rgba(255,95,109,.3); }

/* ---- scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.14); border-radius: 6px;
  border: 2px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.26); background-clip: content-box; }

/* ---- selection ---- */
::selection { background: rgba(77,159,255,.32); color: #fff; }

/* ---- colour helpers kept in sync ---- */
.bull { color: var(--bull) !important; }
.neg, .bear { color: var(--bear) !important; }
.dim { color: var(--muted); }
.whalerow td { background: rgba(240,180,41,.055); }
.whalerow td:first-child { box-shadow: inset 3px 0 0 var(--gold); }

/* glass is expensive on low-end phones — drop blur, keep colour */
@media (max-width: 640px) {
  .sidebar, .tile, .card, .tkdrawer, .toolswitch.topfix, .hamb, .freshchip {
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .tile, .card { background: var(--surface-solid); }
}


/* ==================== OVERVIEW MODULES ==================== */
.ovhero { display: grid; grid-template-columns: 340px 1fr; gap: 14px; margin-bottom: 16px; }
.ovsplit { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
@media (max-width: 900px) {
  .ovhero, .ovsplit { grid-template-columns: 1fr; }
}

/* --- fear & greed --- */
.fgcard { display: flex; flex-direction: column; }
#fgGauge { position: relative; text-align: center; }
.fgsvg { width: 100%; max-width: 260px; height: auto; display: block; margin: 0 auto; }
.fgneedle { transform-origin: 50% 88%; animation: needleIn .9s var(--ease-spring) both; }
@keyframes needleIn { from { transform: rotate(-72deg); } to { transform: none; } }
.fgread { margin-top: -14px; }
.fgscore { font-size: 40px; font-weight: 750; letter-spacing: -.03em;
  line-height: 1; font-variant-numeric: tabular-nums; }
.fglabel { font-size: 12px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; margin-top: 3px; }
.fgscore.fear2, .fglabel.fear2 { color: #ff4d5e; }
.fgscore.fear,  .fglabel.fear  { color: #ff9f45; }
.fgscore.neutral, .fglabel.neutral { color: #e8c547; }
.fgscore.greed, .fglabel.greed { color: #7ed957; }
.fgscore.greed2, .fglabel.greed2 { color: #2ee08a; }
.fgparts { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.fgpart { display: grid; grid-template-columns: 96px 1fr 26px; align-items: center;
  gap: 8px; font-size: 11px; }
.fgpn { color: var(--ink-2); }
.fgbar { height: 5px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.fgbar i { display: block; height: 100%; background: var(--grad-accent);
  border-radius: 3px; animation: growX .7s var(--ease-out) both; }
.fgpv { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.fgpd { grid-column: 1 / -1; font-size: 10px; margin-top: -4px; }
@keyframes growX { from { width: 0 !important; } }

/* --- news --- */
.newslist { display: flex; flex-direction: column; gap: 10px; max-height: 292px; overflow: auto; }
.newsitem { padding-left: 10px; border-left: 2px solid rgba(255,255,255,.10);
  transition: border-color .15s var(--ease-out); }
.newsitem:hover { border-left-color: var(--accent); }
.newsitem.mover { border-left-color: rgba(240,180,41,.5); }
.newst { font-size: 12.5px; line-height: 1.4; }
.newst a { color: var(--ink); text-decoration: none; }
.newst a:hover { color: var(--accent); }
.newsm { font-size: 10.5px; margin-top: 2px; }

/* --- directional bars --- */
.barsplit { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 760px) { .barsplit { grid-template-columns: 1fr; gap: 16px; } }
.barhead { font-size: 9.5px; letter-spacing: .1em; font-weight: 700;
  text-transform: uppercase; margin-bottom: 8px; }
.barhead.bull { color: var(--bull); }
.barhead.bear { color: var(--bear); }
.barrow { display: grid; grid-template-columns: 52px 1fr 68px; align-items: center;
  gap: 9px; padding: 3px 0; cursor: pointer; }
.barrow:hover .bt { color: #fff; }
.bt { font-weight: 700; font-size: 11.5px; color: var(--ink-2); }
.btrack { height: 15px; background: rgba(255,255,255,.05); border-radius: 4px;
  overflow: hidden; }
.btrack i { display: block; height: 100%; border-radius: 4px;
  animation: growX .8s var(--ease-out) both; }
.btrack i.bull { background: var(--grad-bull); }
.btrack i.neg  { background: var(--grad-bear); }
.bv { text-align: right; font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums; }

/* --- top trades / movers rows --- */
.ttrow { display: grid; grid-template-columns: 58px 118px 92px 1fr 26px auto;
  align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.05); font-size: 11.5px; }
.ttrow:last-child { border-bottom: none; }
.ttp { text-align: right; } .tts { text-align: right; }
.mvrow { display: grid; grid-template-columns: 58px 58px 62px auto 1fr;
  align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.05); font-size: 11.5px; }
.mvrow:last-child { border-bottom: none; }
.mvc { font-size: 10.5px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
@media (max-width: 640px) {
  .ttrow { grid-template-columns: 52px 1fr 78px; row-gap: 2px; }
  .ttrow > :nth-child(5), .ttrow > :nth-child(6) { display: none; }
  .mvrow { grid-template-columns: 52px 56px 1fr; }
  .mvrow > :nth-child(4) { display: none; }
  .mvc { grid-column: 1 / -1; }
}


/* ==================== VISUAL v3: remaining components ==================== */

/* --- refresh control (top-right, beside the freshness chip) --- */
.refreshbar {
  position: fixed; top: 12px; right: 122px; z-index: 61;
  display: flex; align-items: center; gap: 7px;
}
.rbtn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(13,18,26,.78); border: 1px solid var(--border);
  color: var(--ink-2); border-radius: 20px; padding: 5px 12px;
  font: inherit; font-size: 11px; font-weight: 650; cursor: pointer;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: color .15s var(--ease-out), border-color .15s var(--ease-out),
              transform .12s var(--ease-out), background .15s var(--ease-out);
}
.rbtn:hover { color: #fff; border-color: var(--border-2);
  background: rgba(77,159,255,.16); }
.rbtn:active { transform: scale(.95); }
.rbtn.run { color: var(--bull); border-color: rgba(46,224,138,.3); }
.ricon { font-size: 13px; line-height: 1; display: inline-block; }
.rbtn.spin .ricon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.rmsg { font-size: 10.5px; color: var(--muted); }
.rmsg.good { color: var(--bull); }
.rmsg.bad  { color: var(--bear); }
@media (max-width: 900px) {
  .refreshbar { top: auto; bottom: 10px; right: 108px; }
  .rlabel { display: none; }
  .rbtn { padding: 6px 10px; }
}

/* --- score bars (Flow Feed conviction) --- */
.scorebar { display: inline-flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums; }
.sb { display: inline-block; width: 46px; height: 5px; border-radius: 3px;
  background: rgba(255,255,255,.09); overflow: hidden; }
.sb div { height: 100%; border-radius: 3px; background: var(--grad-accent); }

/* --- mini tables inside cards --- */
table.mini { width: 100%; background: none; border: none; }
table.mini th { background: none; border-bottom: 1px solid var(--border) !important;
  font-size: 9px; letter-spacing: .09em; padding: 4px 6px; }
table.mini td { border-bottom: 1px solid rgba(255,255,255,.04);
  padding: 5px 6px; font-size: 11.5px; }
table.mini tr:last-child td { border-bottom: none; }

/* --- chips --- */
.hitchip, .statuschip {
  display: inline-block; border-radius: 5px; padding: 1px 6px;
  font-size: 9px; font-weight: 700; letter-spacing: .05em;
}
.hitchip { background: rgba(46,224,138,.16); color: var(--bull);
  box-shadow: inset 0 0 0 1px rgba(46,224,138,.32); }
.statuschip { background: rgba(255,255,255,.07); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.statuschip.tracking { background: rgba(240,180,41,.14); color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(240,180,41,.3); }
.statuschip.done { background: rgba(255,95,109,.13); color: var(--bear);
  box-shadow: inset 0 0 0 1px rgba(255,95,109,.28); }

/* --- calendar --- */
.calday { background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; transition: border-color .15s var(--ease-out),
  transform .15s var(--ease-out); }
.calday:hover { border-color: var(--border-2); transform: translateY(-2px); }
.calday.today { border-color: rgba(77,159,255,.5);
  box-shadow: 0 0 0 1px rgba(77,159,255,.25), 0 6px 20px -10px rgba(77,159,255,.5); }
.calday .d { font-weight: 700; font-size: 11.5px; }
.calday .dow { color: var(--muted); font-weight: 500; }

/* --- pill bar wrapper --- */
.pillbar { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

/* --- empty / note states --- */
td.no, .no { color: var(--muted); font-style: normal; padding: 18px 10px; }
.note { color: var(--muted); font-size: 11.5px; line-height: 1.6;
  border-left: 2px solid var(--border); padding-left: 12px; margin-top: 16px; }
.note code { background: rgba(255,255,255,.07); padding: 1px 6px;
  border-radius: 4px; font-size: 11px; color: var(--ink-2); }

/* --- grids --- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1000px) { .grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* --- sidebar footer --- */
.sidefoot { border-top: 1px solid var(--border); padding-top: 10px; }
.scaninfo, .sidefoot { font-size: 10.5px; color: var(--muted); }
.sidefoot a { color: var(--accent); font-weight: 600; }

/* --- canvases (GEX / HIRO charts) sit on solid ground --- */
canvas { border-radius: 8px; }
.chartwrap, .chartbox { background: rgba(11,15,22,.6);
  border: 1px solid var(--border); border-radius: var(--radius); }

/* --- keep the top chrome from colliding on wide screens --- */
@media (min-width: 901px) { .content { padding-top: 62px !important; } }
