* { box-sizing: border-box; margin: 0; padding: 0; }
:root, [data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #f8fafd;
  --bg-3: #eff2f5;
  --line: #eff2f5;
  --line-2: #cfd6e4;
  --ink: #0d1421;
  --ink-2: #58667e;
  --ink-3: #a1a7b3;
  --accent: #00b8cc;
  --accent-2: #00d4ff;
  --accent-soft: #e0f7fb;
  --green: #16c784;
  --green-bg: #e6f9f1;
  --red: #ea3943;
  --red-bg: #fdebeb;
  --amber: #f0b90b;
  --hot: #ff5e1c;
  --bid: #16c784;
  --ask: #ea3943;
  --shadow: 0 4px 14px rgba(88,102,126,0.08);
  --icon-bg: #fff;
  --icon-ring: #eff2f5;
}
[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-2: #131826;
  --bg-3: #1c2333;
  --line: #1c2333;
  --line-2: #2a3245;
  --ink: #e6e9ef;
  --ink-2: #8b94a7;
  --ink-3: #5a6378;
  --accent: #00d4ff;
  --accent-2: #00f0ff;
  --accent-soft: rgba(0,212,255,0.12);
  --green: #1fd693;
  --green-bg: rgba(31,214,147,0.14);
  --red: #ff4f5e;
  --red-bg: rgba(255,79,94,0.14);
  --amber: #f0b90b;
  --hot: #ff7a3a;
  --bid: #1fd693;
  --ask: #ff4f5e;
  --shadow: 0 4px 18px rgba(0,0,0,0.4);
  --icon-bg: #1c2333;
  --icon-ring: #2a3245;
}
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* TOP NAV */
.topnav {
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 24px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.logo:hover .lb-spark { filter: drop-shadow(0 0 4px #a8ff66); }
.logo .logo-mark { width: 30px; height: 30px; display: inline-flex; box-shadow: 0 4px 12px rgba(0, 149, 212, 0.32); border-radius: 7px; }
.logo .logo-mark svg { width: 30px; height: 30px; display: block; }
.logo .logo-mark .lb { transform-origin: center bottom; animation: logo-pulse 2.4s ease-in-out infinite; }
.logo .logo-mark .lb2 { animation-delay: .15s; }
.logo .logo-mark .lb3 { animation-delay: .3s; }
.logo .logo-mark .lb4 { animation-delay: .45s; }
.logo .logo-mark .lb-spark { animation: logo-spark 2.4s ease-in-out infinite; }
@keyframes logo-pulse { 0%, 100% { opacity: .82; } 50% { opacity: 1; } }
@keyframes logo-spark { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
.logo .logo-word { background: linear-gradient(90deg, var(--ink), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-weight: 900; letter-spacing: -.03em; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { font-size: 14px; font-weight: 600; color: var(--ink); padding: 8px 0; position: relative; }
.nav-links a:hover { color: var(--accent); }
.nav-links a.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -19px; height: 3px; background: var(--accent); border-radius: 3px 3px 0 0; }
.nav-spacer { flex: 1; }
.top-search { width: 240px; height: 36px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 12px 0 36px; background: var(--bg-2) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2358667e' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.3-4.3'/></svg>") no-repeat 12px center; font-size: 14px; outline: none; }
.top-search:focus { border-color: var(--accent); }

.conn-pill {
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px;
  background: var(--bg-3); color: var(--ink-3);
  display: inline-flex; align-items: center; gap: 6px;
}
.conn-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.conn-pill.live { background: var(--green-bg); color: var(--green); }
.conn-pill.live::before { background: var(--green); animation: pulse 1.4s infinite; }
.conn-pill.err { background: var(--red-bg); color: var(--red); }
.conn-pill.err::before { background: var(--red); }

/* RIBBON */
.ribbon { border-bottom: 1px solid var(--line); padding: 10px 24px; display: flex; align-items: center; gap: 24px; overflow-x: auto; white-space: nowrap; font-size: 13px; scrollbar-width: none; -ms-overflow-style: none; }
.ribbon::-webkit-scrollbar { display: none; width: 0; height: 0; }
.ribbon .stat { color: var(--ink-2); }
.ribbon .stat b { color: var(--ink); font-weight: 600; }
.ribbon .live-dot { display: inline-block; width: 6px; height: 6px; background: var(--hot); border-radius: 50%; margin-right: 6px; vertical-align: middle; animation: pulse 1.5s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

main { max-width: 1500px; margin: 0 auto; padding: 28px 24px 80px; }
.page-head { margin-bottom: 16px; }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.page-head h1 .badge-live { font-size: 11px; padding: 3px 8px; border-radius: 12px; background: var(--red-bg); color: var(--red); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 5px; }
.page-head h1 .badge-live::before { content: ''; width: 6px; height: 6px; background: var(--red); border-radius: 50%; animation: pulse 1.4s infinite; }
.page-head p { color: var(--ink-2); font-size: 14px; max-width: 800px; }

/* WINDOW SELECTOR */
.window-bar {
  display: flex; align-items: center; gap: 14px;
  margin: 22px 0 18px;
  padding: 14px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.window-bar .label { font-size: 12px; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.window-pills { display: flex; gap: 4px; background: var(--bg); padding: 3px; border: 1px solid var(--line-2); border-radius: 8px; }
.wpill { padding: 6px 14px; background: transparent; border: none; font-size: 13px; font-weight: 700; color: var(--ink-2); border-radius: 6px; min-width: 56px; }
.wpill:hover { color: var(--ink); }
.wpill.on { background: var(--accent); color: white; }
.window-bar .hint { color: var(--ink-3); font-size: 12px; flex: 1; text-align: right; font-style: italic; }

/* HIGHLIGHTS */
.highlights { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.hl { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--bg); transition: box-shadow 0.15s; }
.hl:hover { box-shadow: 0 4px 14px rgba(88,102,126,0.08); }
.hl-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.hl-title { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.hl-tag { font-size: 10px; background: var(--accent-soft); color: var(--accent); padding: 2px 6px; border-radius: 4px; font-weight: 700; letter-spacing: 0.05em; margin-left: 4px; }
.hl-title .ic { font-size: 14px; }
.hl-list { display: flex; flex-direction: column; gap: 10px; min-height: 110px; }
.hl-row { display: flex; align-items: center; gap: 10px; }
.hl-rank { width: 14px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.hl-coin { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: white; flex-shrink: 0; }
.hl-name { flex: 1; font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hl-name .sym { color: var(--ink-3); font-weight: 500; margin-left: 4px; font-size: 12px; }
.hl-val { font-size: 13px; font-weight: 700; font-family: 'JetBrains Mono', monospace; color: var(--ink); }
.hl-val.accent { color: var(--accent); }
.hl-val.green { color: var(--green); }
.hl-val.hot { color: var(--hot); }
.hl-empty { color: var(--ink-3); font-style: italic; font-size: 12px; padding: 10px 0; }

/* TABS */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.tabs::-webkit-scrollbar { display: none; width: 0; height: 0; }
.tab { padding: 10px 14px; background: transparent; border: none; font-size: 14px; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.tab .ct { font-size: 11px; color: var(--ink-3); margin-left: 4px; font-weight: 500; }

/* FILTERS */
.filter-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg); font-size: 13px; font-weight: 600; color: var(--ink-2); transition: all 0.12s; }
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip .ct { color: var(--ink-3); margin-left: 4px; font-weight: 500; }
.chip.on .ct { color: var(--accent); opacity: 0.7; }
.filter-spacer { flex: 1; }
.row-search { width: 220px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; padding: 0 12px 0 32px; background: var(--bg) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%2358667e' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.3-4.3'/></svg>") no-repeat 10px center; font-size: 13px; outline: none; }
.row-search:focus { border-color: var(--accent); }

/* TABLE */
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.flow { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
table.flow thead th {
  background: var(--bg);
  font-size: 12px; font-weight: 600;
  color: var(--ink-2);
  text-align: right;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 56px; z-index: 10;
  white-space: nowrap;
}
table.flow thead th:first-child,
table.flow thead th.left { text-align: left; }
table.flow thead th .sort { color: var(--ink-3); margin-left: 3px; font-size: 10px; }
table.flow thead th.sorted { color: var(--ink); }
table.flow thead th.sortable { cursor: pointer; user-select: none; }
table.flow thead th.sortable:hover { color: var(--ink); }
table.flow thead th .sub { display: block; font-size: 10px; color: var(--ink-3); margin-top: 2px; font-weight: 500; text-transform: none; letter-spacing: 0; }

table.flow tbody tr { border-bottom: 1px solid var(--line); transition: background 0.12s; }
table.flow tbody tr:hover { background: var(--bg-2); }
table.flow tbody tr:last-child { border-bottom: none; }
table.flow tbody td { padding: 14px 10px; text-align: right; vertical-align: middle; font-family: 'JetBrains Mono', monospace; font-weight: 500; }
table.flow tbody td.left { text-align: left; font-family: 'Inter', sans-serif; }

.c-star { width: 36px; }
.c-rank { width: 40px; }
.c-name { width: 210px; }
.c-price { width: 100px; }
.c-ch { width: 70px; }
.c-trades { width: 120px; }
.c-tvol { width: 110px; }
.c-totvol { width: 110px; }
.c-spread { width: 90px; }
.c-bid { width: 105px; }
.c-ask { width: 105px; }
.c-bs { width: 130px; }

.star { background: transparent; border: none; color: var(--ink-3); font-size: 14px; padding: 4px; }
.star:hover { color: var(--amber); }
.star.on { color: var(--amber); }
.rank-num { color: var(--ink-2); font-weight: 600; }

.pair-cell { display: flex; align-items: center; gap: 10px; }
.coin-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: white; flex-shrink: 0; }
.coin-img { object-fit: contain; background: var(--icon-bg); box-shadow: 0 0 0 1px var(--icon-ring); }
.pair-text { display: flex; flex-direction: column; min-width: 0; }
.pair-name { font-weight: 600; font-size: 14px; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; line-height: 1.2; }
.pair-name .sym-q { color: var(--ink-3); font-weight: 500; font-size: 12px; }
.pair-name .market-tag { font-size: 9px; padding: 2px 6px; border-radius: 3px; letter-spacing: 0.06em; font-weight: 700; }
.pair-name .perp-tag { background: var(--amber, #f7931a); color: #1a0e00; }
.pair-name .spot-tag { background: var(--accent, #00d4ff); color: #001a22; }
.pair-sub { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.venue-pill { font-size: 10px; padding: 2px 6px; border-radius: 4px; color: white; font-weight: 600; letter-spacing: 0.04em; }

td.pos { color: var(--green); font-weight: 600; }
td.neg { color: var(--red); font-weight: 600; }
td.muted { color: var(--ink-2); }

.metric-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; width: 100%; }
.metric-val { font-weight: 600; font-size: 13px; color: var(--ink); }
.metric-bar-mini { width: 70px; height: 3px; background: var(--bg-3); border-radius: 2px; overflow: hidden; }
.metric-bar-mini > div { height: 100%; transition: width 0.4s; }
.mb-trades { background: var(--accent); }
.mb-vol { background: var(--accent); }
.mb-spread { background: var(--amber); }
.mb-bid { background: var(--bid); }
.mb-ask { background: var(--ask); }
.metric-val.tight { color: var(--green); }
.metric-val.wide { color: var(--red); }

.bs-bar { width: 110px; height: 18px; border-radius: 4px; overflow: hidden; display: flex; background: var(--bg-3); margin-left: auto; font-size: 10px; font-weight: 700; }
.bs-bar .bs-buy { background: var(--green); color: white; display: flex; align-items: center; justify-content: center; transition: width 0.4s; min-width: 0; }
.bs-bar .bs-sell { background: var(--red); color: white; display: flex; align-items: center; justify-content: center; transition: width 0.4s; min-width: 0; }
.bs-bar.empty { color: var(--ink-3); align-items: center; justify-content: center; font-size: 10px; }

/* paging */
.paging { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; color: var(--ink-2); font-size: 13px; }
.paging .pages { display: flex; gap: 4px; }
.paging .pg { width: 32px; height: 32px; border: 1px solid var(--line); background: var(--bg); border-radius: 6px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.paging .pg.on { background: var(--accent); color: white; border-color: var(--accent); }
.paging .pg:disabled { opacity: 0.4; cursor: not-allowed; }

.foot { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot a { color: var(--accent); font-weight: 600; }

/* THEME TOGGLE */
.theme-toggle { width: 36px; height: 36px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; transition: color 0.15s, border-color 0.15s; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
[data-theme="light"] .theme-toggle .ic-moon { display: none; }
[data-theme="dark"] .theme-toggle .ic-sun { display: none; }

/* CONNECTION BANNER */
.conn-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: var(--red); color: #fff;
  text-align: center; padding: 8px 16px; font-size: 13px; font-weight: 600;
  animation: slidedown 0.25s ease-out;
}
@keyframes slidedown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* SKELETON LOADERS */
.skel { background: linear-gradient(90deg, var(--bg-3) 0%, var(--bg-2) 50%, var(--bg-3) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 4px; display: inline-block; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.hl-list .skel-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.hl-list .skel-row .skel { height: 14px; }
.hl-list .skel-row .skel.w-rank { width: 12px; height: 12px; border-radius: 50%; }
.hl-list .skel-row .skel.w-icon { width: 22px; height: 22px; border-radius: 50%; }
.hl-list .skel-row .skel.w-name { flex: 1; }
.hl-list .skel-row .skel.w-val { width: 60px; }

/* SPARKLINE */
.sparkline { width: 78px; height: 28px; display: inline-block; vertical-align: middle; }
.sparkline path { fill: none; stroke-width: 1.6; }
.sparkline.up path { stroke: var(--green); }
.sparkline.down path { stroke: var(--red); }
.sparkline.flat path { stroke: var(--ink-3); }
.c-spark { width: 90px; }

/* CLICKABLE ROWS */
table.flow tbody tr { cursor: pointer; }
table.flow tbody tr:hover .pair-name { color: var(--accent); }

/* DRAWER */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(13,20,33,0.55);
  animation: fadein 0.2s ease-out;
}
[data-theme="dark"] .drawer-backdrop { background: rgba(0,0,0,0.7); }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100;
  width: min(620px, 92vw);
  background: var(--bg);
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 30px rgba(0,0,0,0.18);
  display: flex; flex-direction: column;
  animation: slidein 0.25s cubic-bezier(.4,.0,.2,1);
  overflow-y: auto;
}
.drawer[hidden], .drawer-backdrop[hidden] { display: none !important; }
@keyframes slidein { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.drawer-title { display: flex; gap: 12px; align-items: center; }
.drawer-pair { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.drawer-venue { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.drawer-close { width: 32px; height: 32px; border: 1px solid var(--line-2); background: var(--bg-2); border-radius: 8px; color: var(--ink-2); font-size: 14px; }
.drawer-close:hover { color: var(--accent); border-color: var(--accent); }
.drawer-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.drawer-stat .label { font-size: 11px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.drawer-stat .val { font-size: 16px; font-weight: 700; font-family: 'JetBrains Mono', monospace; color: var(--ink); margin-top: 4px; }
.drawer-stat .val.pos { color: var(--green); }
.drawer-stat .val.neg { color: var(--red); }
.drawer-section { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-section h3 { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.drawer-chart { width: 100%; height: 180px; display: block; }
.drawer-chart-flow { height: 120px; }
.drawer-chart svg { width: 100%; height: 100%; }
.drawer-chart .grid line { stroke: var(--line); stroke-dasharray: 2 2; }
.drawer-chart .axis text { font-size: 10px; fill: var(--ink-3); font-family: 'JetBrains Mono', monospace; }

/* MOBILE */
@media (max-width: 1300px) {
  .c-totvol, .c-bs { display: none; }
  .highlights { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 900px) {
  .c-bid, .c-ask, .c-spread { display: none; }
  .highlights { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .topnav { padding: 0 12px; gap: 10px; }
  .top-search { width: 140px; }
  .ribbon { padding: 8px 12px; gap: 14px; font-size: 12px; }
  main { padding: 16px 12px 60px; }
  .page-head h1 { font-size: 22px; }
  table.flow thead th { padding: 10px 6px; font-size: 11px; }
  table.flow tbody td { padding: 10px 6px; font-size: 13px; }
  .c-rank, .c-spread, .c-bid, .c-ask, .c-totvol, .c-bs { display: none; }
  .pair-name { font-size: 13px; }
  .pair-name .sym-q { display: none; }
  .window-bar { padding: 10px 12px; gap: 10px; }
  .window-bar .hint { display: none; }
  .drawer-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Spot vs Perp left-edge stripe ---------- */
table.flow tbody tr { position: relative; }
table.flow tbody tr.row-perp td:first-child { box-shadow: inset 4px 0 0 0 var(--amber, #f7931a); }
table.flow tbody tr.row-spot td:first-child { box-shadow: inset 4px 0 0 0 var(--accent, #00d4ff); }
table.flow tbody tr.row-perp:hover { background: rgba(247, 147, 26, 0.06); }
table.flow tbody tr.row-spot:hover { background: rgba(0, 212, 255, 0.06); }

/* ---------- Tag pills (Cabal Coin List) ---------- */
.tag-pill { display: inline-block; padding: 2px 7px; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; border-radius: 3px; background: var(--bg-3); color: var(--ink-2); margin-right: 4px; text-transform: uppercase; }

/* ---------- Page sections ---------- */
.page { display: block; }
.page[hidden] { display: none; }
.page-stub {
  text-align: center;
  padding: 80px 24px;
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  color: var(--ink-2);
  margin: 24px 0;
}
.page-stub .stub-icon { font-size: 48px; margin-bottom: 16px; }
.page-stub h2 { font-size: 20px; color: var(--ink); margin-bottom: 8px; }
.page-stub p { font-size: 14px; line-height: 1.6; max-width: 520px; margin: 0 auto; }
.page-stub code { background: var(--bg-3); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: 'JetBrains Mono', monospace; }
.badge-soon { display: inline-block; background: var(--amber); color: #fff; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; vertical-align: middle; margin-left: 8px; letter-spacing: 0.04em; }

/* ---------- Drawer GO TRADE button ---------- */
.drawer-foot {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  bottom: 0;
}
.btn-trade {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #001018;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 10px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 4px 16px rgba(0,212,255,0.25);
}
.btn-trade:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(0,212,255,0.35); }
.btn-trade .trade-arrow { font-size: 18px; }
.btn-trade .trade-venue { opacity: 0.7; font-size: 13px; font-weight: 600; }
.btn-trade-mini {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent);
  color: #001018;
  font-weight: 700;
  font-size: 11px;
  text-decoration: none;
  border-radius: 5px;
  letter-spacing: 0.05em;
}
.btn-trade-mini:hover { background: var(--accent-2); }

/* ============ Cabal Flows page ============ */
[hidden] { display: none !important; }
#page-cabal-flows.cf-page {
  --cf-bg-2: var(--bg-2);
  --cf-bg-3: var(--bg-3);
  --cf-line: var(--line);
  --cf-ink: var(--ink);
  --cf-ink-2: var(--ink-2);
  --cf-ink-3: var(--ink-3);
  --cf-ink-4: var(--line-2);
  --cf-green: #00b863;
  --cf-green-2: #16c784;
  --cf-red: #e23847;
  --cf-red-2: #ea3943;
  --cf-amber: #d99a00;
  --cf-blue: #0095d4;
  --cf-shadow: 0 12px 40px rgba(88,102,126,0.18);
  display: flex; flex-direction: column; gap: 10px;
  padding: 6px 0 12px;
}
[data-theme="dark"] #page-cabal-flows.cf-page {
  --cf-green: #00e676;
  --cf-green-2: #a8ff66;
  --cf-red: #ff3b5c;
  --cf-red-2: #ff8090;
  --cf-amber: #ffb73a;
  --cf-blue: #4dc4ff;
  --cf-shadow: 0 12px 40px rgba(0, 0, 0, .6);
}
.cf-page .num { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }
.cf-top { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.cf-brand { font-weight: 800; font-size: 13px; letter-spacing: .06em; }
.cf-brand b { color: var(--cf-green); }
.cf-search { position: relative; display: flex; align-items: center; gap: 8px; flex: 1; max-width: 420px; background: var(--cf-bg-2); border: 1px solid var(--cf-line); border-radius: 10px; padding: 6px 11px; }
.cf-search:focus-within { border-color: var(--cf-green); box-shadow: 0 0 0 2px rgba(0, 230, 118, .12); }
.cf-ico { font-size: 13px; color: var(--cf-ink-3); }
.cf-search input { background: none; border: none; outline: none; color: var(--cf-ink); font: inherit; font-size: 12px; flex: 1; font-family: 'JetBrains Mono', monospace; }
.cf-search input::placeholder { color: var(--cf-ink-3); }
.cf-active-tag { background: var(--cf-green); color: #001; font-weight: 800; font-size: 10px; padding: 2px 7px; border-radius: 99px; letter-spacing: .06em; }
.cf-dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--cf-bg-2); border: 1px solid var(--cf-line); border-radius: 10px; padding: 4px; display: none; z-index: 50; max-height: 360px; overflow-y: auto; box-shadow: var(--cf-shadow); }
.cf-search.cf-open .cf-dropdown { display: block; }
.cf-drop-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; font-size: 11px; cursor: pointer; }
.cf-drop-row:hover { background: var(--cf-bg-3); }
.cf-drop-row .s { font-weight: 700; }
.cf-drop-row .px { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; }
.cf-drop-row .ch { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 700; }
.cf-drop-row.up .ch { color: var(--cf-green-2); }
.cf-drop-row.dn .ch { color: var(--cf-red-2); }
.cf-spacer { flex: 1; }
.cf-count { color: var(--cf-ink-3); font-size: 10.5px; letter-spacing: .04em; font-family: 'JetBrains Mono', monospace; }
.cf-live { padding: 5px 11px; background: var(--cf-green); color: #001; border-radius: 99px; font-weight: 700; font-size: 11px; letter-spacing: .06em; display: inline-flex; align-items: center; gap: 6px; }
.cf-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #001; animation: cf-pulse 1.4s infinite; }
@keyframes cf-pulse { 50% { opacity: .4; } }
.cf-band { display: flex; align-items: center; gap: 8px; font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: var(--cf-ink-3); font-weight: 700; }
.cf-band .cf-d { width: 5px; height: 5px; border-radius: 50%; }
.cf-band.cf-ctx .cf-d { background: var(--cf-green); }
.cf-band.cf-pos .cf-d { background: var(--cf-blue); }
.cf-band.cf-flow .cf-d { background: var(--cf-amber); }
.cf-band hr { flex: 1; border: 0; border-top: 1px solid var(--cf-line); }
.cf-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; }
.cf-row-label { grid-column: 1 / -1; }
.cf-card { background: var(--cf-bg-2); border: 1px solid var(--cf-line); border-radius: 14px; padding: 11px 13px; display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; gap: 7px; }
.cf-card.cf-hero { background: linear-gradient(160deg, rgba(0, 230, 118, .16), rgba(0, 230, 118, .02) 70%); border-color: rgba(0, 230, 118, .32); }
.cf-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.cf-name { font-size: 9.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--cf-ink-2); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-light { padding: 2px 8px; border-radius: 99px; font-size: 9px; font-weight: 800; letter-spacing: .06em; white-space: nowrap; background: var(--cf-bg-3); color: var(--cf-ink-2); }
.cf-light.go { background: var(--cf-green); color: #001; }
.cf-light.hold { background: var(--cf-amber); color: #1a0e00; }
.cf-light.stop { background: var(--cf-red); color: #fff; }
.cf-big { font-size: 23px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.cf-big.lg { font-size: 30px; }
.cf-g { color: var(--cf-green-2); }
.cf-r { color: var(--cf-red-2); }
.cf-a { color: var(--cf-amber); }
.cf-delta { font-size: 11.5px; font-weight: 700; }
.cf-topline { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; }
.cf-sub { font-size: 10px; color: var(--cf-ink-3); font-family: 'JetBrains Mono', monospace; }
.cf-px { font-size: 36px; font-weight: 900; letter-spacing: -.02em; line-height: .95; }
.cf-ohlc { display: flex; gap: 11px; flex-wrap: wrap; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--cf-ink-3); }
.cf-ohlc b { color: var(--cf-ink-2); font-weight: 600; }
.cf-ohlc .cf-hi { color: var(--cf-green-2); }
.cf-ohlc .cf-lo { color: var(--cf-red-2); }
.cf-split { height: 7px; border-radius: 99px; display: flex; overflow: hidden; background: var(--cf-bg-3); }
.cf-split .cf-b { background: linear-gradient(90deg, var(--cf-green), var(--cf-green-2)); height: 100%; }
.cf-split .cf-s { background: linear-gradient(90deg, var(--cf-red-2), var(--cf-red)); height: 100%; }
.cf-splitlbl { display: flex; justify-content: space-between; font-size: 10px; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.cf-splitlbl .cf-l { color: var(--cf-green-2); }
.cf-splitlbl .cf-r { color: var(--cf-red-2); }
.cf-chart { min-height: 100px; }
.cf-chart svg { display: block; width: 100%; height: 100%; }
.cf-chart .ax { stroke: var(--cf-ink-4); stroke-width: 1; }
.cf-chart .axgrid { stroke: rgba(138, 150, 168, .07); stroke-dasharray: 2 4; }
.cf-chart .axzero { stroke: var(--cf-ink-3); stroke-dasharray: 2 3; opacity: .55; }
.cf-chart .axlbl, .cf-chart .axlbl-x { fill: var(--cf-ink-3); font-size: 9px; font-family: 'JetBrains Mono', monospace; font-weight: 500; }
.cf-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 5px; border-top: 1px solid var(--cf-line); margin-top: auto; }
.cf-foot .cf-k { font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--cf-ink-3); font-weight: 700; }
.cf-foot .cf-v { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 11px; color: var(--cf-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-liq-list { display: flex; flex-direction: column; gap: 3px; max-height: 120px; overflow: hidden; }
.cf-liq-row { display: grid; grid-template-columns: auto auto 1fr auto; gap: 6px; align-items: center; padding: 3px 7px; border-radius: 6px; background: var(--cf-bg-3); font-size: 10.5px; font-family: 'JetBrains Mono', monospace; }
.cf-liq-row .dot { width: 6px; height: 6px; border-radius: 50%; }
.cf-liq-row.l .dot { background: var(--cf-red); }
.cf-liq-row.s .dot { background: var(--cf-green); }
.cf-liq-row .t { color: var(--cf-ink-3); font-size: 9.5px; }
.cf-liq-row .amt { font-weight: 700; font-size: 10px; }
.cf-liq-row.l .amt { color: var(--cf-red-2); }
.cf-liq-row.s .amt { color: var(--cf-green-2); }
.cf-book { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; font-family: 'JetBrains Mono', monospace; font-size: 10px; }
.cf-book .col { display: flex; flex-direction: column; gap: 2px; }
.cf-book .lvl { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 2px 6px; border-radius: 5px; background: var(--cf-bg-3); position: relative; overflow: hidden; }
.cf-book .lvl::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; opacity: .18; }
.cf-book .ask .lvl::before { background: var(--cf-red); }
.cf-book .bid .lvl::before { background: var(--cf-green); }
.cf-book .lvl > * { position: relative; }
.cf-book .ask .px { color: var(--cf-red-2); }
.cf-book .bid .px { color: var(--cf-green-2); }
.cf-book .qty { color: var(--cf-ink-2); text-align: right; }
.cf-minibar { height: 5px; background: var(--cf-bg-3); border-radius: 99px; overflow: hidden; position: relative; }
.cf-minibar > i { display: block; height: 100%; border-radius: 99px; }
.cf-minibar > i.cf-a { background: linear-gradient(90deg, #ff8c3d, var(--cf-amber)); }
.cf-minibar > i.cf-g { background: linear-gradient(90deg, var(--cf-green), var(--cf-green-2)); }
.cf-minibar > i.cf-r { background: linear-gradient(90deg, var(--cf-red), var(--cf-red-2)); }
.cf-minibar .cf-marker { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--cf-ink); }
.cf-mb-row { display: flex; justify-content: space-between; font-size: 8.5px; color: var(--cf-ink-3); letter-spacing: .14em; font-family: 'JetBrains Mono', monospace; }

/* v11 vitals additions */
#page-cabal-flows.cf-page .cf-grid { grid-template-rows: auto auto auto auto; }
.cf-pair-chips { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; }
.cf-pair { padding: 4px 9px; border-radius: 8px; background: var(--cf-bg-2); border: 1px solid var(--cf-line); display: flex; flex-direction: column; align-items: center; cursor: pointer; min-width: 60px; transition: border-color .15s; }
.cf-pair:hover { border-color: var(--cf-ink-3); }
.cf-pair.active { background: var(--cf-ink); color: var(--cf-bg-2); border-color: var(--cf-ink); }
.cf-pair .s { font-weight: 700; font-size: 11px; }
.cf-pair .c { font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600; margin-top: 1px; }
.cf-pair.up .c { color: var(--cf-green); }
.cf-pair.dn .c { color: var(--cf-red); }
.cf-pair.flat .c { color: var(--cf-amber); font-size: 9px; letter-spacing: .5px; }
.cf-pair.active.up .c { color: #00ff7e; }
.cf-pair.active.dn .c { color: #ff7090; }
.cf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: auto; }
.cf-stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cf-stat .cf-l { font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--cf-ink-3); font-weight: 700; }
.cf-stat .cf-v { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 11.5px; color: var(--cf-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-stat .cf-v.cf-g { color: var(--cf-green-2); }
.cf-stat .cf-v.cf-r { color: var(--cf-red-2); }
.cf-stat .cf-v.cf-a { color: var(--cf-amber); }
.cf-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: auto; }
.cf-chip { padding: 4px 6px; border-radius: 8px; background: var(--cf-bg-3); border: 1px solid var(--cf-line); display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cf-chip .cf-l { font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--cf-ink-3); font-weight: 700; }
.cf-chip .cf-v { font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 10.5px; color: var(--cf-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-chip.cf-cg .cf-v { color: var(--cf-green-2); }
.cf-chip.cf-cr .cf-v { color: var(--cf-red-2); }
.cf-chip.cf-ca .cf-v { color: var(--cf-amber); }
.cf-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; min-height: 0; }
.cf-vpin-left { display: flex; flex-direction: column; gap: 5px; min-height: 0; }
.cf-vpin-right { display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.cf-amber { color: var(--cf-amber) !important; font-weight: 700; letter-spacing: .1em; }
.cf-tbl { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.cf-tbl th { color: var(--cf-ink-3); font-weight: 600; text-align: right; padding: 2px 5px; letter-spacing: .1em; font-size: 9px; text-transform: uppercase; border-bottom: 1px solid var(--cf-line); }
.cf-tbl th:first-child, .cf-tbl td:first-child { text-align: left; }
.cf-tbl td { padding: 2.5px 5px; color: var(--cf-ink); font-family: 'JetBrains Mono', monospace; font-weight: 500; text-align: right; border-bottom: 1px solid var(--cf-line); }
.cf-tbl tr:last-child td { border-bottom: 0; }
.cf-tbl td.sym { font-family: inherit; font-weight: 700; }
.cf-tag2 { display: inline-block; padding: 1px 6px; font-size: 8.5px; font-weight: 800; letter-spacing: .06em; border-radius: 99px; }
.cf-tag2.toxic { background: rgba(255,59,92,.15); color: var(--cf-red-2); border: 1px solid rgba(255,59,92,.4); }
.cf-tag2.high { background: rgba(255,183,58,.15); color: var(--cf-amber); border: 1px solid rgba(255,183,58,.4); }
.cf-tag2.nrm { background: var(--cf-bg-3); color: var(--cf-ink-2); border: 1px solid var(--cf-line); }
.cf-callout { display: flex; align-items: center; gap: 6px; padding: 4px 7px; border-radius: 7px; background: linear-gradient(135deg, rgba(255,183,58,.16), rgba(255,183,58,.02)); border: 1px solid rgba(255,183,58,.4); font-size: 10.5px; margin-top: auto; }
.cf-callout b { color: var(--cf-amber); font-weight: 800; }
.cf-callout span { color: var(--cf-ink-2); font-size: 9.5px; }
.cf-callout .cf-pct { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-weight: 800; color: var(--cf-amber); font-size: 10px; }
.cf-callout-ico { font-size: 13px; }

/* Fundings: split pos/neg layout */
.fundings-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 20px 24px; }
@media (max-width: 1100px) { .fundings-split { grid-template-columns: 1fr; } }
.fundings-col { display: flex; flex-direction: column; min-width: 0; }
.fundings-col-title { font-size: 13px; font-weight: 700; letter-spacing: .04em; padding: 10px 4px 8px; text-transform: uppercase; }
.fundings-col-title.pos { color: var(--green); border-bottom: 2px solid var(--green); }
.fundings-col-title.neg { color: var(--red); border-bottom: 2px solid var(--red); }

/* Cabal disclaimer */
.cabal-disclaimer { color: var(--amber); font-style: italic; font-weight: 600; margin-top: 4px; }

/* CF top-tickers excluding majors are filtered in JS */

/* Binance Cabal page header */
.bc-head { padding: 18px 20px 8px; }
.bc-title { font-size: 28px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; color: var(--ink); }
.bc-subtitle { color: var(--ink-2); font-size: 14px; max-width: 920px; line-height: 1.5; margin-top: 6px; }

/* Compact fundings split tables — auto layout, no sticky header, no wrapping pill */
.fundings-split .flow { table-layout: auto; font-size: 13px; }
.fundings-split .flow thead th { position: static; padding: 10px 8px; font-size: 11px; white-space: nowrap; background: var(--bg-2); }
.fundings-split .flow tbody td { padding: 10px 8px; white-space: nowrap; }
.fundings-split .flow .pair-cell { gap: 8px; align-items: center; }
.fundings-split .flow .pair-name { font-size: 13px; white-space: nowrap; }
.fundings-split .flow .pair-sub { font-size: 10px; margin-top: 2px; }
.fundings-split .flow .venue-pill { padding: 2px 6px; font-size: 9px; white-space: nowrap; display: inline-block; }
.fundings-split .flow .market-tag { padding: 1px 5px; font-size: 9px; margin-left: 4px; }
.fundings-split .flow .rank-num { font-size: 12px; }
.fundings-split .flow .sym-q { font-size: 11px; opacity: .6; }
.fundings-split .table-wrap { overflow-x: auto; }
.fundings-split .flow .coin-icon, .fundings-split .flow .coin-letter { width: 22px; height: 22px; font-size: 10px; }
