* { 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 { color: var(--ink); }
.top-search::placeholder { color: var(--ink-3); }
.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; }
main:has(#page-trade-smart:not([hidden])) {
  max-width: none;
  padding: 0;
}
.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; line-height: 1.2; white-space: nowrap; }
.chip .venue-logo { width: 14px; height: 14px; border-radius: 3px; object-fit: cover; vertical-align: -3px; margin-right: 5px; }
.chip .venue-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; vertical-align: -1px; margin-right: 5px; }
.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 { color: var(--ink); }
.row-search::placeholder { color: var(--ink-3); }
.row-search:focus { border-color: var(--accent); }

/* TABLE */
/* overflow: clip (not hidden) keeps the rounded-corner clipping but does NOT
   make .table-wrap a sticky containing block — so the sticky <th>'s `top: 56px`
   resolves to the viewport (just under the sticky topnav) instead of being
   anchored to .table-wrap's top, which would push the sticky thead down and
   visually swallow row #1. */
.table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: clip; }
/* Cabal Coin List has 10+ wide columns (concentration bars are 120px). At
   narrow desktop widths (1024px) the rightmost column clips. Allow x-axis
   scrolling on that page only; keep y-axis clipped so the sticky thead fix
   isn't undone (overflow-y: clip doesn't establish a sticky containing block). */
#page-cabal-coins .table-wrap { overflow-x: auto; overflow-y: clip; }
/* The overflow-x:auto above makes THIS .table-wrap a scroll container, so the
   sticky <th>'s `top: 56px` (meant to clear the viewport topnav) instead resolves
   to the wrap's own top edge — pushing the opaque header 56px DOWN, on top of
   row #1. Harmless on a long list (hidden mid-scroll), but when a search collapses
   the table to a single row, the header paints over the only result. Pin the
   header to the wrap top (top:0) here so it can never overlap content. */
#page-cabal-coins table.flow thead th { top: 0; }
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;
  vertical-align: top;
  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, table.flow thead th.ccsort { cursor: pointer; user-select: none; }
table.flow thead th.sortable:hover, table.flow thead th.ccsort:hover { color: var(--ink); }

.conc-th { text-align: center !important; }
td.conc-cell { text-align: center; }
.conc-bar { position: relative; display: inline-block; width: 120px; height: 16px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; vertical-align: middle; box-shadow: inset 0 1px 1px rgba(0,0,0,.08); }
.conc-fill { position: absolute; inset: 0 auto 0 0; border-radius: 8px 0 0 8px; transition: width .3s ease; box-shadow: 0 0 6px rgba(0,0,0,.15) inset; }
.conc-low .conc-fill { background: linear-gradient(90deg, #16a34a, #4ade80); }
.conc-med .conc-fill { background: linear-gradient(90deg, #eab308, #f59e0b); }
.conc-high .conc-fill { background: linear-gradient(90deg, #f97316, #ef4444); }
.conc-lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6); letter-spacing: .2px; }
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-ret7d { width: 80px; }
.c-retbtc7d { width: 85px; }
.c-spark7d { width: 96px; }
.c-bs { width: 130px; }

.star { background: transparent; border: none; color: var(--ink-3); font-size: 20px; line-height: 1; padding: 4px 6px; cursor: pointer; transition: color .15s, transform .12s; }
.star:hover { color: var(--amber); transform: scale(1.15); }
.star.on { color: var(--amber); text-shadow: 0 0 6px rgba(245,180,40,.45); }
.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: 1px 6px; border-radius: 4px;
  letter-spacing: 0.06em; font-weight: 700;
  border: 1px solid transparent;
}
.pair-name .perp-tag {
  background: color-mix(in srgb, var(--amber, #f0b90b) 14%, transparent);
  color: var(--amber, #f0b90b);
  border-color: color-mix(in srgb, var(--amber, #f0b90b) 32%, transparent);
}
.pair-name .spot-tag {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}
.pair-name .rwa-tag {
  background: color-mix(in srgb, #d4af37 14%, transparent);
  color: #d4af37;
  border-color: color-mix(in srgb, #d4af37 32%, transparent);
}
.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: 1px 6px; border-radius: 4px; font-weight: 600; letter-spacing: 0.04em; border: 1px solid transparent; }

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.paging-top { margin: 0 0 12px; }
.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#pg-cur { width: auto; min-width: 64px; padding: 0 10px; font-family: 'JetBrains Mono', monospace; font-feature-settings: "tnum"; }
.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 */
.nav-x { 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; flex: none; }
.nav-x:hover { color: var(--accent); border-color: var(--accent); }
.nav-x svg { width: 15px; height: 15px; }
.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 stay visible at laptop sizes — only hidden on real mobile
     (≤720px) where the bottom mobile-tabs nav takes over. Hiding desktop
     nav at 1300px left users with NO navigation between 721–1300px. */
}
/* Narrow laptops: nav was wrapping into 3 lines because 6 links + search
   + toggle + LIVE don't fit on one row. Tighten everything and hide the
   top-search (page-specific search is still available where it matters). */
@media (max-width: 1180px) {
  .nav-links { gap: 14px; flex-wrap: nowrap; white-space: nowrap; }
  .nav-links a { font-size: 12.5px; padding: 6px 0; }
  .topnav .top-search { display: none; }
  .topnav { gap: 14px; }
}
@media (max-width: 900px) {
  .c-spark7d { 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-retbtc7d, .c-spark7d, .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: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-cabal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 11px 20px;
  background: var(--bg-2);
  color: var(--ink);
  border: 1px solid var(--line-2);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-radius: 10px;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.btn-cabal:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-cabal .cabal-arrow { font-size: 14px; opacity: .7; }
.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;
  /* Bottom padding = 56px so the fixed `.cf-tape` (36px + 1px border + glow)
     never overlaps the last card. Mobile bumps higher in the 720px @media. */
  padding: 6px 0 56px;
}
[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: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cf-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 1 1 360px; flex-wrap: wrap; margin-left: auto; }
.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 1 260px; max-width: 460px; 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; min-width: 580px; background: var(--cf-bg-2); border: 1px solid var(--cf-line); border-radius: 10px; padding: 0; display: none; z-index: 50; max-height: 440px; overflow-y: auto; box-shadow: var(--cf-shadow); }
.cf-search.cf-open .cf-dropdown { display: block; }
.cf-drop-head, .cf-drop-row { display: grid; grid-template-columns: 70px 92px 70px 1fr 1fr 78px; gap: 10px; align-items: center; padding: 6px 10px; font-size: 11px; }
.cf-drop-head { position: sticky; top: 0; background: var(--cf-bg-2); border-bottom: 1px solid var(--cf-line); padding-top: 8px; padding-bottom: 8px; z-index: 2; }
.cf-drop-h { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: #8a8a8a; cursor: pointer; user-select: none; font-weight: 700; }
.cf-drop-h:hover { color: #fff; }
.cf-drop-h.on { color: var(--cf-green-2); }
.cf-drop-h:not(:first-child) { text-align: right; }
.cf-drop-row { border-radius: 6px; cursor: pointer; }
.cf-drop-row:hover { background: var(--cf-bg-3); }
.cf-drop-row .s { font-weight: 700; }
.cf-drop-row .px, .cf-drop-row .ch, .cf-drop-row .vol, .cf-drop-row .oi, .cf-drop-row .apr { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; text-align: right; }
.cf-drop-row .ch, .cf-drop-row .apr { font-weight: 700; font-size: 10px; }
.cf-drop-row.up .ch { color: var(--cf-green-2); }
.cf-drop-row.dn .ch { color: var(--cf-red-2); }
.cf-drop-row .apr.up { color: var(--cf-green-2); }
.cf-drop-row .apr.dn { 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-hero-modes { display: inline-flex; gap: 2px; background: var(--cf-bg-3); border-radius: 6px; padding: 2px; margin-left: auto; }
.cf-mpill { padding: 3px 8px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; color: var(--cf-ink-2); background: transparent; border: none; border-radius: 4px; cursor: pointer; }
.cf-mpill:hover { color: var(--ink); }
.cf-mpill.on { background: var(--accent); color: #fff; }

/* Share-card button + modal */
.cf-share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; margin-left: 0; padding: 0 14px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .06em;
  color: #0a0e1a; background: linear-gradient(135deg, #00d4ff 0%, #00b8cc 100%);
  border: none; border-radius: 6px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,212,255,.25);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.cf-share-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,212,255,.45); filter: brightness(1.06); }
.cf-share-btn:active { transform: translateY(0); }

/* Ask-AI copy button. Outline pill so it reads as secondary to Share. */
.cf-ai-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; margin-left: 0; padding: 0 11px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  color: var(--ink); background: var(--bg-3);
  border: 1px solid var(--line-2); border-radius: 6px; cursor: pointer;
  transition: border-color .12s, transform .12s, background .12s;
}
.cf-ai-btn svg { flex: 0 0 auto; }
.cf-ai-btn:hover { transform: translateY(-1px); border-color: var(--cf-blue); background: color-mix(in srgb, var(--cf-blue) 10%, transparent); }
.cf-ai-btn:active { transform: translateY(0); }
.cf-ai-btn svg { color: var(--cf-blue); }
.cf-ai-btn.copied { border-color: var(--cf-green); color: var(--cf-green); background: color-mix(in srgb, var(--cf-green) 10%, transparent); }
.cf-ai-btn.copied svg { color: var(--cf-green); }
.cf-share-modal { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; }
.cf-share-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.78); backdrop-filter: blur(6px); }
.cf-share-dialog {
  position: relative; max-width: 92vw; max-height: 92vh;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  display: flex; flex-direction: column; gap: 14px;
}
.cf-share-close {
  position: absolute; top: 12px; right: 12px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 20px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s, border-color .12s, transform .12s;
}
.cf-share-close:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); transform: scale(1.05); }
.cf-share-preview-wrap { position: relative; display: flex; justify-content: center; }
.cf-share-preview-wrap canvas {
  display: block;
  max-width: min(85vw, 1100px);
  max-height: 82vh;
  width: auto; height: auto;
  border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.5);
  /* Force browser to use high-quality downsampling for the high-res buffer */
  image-rendering: high-quality;
  image-rendering: -webkit-optimize-contrast;
}
@media (max-width: 720px) {
  .cf-share-preview-wrap canvas { max-width: 92vw; max-height: 72vh; }
}
.cf-share-status {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5); color: var(--accent); font-size: 14px; font-weight: 600;
  border-radius: 8px;
}

/* Smooth bottom-center toast for share-card feedback */
.cf-share-toast {
  position: fixed; left: 50%; bottom: 32px;
  transform: translate(-50%, 24px) scale(.96);
  padding: 12px 22px;
  background: linear-gradient(135deg, rgba(34,197,94,.95), rgba(22,163,74,.95));
  color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .01em;
  border-radius: 12px;
  box-shadow: 0 12px 38px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.10) inset;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  z-index: 11000;
  transition: opacity .28s cubic-bezier(.2,.7,.3,1), transform .32s cubic-bezier(.2,.7,.3,1);
  font-family: 'Inter', system-ui;
  white-space: nowrap;
}
.cf-share-toast.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.cf-share-toast.err {
  background: linear-gradient(135deg, rgba(239,68,68,.95), rgba(220,38,38,.95));
}
@media (max-width: 720px) {
  .cf-share-toast {
    left: 16px; right: 16px; bottom: 16px;
    transform: translate(0, 16px) scale(.98);
    text-align: center;
    white-space: normal;     /* allow wrapping inside the 358px strip */
    font-size: 13px;
    padding: 10px 16px;
    line-height: 1.35;
  }
  .cf-share-toast.on { transform: translate(0, 0) scale(1); }
}
.cf-share-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cf-share-act {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; font-size: 12px; font-weight: 700; letter-spacing: .03em;
  background: var(--bg-3); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; transition: background .12s, border-color .12s;
}
.cf-share-act:hover { border-color: var(--accent); color: var(--accent); }
.cf-share-act.primary { background: var(--accent); color: #0a0e1a; border-color: var(--accent); }
.cf-share-act.primary:hover { filter: brightness(1.08); color: #0a0e1a; }
.cf-share-act.x { background: #000; color: #fff; border-color: #000; }
.cf-share-act.x:hover { background: #1d1d1d; color: #fff; }
@media (max-width: 720px) {
  .cf-share-dialog { padding: 12px; gap: 10px; }
  .cf-share-close { top: 8px; right: 8px; width: 44px; height: 44px; font-size: 22px; }
  .cf-share-preview-wrap canvas { width: 92vw; }
  .cf-share-act { padding: 10px 14px; font-size: 11.5px; flex: 1 1 auto; justify-content: center; }
}

.cf-zoom-pills { display: inline-flex; gap: 2px; margin-left: 8px; padding: 2px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; }
.cf-zpill { padding: 3px 9px; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--cf-ink-2); background: transparent; border: none; border-radius: 4px; cursor: pointer; font-family: 'JetBrains Mono', monospace; }
.cf-zpill:hover { color: var(--ink); background: var(--bg-2); }
.cf-zpill.on { background: var(--accent); color: #fff; }
.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: flex-start; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.cf-topline .cf-delta { margin-left: auto; }
.cf-ticker-badge {
  display: inline-flex; align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(0,212,255,.22), rgba(0,212,255,.08));
  border: 1px solid rgba(0,212,255,.42);
  color: var(--accent-2, #00d4ff);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .04em;
  white-space: nowrap;
  align-self: center;
  box-shadow: 0 1px 6px rgba(0,212,255,.18);
}
.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: 110px; position: relative; }
.cf-chart.cf-chart-sm { min-height: 98px; }
/* HTML x-axis labels overlay the SVG's reserved bottom padding (PB=22 in viewBox units).
   Absolute positioning keeps the chart from collapsing in flex layouts. */
/* X-axis labels: absolutely positioned at each boundary tick (left % set
   inline), so they sit under their vertical gridline. The "now" tag pins to
   the right plot edge in accent. */
.cf-xaxis-html { position: absolute; left: 0; right: 0; bottom: 2px; height: 12px;
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 600; color: var(--cf-ink-2);
  user-select: none; line-height: 1; pointer-events: none; }
.cf-xaxis-html .axl { position: absolute; bottom: 0; white-space: nowrap; }
.cf-xaxis-html .axl.day { color: var(--cf-ink); }       /* date-change tick — brighter */
.cf-xaxis-html .axl.now { color: var(--cf-accent, #00d4ff); font-weight: 700; }
/* Crisp HTML y-axis labels (top=max, bottom=min). Overlay the plot's left
   edge at true pixel size — no SVG stretch, no left-edge clipping of wide
   negative values. Shadow keeps them legible over the line/fill. */
.cf-yaxis-html { position: absolute; left: 0; top: 0; right: 0; bottom: 0;
  pointer-events: none; user-select: none;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 600;
  color: var(--cf-ink-3); line-height: 1; }
.cf-yaxis-html .ytop, .cf-yaxis-html .ybot { position: absolute; left: 4px; white-space: nowrap;
  text-shadow: 0 0 4px var(--cf-bg-2), 0 1px 2px var(--cf-bg-2); }
.cf-yaxis-html .ytop { top: 4px; }
.cf-yaxis-html .ybot { bottom: 22px; }
.cf-stack-vol-liq { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.cf-stack-vol-liq > .cf-card { min-height: 0; }
.cf-stack-vol-liq > .cf-card.cf-card-compact:first-child { flex: 1 1 auto; }
.cf-stack-vol-liq > .cf-liq24h-card { flex: 0 0 auto; }
.cf-card.cf-card-compact { padding: 9px 11px; gap: 5px; }
.cf-card.cf-card-compact .cf-topline .cf-big { font-size: 18px; }
.cf-stats.cf-stats-inline { gap: 4px; margin-top: 2px; }
.cf-stats.cf-stats-inline .cf-stat { padding: 2px 4px; }
.cf-stats.cf-stats-inline .cf-l { font-size: 9px; }
.cf-stats.cf-stats-inline .cf-v { font-size: 11px; }
/* --- 24H Liquidations compact panel --- */
.cf-liq24h-card { position: relative; overflow: hidden; padding: 7px 10px !important; gap: 4px !important; }
.cf-liq24h-card .cf-head { min-height: 0; }
.cf-liq24h-card .cf-name { font-size: 11px; }
.cf-liq24h-bias { font-size: 9px; font-weight: 700; letter-spacing: .3px; padding: 1px 6px; border-radius: 3px; background: var(--cf-bg-3); color: var(--cf-ink-3); }
.cf-liq24h-bias.long-heavy { color: #ef4444; background: rgba(234,57,67,.12); }
.cf-liq24h-bias.short-heavy { color: #22c55e; background: rgba(22,199,132,.12); }
.cf-liq24h-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 5px; margin-top: 1px; }
.cf-liq24h-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 4px 7px; border-radius: 6px; background: var(--cf-bg-3); border: 1px solid transparent; transition: border-color .15s; }
.cf-liq24h-cell .cf-l { font-size: 8.5px; letter-spacing: .5px; color: var(--cf-ink-3); font-weight: 700; }
.cf-liq24h-cell .cf-v { font-size: 13px; font-weight: 800; font-family: 'JetBrains Mono', monospace; line-height: 1.1; }
.cf-liq24h-tot .cf-v { color: var(--cf-ink); }
.cf-liq24h-long .cf-l, .cf-liq24h-long .cf-v { color: var(--cf-red-2, #ef4444); }
.cf-liq24h-short .cf-l, .cf-liq24h-short .cf-v { color: var(--cf-green-2, #22c55e); }
.cf-liq24h-split { display: flex; height: 3px; border-radius: 2px; overflow: hidden; background: var(--cf-bg-3); margin-top: 3px; }
.cf-liq24h-bar { display: block; height: 100%; transition: width .3s ease; }
.cf-liq24h-bar-l { background: linear-gradient(90deg, #ef4444, #b91c1c); }
.cf-liq24h-bar-s { background: linear-gradient(90deg, #16a34a, #22c55e); }
/* Flash on new liquidation — dopamine pulse */
.cf-liq24h-card.flash-l { animation: cf-liq24h-pulse-l 1.1s ease-out 2; }
.cf-liq24h-card.flash-s { animation: cf-liq24h-pulse-s 1.1s ease-out 2; }
.cf-liq24h-card.flash-l-big { animation: cf-liq24h-pulse-l 1.2s ease-out 3; box-shadow: 0 0 36px rgba(234,57,67,.85); }
.cf-liq24h-card.flash-s-big { animation: cf-liq24h-pulse-s 1.2s ease-out 3; box-shadow: 0 0 36px rgba(22,199,132,.85); }
.cf-liq24h-cell.flash-cell-l { animation: cf-liq24h-cell-l 1.0s ease-out 2; border-color: rgba(234,57,67,.95); }
.cf-liq24h-cell.flash-cell-s { animation: cf-liq24h-cell-s 1.0s ease-out 2; border-color: rgba(22,199,132,.95); }
@keyframes cf-liq24h-pulse-l {
  0%   { box-shadow: 0 0 0 0 rgba(234,57,67,0), inset 0 0 0 0 rgba(234,57,67,0); background: var(--cf-bg-2); transform: scale(1); }
  12%  { box-shadow: 0 0 48px 10px rgba(234,57,67,.95), inset 0 0 0 2px rgba(234,57,67,.8); background: rgba(234,57,67,.32); transform: scale(1.02); }
  35%  { box-shadow: 0 0 28px 4px rgba(234,57,67,.55), inset 0 0 0 1px rgba(234,57,67,.4); background: rgba(234,57,67,.16); transform: scale(1.005); }
  100% { box-shadow: 0 0 0 0 rgba(234,57,67,0), inset 0 0 0 0 rgba(234,57,67,0); background: var(--cf-bg-2); transform: scale(1); }
}
@keyframes cf-liq24h-pulse-s {
  0%   { box-shadow: 0 0 0 0 rgba(22,199,132,0), inset 0 0 0 0 rgba(22,199,132,0); background: var(--cf-bg-2); transform: scale(1); }
  12%  { box-shadow: 0 0 48px 10px rgba(22,199,132,.95), inset 0 0 0 2px rgba(22,199,132,.8); background: rgba(22,199,132,.32); transform: scale(1.02); }
  35%  { box-shadow: 0 0 28px 4px rgba(22,199,132,.55), inset 0 0 0 1px rgba(22,199,132,.4); background: rgba(22,199,132,.16); transform: scale(1.005); }
  100% { box-shadow: 0 0 0 0 rgba(22,199,132,0), inset 0 0 0 0 rgba(22,199,132,0); background: var(--cf-bg-2); transform: scale(1); }
}
@keyframes cf-liq24h-cell-l {
  0%   { background: rgba(234,57,67,.9); transform: scale(1.08); box-shadow: 0 0 16px rgba(234,57,67,.7); }
  40%  { background: rgba(234,57,67,.45); transform: scale(1.03); box-shadow: 0 0 8px rgba(234,57,67,.4); }
  100% { background: var(--cf-bg-3); transform: scale(1); box-shadow: 0 0 0 rgba(234,57,67,0); }
}
@keyframes cf-liq24h-cell-s {
  0%   { background: rgba(22,199,132,.9); transform: scale(1.08); box-shadow: 0 0 16px rgba(22,199,132,.7); }
  40%  { background: rgba(22,199,132,.45); transform: scale(1.03); box-shadow: 0 0 8px rgba(22,199,132,.4); }
  100% { background: var(--cf-bg-3); transform: scale(1); box-shadow: 0 0 0 rgba(22,199,132,0); }
}
.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-chart .axtime { fill: var(--cf-ink-2); opacity: 1; font-size: 10px; font-weight: 600; }
.cf-chart .axtick { stroke: var(--cf-ink-4); stroke-width: 1; opacity: .8; }
/* Vertical time gridlines at each boundary tick. Faint; day-change ticks
   (intraday midnights) a touch brighter. "now" line marks the live right edge. */
.cf-chart .axvgrid { stroke: rgba(138, 150, 168, .09); stroke-width: 1; }
.cf-chart .axvgrid-day { stroke: rgba(138, 150, 168, .20); }
.cf-chart .axnow { stroke: var(--cf-accent, #00d4ff); stroke-width: 1; opacity: .30; stroke-dasharray: 2 3; }
.cf-chart { cursor: crosshair; }
.cf-chart svg .cf-xh { stroke: rgba(255, 255, 255, .55); stroke-width: 1; stroke-dasharray: 2 2; pointer-events: none; vector-effect: non-scaling-stroke; }
#cf-xh-tooltip {
  position: fixed; z-index: 60; display: none; pointer-events: none;
  background: rgba(10, 14, 18, .94);
  border: 1px solid rgba(168, 255, 102, .25);
  border-radius: 6px; padding: 7px 10px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px; color: #e6f0e0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  white-space: nowrap;
}
#cf-xh-tooltip .x-time { font-weight: 700; letter-spacing: .06em; font-size: 10.5px; color: #a8ff66; margin-bottom: 5px; }
#cf-xh-tooltip .x-row { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 14px; }
#cf-xh-tooltip .x-cell { display: flex; gap: 6px; align-items: baseline; }
#cf-xh-tooltip .x-lbl { color: var(--cf-ink-3); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; }
#cf-xh-tooltip .x-v { color: #e6f0e0; font-weight: 700; }
#cf-xh-tooltip .x-v2 { color: #4dc4ff; font-weight: 600; }
#cf-xh-tooltip .x-dash { color: var(--cf-ink-4); opacity: .55; }
.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-list-wide { max-height: none; gap: 4px; }
.cf-liq-row-wide { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: stretch; min-height: 0; }
.cf-liq-summary { display: flex; flex-direction: column; gap: 7px; }
.cf-liq-feed { display: flex; flex-direction: column; min-height: 0; }
.cf-liq-list-wide .cf-liq-row { grid-template-columns: 70px 70px 1fr 110px; padding: 5px 10px; font-size: 11.5px; }
.cf-liq-list-wide .cf-liq-row .t { font-size: 10.5px; }
.cf-liq-list-wide .cf-liq-row .amt { font-size: 12px; }
@keyframes cf-liq-flash {
  0%   { background: rgba(255, 200, 80, .35); box-shadow: 0 0 0 1px rgba(255,200,80,.5) inset; }
  60%  { background: rgba(255, 200, 80, .12); }
  100% { background: var(--cf-bg-3); box-shadow: none; }
}
.cf-liq-row.flash { animation: cf-liq-flash 1.2s ease-out 2; }
.cf-liq-row.l.flash { animation-name: cf-liq-flash-l; }
.cf-liq-row.s.flash { animation-name: cf-liq-flash-s; }
/* Tiered intensity by notional */
.cf-liq-row.flash-md { animation-duration: 1.4s; animation-iteration-count: 2; font-weight: 600; }
.cf-liq-row.flash-lg { animation-duration: 1.6s; animation-iteration-count: 3; font-weight: 700; transform-origin: left; }
.cf-liq-row.flash-lg.l { box-shadow: 0 0 12px rgba(234,57,67,.45); }
.cf-liq-row.flash-lg.s { box-shadow: 0 0 12px rgba(22,199,132,.45); }
.cf-liq-row.flash-xl { animation: cf-liq-flash-xl 1.8s ease-out 3; font-weight: 800; letter-spacing: .3px; }
@keyframes cf-liq-flash-xl {
  0%   { background: rgba(255,255,255,.95); color: #0b0e15; transform: scale(1.04); box-shadow: 0 0 32px 6px currentColor; }
  20%  { background: rgba(255, 220, 60, .9); color: #0b0e15; transform: scale(1.02); }
  60%  { background: rgba(255, 200, 80, .35); transform: scale(1); }
  100% { background: var(--cf-bg-3); box-shadow: none; }
}
.cf-liq-row.flash-xl.l { color: #ef4444; }
.cf-liq-row.flash-xl.s { color: #22c55e; }
@keyframes cf-liq-flash-l {
  0%   { background: rgba(234, 57, 67, .55); box-shadow: 0 0 0 1px rgba(234,57,67,.7) inset; }
  60%  { background: rgba(234, 57, 67, .18); }
  100% { background: var(--cf-bg-3); box-shadow: none; }
}
@keyframes cf-liq-flash-s {
  0%   { background: rgba(22, 199, 132, .55); box-shadow: 0 0 0 1px rgba(22,199,132,.7) inset; }
  60%  { background: rgba(22, 199, 132, .18); }
  100% { background: var(--cf-bg-3); box-shadow: none; }
}
.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; flex: 0 0 auto; }
.cf-pair-chips > * { flex: 0 0 auto; }
/* Movers strip — its own full-width row below the search/actions bar so the top
   bar stays a clean two-zone layout (search · actions) that reflows the same on
   every viewport. Each row (gainers / losers) scrolls horizontally if it overflows. */
/* Single compact movers row — gainers then losers in one horizontally-scrolling
   strip (color + sign carry the direction, so no need for two stacked rows). */
.cf-pair-groups { display: flex; flex-direction: row; align-items: center; gap: 10px; margin-top: 10px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cf-pair-groups::-webkit-scrollbar { height: 0; display: none; }
.cf-pair-groups .cf-pair-chips + .cf-pair-chips { border-left: 1px solid var(--cf-line); padding-left: 10px; }
.cf-pair-group-lbl {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 800;
  letter-spacing: .06em;
  white-space: nowrap;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--cf-bg-2);
  border: 1px solid var(--cf-line);
}
.cf-pair-group-lbl.up { color: var(--cf-green, #22c55e); border-color: rgba(34,197,94,.35); }
.cf-pair-group-lbl.dn { color: #ff8090; border-color: rgba(239,68,68,.35); }
.cf-pair { padding: 4px 9px; border-radius: 8px; background: var(--cf-bg-2); border: 1px solid var(--cf-line); display: flex; flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; 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; }
.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: 12px 20px 8px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.bc-head-left { min-width: 0; }
.bc-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.bc-subtitle { color: var(--ink-2); font-size: 12.5px; max-width: 720px; line-height: 1.4; margin-top: 2px; }
.bc-head .tg-cta { margin-top: 0; flex-shrink: 0; }
@media (max-width: 720px) {
  .bc-head { padding: 10px 14px 6px; gap: 8px; }
  .bc-title { font-size: 20px; }
}

/* === Live cross-coin liquidation ticker tape (fixed footer) === */
/* Desktop bottom padding is set on `#page-cabal-flows.cf-page` (line ~498)
   because that more-specific selector wins; this generic rule is redundant. */
.cf-tape { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 16px; margin: 0; background: var(--bg); border-top: 1px solid var(--line); border-radius: 0; overflow: hidden; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; box-shadow: 0 -4px 16px rgba(0,0,0,.18); color: var(--ink); }
[data-theme="dark"] .cf-tape { background: #0a0e1a; box-shadow: 0 -4px 16px rgba(0,0,0,.45); }
[data-theme="light"] .cf-tape { background: #ffffff; box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.cf-tape-label { position: relative; z-index: 3; flex: 0 0 auto; padding: 3px 9px; font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #0b0e15; background: linear-gradient(90deg, #ffd75a, #ffae00); border-radius: 4px; box-shadow: 0 0 10px rgba(255,174,0,.3), 6px 0 8px -2px var(--bg); white-space: nowrap; }
.cf-tape-24h { position: relative; z-index: 3; flex: 0 0 auto; padding: 3px 9px; font-size: 10.5px; font-weight: 600; color: var(--ink-2); background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; white-space: nowrap; box-shadow: 6px 0 8px -2px var(--bg); }
.cf-tape-24h b { color: var(--ink); font-weight: 800; }
[data-theme="dark"] .cf-tape-24h .cf-tape-l { color: #ff6b73; }
[data-theme="dark"] .cf-tape-24h .cf-tape-s { color: #4ade80; }
[data-theme="light"] .cf-tape-24h .cf-tape-l { color: #dc2626; }
[data-theme="light"] .cf-tape-24h .cf-tape-s { color: #16a34a; }
.cf-tape-track-wrap { position: relative; flex: 1 1 auto; overflow: hidden; height: 100%; display: flex; align-items: center; }
.cf-tape-track-wrap::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 18px; background: linear-gradient(90deg, var(--bg), transparent); z-index: 2; pointer-events: none; }
.cf-tape-track-wrap::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 18px; background: linear-gradient(270deg, var(--bg), transparent); z-index: 2; pointer-events: none; }
.cf-tape-track { display: flex; gap: 14px; white-space: nowrap; animation: cf-tape-scroll 45s linear infinite; }
.cf-tape:hover .cf-tape-track { animation-play-state: paused; }
@keyframes cf-tape-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.cf-tape-item { display: inline-flex; gap: 5px; align-items: center; }
[data-theme="dark"] .cf-tape-item.l { color: #ff6b73; }
[data-theme="dark"] .cf-tape-item.s { color: #4ade80; }
[data-theme="light"] .cf-tape-item.l { color: #dc2626; }
[data-theme="light"] .cf-tape-item.s { color: #16a34a; }
.cf-tape-sym { color: var(--ink); font-weight: 700; }
.cf-tape-sep { color: var(--ink-3); opacity: .45; }

/* === Whale-tier screen-edge flash === */
.cf-screen-flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 9999; transition: opacity .12s ease; }
.cf-screen-flash.on { animation: cf-screen-pulse 1.4s ease-out; }
.cf-screen-flash.long.lg { box-shadow: inset 0 0 90px 8px rgba(234,57,67,.55); }
.cf-screen-flash.short.lg { box-shadow: inset 0 0 90px 8px rgba(22,199,132,.55); }
.cf-screen-flash.long.xl { box-shadow: inset 0 0 220px 24px rgba(234,57,67,.85); }
.cf-screen-flash.short.xl { box-shadow: inset 0 0 220px 24px rgba(22,199,132,.85); }
@keyframes cf-screen-pulse {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  35%  { opacity: .7; }
  100% { opacity: 0; }
}

/* === Number count-up pop === */
.cf-num-pop { animation: cf-num-pop .4s ease-out; }
@keyframes cf-num-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); filter: brightness(1.4); }
  100% { transform: scale(1); }
}

/* 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; }

/* =========================================================================
   MOBILE — viewport ≤ 720px
   ========================================================================= */
.mobile-tabs { display: none; }
.drawer-handle { display: none; }

@media (max-width: 720px) {
  html, body {
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
  }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  *, *::before, *::after { max-width: 100%; }
  main, section, .page, .table-wrap, .fundings-split, .cf-grid, .cf-card,
  .highlights, .ribbon, .topnav, .window-bar, .markets-controls, .filters-row,
  .paging, .foot, .drawer, .mobile-tabs { min-width: 0; max-width: 100vw; box-sizing: border-box; }
  img, svg, video, canvas { max-width: 100%; height: auto; }
  .drawer-chart svg, .cf-card svg, .hl svg { width: 100%; height: 100%; }
  pre, code { white-space: pre-wrap; word-break: break-word; }
  table { table-layout: auto; max-width: 100%; }

  .topnav { padding: 8px 12px; gap: 8px; flex-wrap: wrap; position: sticky; top: 0; z-index: 60; height: auto; min-height: 52px; }
  .topnav .nav-links { display: none; }
  .topnav .nav-spacer { display: block; flex: 1 1 auto; }
  .topnav .logo-word { font-size: 16px; }
  .topnav .logo-mark svg { width: 24px; height: 24px; }
  .topnav .top-search { order: 99; flex: 1 1 100%; width: 100%; font-size: 16px; padding: 8px 12px 8px 36px; background-position: 12px center; }
  .topnav .conn-pill { font-size: 10px; padding: 3px 6px; margin-left: 0; }
  .topnav .theme-toggle { padding: 6px; }

  .mobile-tabs {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg-2);
    border-top: 1px solid var(--line-2);
    box-shadow: 0 -8px 24px rgba(0,0,0,.25);
    z-index: 1000; justify-content: space-around; align-items: stretch;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .mobile-tabs .mtab {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; text-decoration: none; color: var(--ink-3);
    font-size: 10px; font-weight: 600; user-select: none;
    -webkit-tap-highlight-color: transparent; transition: color .12s;
  }
  .mobile-tabs .mtab svg { width: 22px; height: 22px; }
  .mobile-tabs .mtab.on { color: var(--accent); }
  .mobile-tabs .mtab:active { color: var(--accent); transform: scale(.94); }

  .ribbon {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 4px 8px; padding: 6px 10px; overflow: visible;
  }
  .ribbon .stat {
    font-size: 9px; padding: 0; border: 0;
    text-transform: uppercase; letter-spacing: .03em;
    color: var(--ink-3); min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-align: left;
  }
  .ribbon .stat b { font-size: 11px; display: block; margin-top: 1px; font-weight: 700; color: var(--ink); letter-spacing: 0; text-transform: none; }
  .ribbon .stat::before, .ribbon .stat::after { display: none !important; }

  main { padding: 8px 10px; }

  .page-head h1 { font-size: 18px; }
  .page-head p { font-size: 12px; }
  .window-bar { flex-wrap: wrap; gap: 6px; padding: 8px 0; }
  .window-bar .hint { display: none; }
  .wpill { padding: 6px 10px; min-height: 36px; }

  .highlights { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 12px; }
  .hl { padding: 10px; min-width: 0; overflow: hidden; }
  .hl h3 { font-size: 11px; }
  .hl .hl-val { font-size: 13px; }
  .hl .hl-row { min-width: 0; }
  .hl .hl-name, .hl .hl-name .sym { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .markets-controls, .filters-row { flex-wrap: wrap; gap: 6px; }
  .venue-chips { flex-wrap: wrap; }
  .venue-chip, .market-pill, .filter-chip { min-height: 36px; padding: 6px 10px; }

  /* Hide desktop tables on Markets / Fundings / Cabal Coins; show card list */
  #page-markets .table-wrap > table.flow,
  #page-fundings .table-wrap > table.flow,
  #page-cabal-coins .table-wrap > table.flow { display: none !important; }
  .table-wrap,
  .fundings-split .table-wrap { overflow: visible !important; overflow-x: hidden !important; min-width: 0; border: 0 !important; padding: 0 !important; }
  .m-cards { display: flex; flex-direction: column; gap: 8px; }
  .m-card {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 12px; padding: 12px;
    display: grid;
    grid-template-columns: 36px 1fr auto;
    grid-template-rows: auto auto auto;
    column-gap: 10px; row-gap: 4px; align-items: center;
    -webkit-tap-highlight-color: transparent; user-select: none;
    transition: transform .08s, background .12s;
  }
  .m-card:active { transform: scale(.985); }
  .m-card .mc-icon { grid-column: 1; grid-row: 1 / span 2; width: 36px; height: 36px; }
  .m-card .mc-name { grid-column: 2; grid-row: 1; font-size: 14px; font-weight: 700; }
  .m-card .mc-price { grid-column: 3; grid-row: 1; font-size: 14px; font-weight: 700; text-align: right; }
  .m-card .mc-venue { grid-column: 2; grid-row: 2; font-size: 11px; opacity: .7; }
  .m-card .mc-chg { grid-column: 3; grid-row: 2; font-size: 12px; font-weight: 600; text-align: right; }
  .m-card .mc-chg.up { color: var(--green); }
  .m-card .mc-chg.down { color: var(--red); }
  .m-card .mc-meta {
    grid-column: 1 / -1; grid-row: 3;
    display: flex; gap: 10px; flex-wrap: wrap;
    font-size: 11px; opacity: .8;
    margin-top: 4px; padding-top: 6px;
    border-top: 1px dashed var(--line);
  }

  .fundings-split { grid-template-columns: 1fr !important; gap: 16px; }
  .fundings-split table.flow { display: none !important; }
  .paging { flex-wrap: wrap; gap: 8px; }
  .f-cards { display: flex; flex-direction: column; gap: 6px; }
  .f-card {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 10px; padding: 10px 12px;
    display: grid; grid-template-columns: 22px 28px 1fr auto;
    column-gap: 10px; align-items: center;
  }
  .f-card .f-rank { font-size: 12px; opacity: .6; text-align: center; }
  .f-card .f-icon { width: 28px; height: 28px; }
  .f-card .f-name { font-size: 13px; font-weight: 600; }
  .f-card .f-sub { font-size: 10px; opacity: .6; margin-top: 2px; }
  .f-card .f-apr { font-size: 14px; font-weight: 700; text-align: right; }
  .f-card .f-apr.pos { color: var(--green); }
  .f-card .f-apr.neg { color: var(--red); }

  .cf-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .cf-grid > * { grid-column: 1 / -1 !important; }
  .cf-twocol { grid-template-columns: 1fr !important; }
  .cf-pair-groups {
    -webkit-overflow-scrolling: touch;
    /* Right-edge fade hints there's more to scroll on narrow viewports. */
    -webkit-mask-image: linear-gradient(to right, black 0, black 92%, transparent 100%);
            mask-image: linear-gradient(to right, black 0, black 92%, transparent 100%);
  }
  .cf-search { width: 100%; min-width: 0; }
  .cf-card { padding: 10px; }
  .cf-card h2, .cf-card h3 { font-size: 13px; }

  /* Cabal top bar: stack and let chips/meta wrap below the search */
  .cf-top { flex-wrap: wrap !important; max-width: 100vw; box-sizing: border-box; min-width: 0; gap: 8px !important; }
  .cf-top > * { min-width: 0; }
  .cf-spacer { display: none !important; }
  .cf-count, .cf-live { font-size: 10px; }

  /* Section heads: allow the right-side regime pill (FALLING / RISING / FLAT)
     to wrap to its own line so it doesn't clip past the viewport edge. */
  .cf-head { flex-wrap: wrap; row-gap: 4px; }
  .cf-light { flex: 0 0 auto; }

  /* Live tape: shrink the 24h totals chip + label so values fit on one line */
  .cf-tape-24h { font-size: 9.5px !important; padding: 2px 6px !important; }
  .cf-tape-label { font-size: 9px !important; padding: 2px 6px !important; }

  /* Cabal search dropdown: drop the 580px min-width on mobile and anchor
     to viewport gutters so it doesn't blow past the screen. */
  .cf-dropdown {
    min-width: 0 !important;
    width: calc(100vw - 32px);
    left: 16px;
    right: 16px;
    max-height: 60vh;
  }

  /* Liquidation wide row: stack summary above feed, shrink columns */
  .cf-liq-wide { grid-column: 1 / -1 !important; }
  .cf-liq-row-wide { grid-template-columns: 1fr !important; gap: 10px !important; }
  .cf-liq-list-wide .cf-liq-row { grid-template-columns: 50px 50px 1fr auto !important; padding: 4px 8px !important; font-size: 10.5px !important; gap: 6px; }
  .cf-liq-list-wide .cf-liq-row .t { font-size: 9.5px !important; }
  .cf-liq-list-wide .cf-liq-row .amt { font-size: 11px !important; }

  /* Cabal tape: stack above mobile-tabs (mobile-tabs is 58px + safe-area) */
  .cf-tape { bottom: calc(58px + env(safe-area-inset-bottom)) !important; z-index: 999; }
  .cf-page { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

  #page-cabal-coins .m-cards { display: flex; }
  /* Tabs row may overflow horizontally; allow scroll */
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }

  .drawer-backdrop { background: rgba(0,0,0,.55); }
  .drawer {
    top: auto !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    width: 100% !important; max-width: 100% !important;
    height: 92dvh; border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    animation: slideup .26s ease-out forwards;
    overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
  @keyframes slideup { to { transform: translateY(0); } }
  .drawer.dragging { animation: none !important; transition: none !important; }
  .drawer-handle {
    display: block; width: 40px; height: 4px;
    margin: 8px auto 4px; border-radius: 2px;
    background: var(--ink-3); opacity: .5;
    cursor: grab; touch-action: none;
  }
  .drawer-head { padding: 10px 14px; }
  .drawer-stats { grid-template-columns: repeat(2, 1fr) !important; gap: 6px; padding: 8px 12px; }
  .drawer-section { padding: 8px 12px; }
  .drawer-section h3 { font-size: 12px; }
  .drawer-chart { height: 140px; }
  .drawer-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .btn-trade { font-size: 16px; padding: 14px; min-height: 52px; }

  input, select, textarea { font-size: 16px !important; }
  button, a.button, .star, .wpill, .filter-chip, .venue-chip, .market-pill { min-height: 36px; }
}

@media (max-width: 720px) and (orientation: landscape) {
  .drawer { height: 96dvh; }
  .ribbon { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Cabal "NEW" badge for recently added coins ---------- */
.cabal-new-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ff7a00, #ff3d6e);
  color: #fff;
  vertical-align: middle;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(255, 61, 110, 0.25), 0 2px 6px rgba(255, 61, 110, 0.35);
  animation: cabal-new-pulse 1.8s ease-in-out infinite;
}
@keyframes cabal-new-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255, 61, 110, 0.25), 0 2px 6px rgba(255, 61, 110, 0.35); }
  50% { box-shadow: 0 0 0 2px rgba(255, 122, 0, 0.35), 0 2px 12px rgba(255, 61, 110, 0.6); }
}
tr.row-new td { background: linear-gradient(90deg, rgba(255, 122, 0, 0.06), transparent 60%); }
.m-card-new { border-color: rgba(255, 61, 110, 0.4) !important; box-shadow: 0 0 0 1px rgba(255, 122, 0, 0.15); }

/* ============================================================
   PAIRS TRADING — coherent with Markets, fits 100dvh, no scroll
   ============================================================ */
.pt-page {
  --pt-mean: var(--ink-2);
  --pt-leg-a: var(--green);
  --pt-leg-b: var(--red);
  /* Lock the page to the viewport (no scroll), then let the chart flex-fill. */
  height: calc(100dvh - 96px - 28px);  /* topnav (56) + ribbon (40) + main pad-top (28) */
  max-height: calc(100dvh - 96px - 28px);
  overflow: hidden;
  padding: 0 0 8px;
  display: flex;
  flex-direction: column;
}
/* Kill main's bottom padding when pairs-trading is the active page so the chart
   has room to breathe. :has() is supported on all evergreen browsers. */
main:has(#page-pairs-trading:not([hidden])) {
  padding-bottom: 0;
  padding-top: 16px;
}
/* Hide the ribbon strip when pairs-trading is active — it eats vertical space
   without adding signal for the chart-focused view. */
body:has(#page-pairs-trading:not([hidden])) > .ribbon {
  display: none;
}
.pt-page .page-head { padding: 12px 20px 4px; }
.pt-page .page-head h1 { font-size: 22px; margin: 0; }
.pt-page .page-head p { font-size: 12px; margin: 4px 0 0; color: var(--ink-2); }
.pt-window-bar { max-width: 1600px; margin: 8px auto 10px; width: calc(100% - 40px); box-sizing: border-box; }
.pt-page .page-head { max-width: 1600px; margin: 0 auto; width: calc(100% - 40px); box-sizing: border-box; padding: 12px 0 4px; }
.pt-page .mono { font-family: 'JetBrains Mono', monospace; font-feature-settings: "ss01"; }
.pt-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 14px;
  max-width: 1640px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
}

/* ── LEFT RAIL ────────────────────────────────────────── */
.pt-rail {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.pt-rail-head {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
}
.pt-ttl { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; }
.pt-cnt { font-size: 11px; color: var(--ink-3); }
.pt-rail-search { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pt-rail-search input {
  width: 100%; height: 32px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 7px;
  color: var(--ink); padding: 0 10px; font-size: 12.5px; outline: none;
  font-family: inherit;
}
.pt-rail-search input:focus { border-color: var(--accent); }
.pt-list { flex: 1; min-height: 0; overflow-y: auto; padding: 4px; }
.pt-list::-webkit-scrollbar { width: 6px; }
.pt-list::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.pt-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px;
  padding: 9px 10px; border-radius: 7px; cursor: pointer; align-items: center;
  border: 1px solid transparent;
  transition: background .15s;
}
.pt-row:hover { background: var(--bg-3); }
.pt-row.on {
  background: var(--accent-soft);
  border-color: rgba(0,184,204,.35);
}
.pt-lbl { font-size: 12.5px; font-weight: 600; letter-spacing: -.005em; color: var(--ink); }
.pt-lbl .pt-d { color: var(--ink-3); font-weight: 400; margin: 0 3px; }
.pt-lbl .pt-a { color: var(--pt-leg-a); }
.pt-lbl .pt-b { color: var(--pt-leg-b); }
.pt-rratio { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-2); }
.pt-z {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; min-width: 52px; text-align: center;
}
.pt-z.hi { color: var(--red); background: var(--red-bg); }
.pt-z.lo { color: var(--green); background: var(--green-bg); }
.pt-z.mid { color: var(--ink-3); background: var(--bg-3); }

/* ── RIGHT MAIN ───────────────────────────────────────── */
.pt-main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-height: 0;
}

/* HERO */
.pt-hero {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
}
.pt-hero-left { min-width: 0; }
.pt-title { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.pt-legA { color: var(--pt-leg-a); }
.pt-legB { color: var(--pt-leg-b); }
.pt-div { color: var(--ink-3); font-weight: 400; }
.pt-tag {
  font-size: 9.5px; font-weight: 800; letter-spacing: .08em; color: var(--ink-3);
  background: var(--bg-3); padding: 3px 7px; border-radius: 4px;
}
.pt-sub { margin-top: 3px; font-size: 11.5px; color: var(--ink-2); }
.pt-hero-stats { display: flex; gap: 8px; }
.pt-stat {
  padding: 7px 12px; border-radius: 9px; background: var(--bg);
  border: 1px solid var(--line); min-width: 96px;
  display: flex; flex-direction: column;
}
.pt-k { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }
.pt-v { font-size: 16px; font-weight: 700; margin-top: 2px; color: var(--ink); }
.pt-stat-z { background: var(--red-bg); border-color: rgba(234,57,67,.30); }
.pt-stat-z .pt-v { color: var(--red); }
.pt-stat-z.lo { background: var(--green-bg); border-color: rgba(22,199,132,.30); }
.pt-stat-z.lo .pt-v { color: var(--green); }
.pt-stat-win { background: var(--accent-soft); border-color: rgba(0,184,204,.30); }
.pt-stat-win .pt-v { color: var(--accent); }

/* CHART CARD */
.pt-chart-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px 6px;
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.pt-chart-bar { display: flex; align-items: center; gap: 12px; padding: 0 2px 8px; flex-wrap: wrap; }
.pt-legend { margin-left: auto; display: inline-flex; gap: 12px; flex-wrap: wrap; }
.pt-leg-i { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ink-2); }
.pt-leg-i i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; }

.pt-chart-wrap {
  flex: 1 1 auto;
  min-height: 200px;
  height: auto;
  position: relative;
  overflow: hidden;
}
.pt-chart-wrap svg { display: block; width: 100%; height: 100%; }

/* REVERT GRID */
.pt-revert {
  display: grid; grid-template-columns: repeat(3, 1fr) 1.4fr;
  gap: 10px;
}
.pt-rc {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 3px;
  min-height: 90px;
}
.pt-rc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.pt-rc-mean::before { background: var(--pt-mean); }
.pt-rc-up::before   { background: var(--green); }
.pt-rc-dn::before   { background: var(--red); }
.pt-rc-leg::before  { background: linear-gradient(180deg, var(--pt-leg-a) 0%, var(--pt-leg-a) 50%, var(--pt-leg-b) 50%, var(--pt-leg-b) 100%); }
.pt-rc-k { font-size: 10px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }
.pt-rc-v { font-size: 22px; font-weight: 700; line-height: 1.05; color: var(--ink); }
.pt-rc-mean .pt-rc-v { color: var(--pt-mean); }
.pt-rc-up   .pt-rc-v { color: var(--green); }
.pt-rc-dn   .pt-rc-v { color: var(--red); }
.pt-rc-sub { font-size: 11px; color: var(--ink-2); }

/* TP tags */
.pt-tp-tag {
  display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: .04em;
  padding: 2px 5px; border-radius: 3px; margin-right: 6px; vertical-align: 1px;
  background: var(--green); color: #0a0e1a;
}
.pt-tp-tag.tp2 { background: var(--accent); }
.pt-tp-tag.tp3 { background: var(--red); color: #fff; }

/* TRADE button */
.pt-trade-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 7px 8px; margin-top: 6px;
  background: linear-gradient(135deg, #f0b90b 0%, #f8d12f 100%);
  color: #0a0e1a; font-weight: 800; font-size: 11.5px;
  letter-spacing: .08em; border: none; border-radius: 6px;
  cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  box-shadow: 0 2px 8px rgba(240,185,11,.25);
}
.pt-trade-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(240,185,11,.45); filter: brightness(1.06); }
.pt-trade-btn:active { transform: translateY(0); filter: brightness(.95); }

/* Chart hover tooltip */
.pt-tooltip {
  position: absolute; pointer-events: none; opacity: 0; transition: opacity .1s;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 10px; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--ink); white-space: nowrap; z-index: 5;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.pt-tooltip.on { opacity: 1; }
.pt-tooltip .tt-d { color: var(--ink-3); font-size: 10px; margin-bottom: 2px; }
.pt-tooltip .tt-r { color: var(--accent); font-weight: 700; }
.pt-tooltip .tt-z { color: var(--ink-2); font-size: 10px; margin-top: 2px; }

/* LEG card (combined into revert grid) */
.pt-rc-leg { padding: 8px 12px; gap: 0; }
.pt-leg-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 0;
}
.pt-leg-name { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.pt-leg-name i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.pt-leg-name.pt-leg-a i { background: var(--pt-leg-a); }
.pt-leg-name.pt-leg-b i { background: var(--pt-leg-b); }
.pt-leg-tag {
  font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); background: var(--bg-3); padding: 1px 5px; border-radius: 3px;
}
.pt-leg-px { font-size: 12px; font-weight: 700; color: var(--ink); }
.pt-leg-meta {
  display: flex; gap: 12px; padding: 1px 0 4px;
  font-size: 10.5px; color: var(--ink-2);
  border-bottom: 1px dashed var(--line);
}
.pt-leg-meta:last-of-type { border-bottom: none; padding-bottom: 0; }
.pt-leg-meta span { display: inline-flex; gap: 4px; align-items: center; }
.pt-mk { color: var(--ink-3); font-weight: 600; }
.pt-mv { font-weight: 700; color: var(--ink); }
.pt-mv.pos { color: var(--green); }
.pt-mv.neg { color: var(--red); }

/* SVG chart text uses theme colors */
.pt-page svg text { fill: var(--ink-3); }

/* Responsive */
@media (max-width: 1100px) {
  .pt-shell { grid-template-columns: 220px 1fr; }
  .pt-revert { grid-template-columns: repeat(2, 1fr); }
  .pt-rc-leg { grid-column: span 2; }
  .pt-hero-stats .pt-stat { min-width: 84px; padding: 6px 9px; }
  .pt-v { font-size: 14px; }
}
@media (max-width: 720px) {
  /* Mobile: same no-scroll rule. Rail compresses to a top strip, chart fills
     remaining space, revert collapses to a tight 3-stat row.
     Subtract topnav (56) + main pad (16) + mobile-tabs (58 + safe-area) so the
     chart-card footprint never sits under the bottom nav. */
  .pt-page {
    height: calc(100dvh - 56px - 16px - 58px - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 56px - 16px - 58px - env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    padding: 0 8px 4px;
  }
  .pt-shell { grid-template-columns: 1fr; grid-template-rows: 90px 1fr; gap: 6px; padding: 0; }
  .pt-rail { max-height: 90px; min-height: 0; }
  .pt-hero { grid-template-columns: 1fr; gap: 4px; padding: 6px 10px; }
  .pt-title { font-size: 15px; }
  .pt-hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .pt-stat { min-width: 0; padding: 4px 6px; overflow: hidden; }
  .pt-k { font-size: 8.5px; }
  .pt-stat .pt-v { font-size: 12px; }
  .pt-v { font-size: 12px; }
  .pt-chart-card { padding: 6px; }
  .pt-chart-wrap { min-height: 140px; height: auto; flex: 1 1 auto; }
  .pt-chart-wrap svg { width: 100%; height: 100%; }
  .pt-revert { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .pt-rc { padding: 5px 7px; min-height: 0; gap: 1px; }
  .pt-rc-v { font-size: 13px; }
  .pt-rc-sub { display: none; }
  .pt-rc-leg { display: none; }
  .pt-legend { display: none; }
  .pt-window-bar { width: 100%; padding: 0 4px; margin: 4px 0; gap: 6px; }
  .pt-share-btn span { display: none; }  /* keep icon only on mobile */
  .pt-share-btn { padding: 7px 10px; margin-left: 0; }
  .pt-page .page-head { width: 100%; padding: 4px 4px 0; }
  .pt-page .page-head h1 { font-size: 18px; }
  .pt-page .page-head p { display: none; }
}
/* Ultra-short viewports (e.g. iPhone SE landscape) — also drop revert subs */
@media (max-height: 700px) and (min-width: 721px) {
  .pt-rc-sub { display: none; }
  .pt-rc { min-height: 70px; }
  .pt-rc-v { font-size: 18px; }
}


/* ============ TRADE SMART page ============ */
#page-trade-smart {
  --bg: #06080b;
  --bg-2: #0b1016;
  --bg-3: #10171f;
  --ink: #e9eff4;
  --ink-2: #9fb0bc;
  --ink-3: #6f828f;
  --line: #1b2530;
  --line-2: #2a3947;
  --accent: #00d4ff;
  --green: #00ff9c;
  --ts-panel: #0b1016;
  --ts-panel-2: #10171f;
  --ts-line: #2a3947;
  --ts-muted: #6f828f;
  --ts-cyan: #00d4ff;
  --ts-green: #00ff9c;
  --ts-red: #ff4d67;
  --ts-mx: 50%;
  --ts-my: 18%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: calc(100dvh - 96px);
  padding: 30px clamp(16px, 4vw, 48px) 48px;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(0, 212, 255, .07), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(0, 255, 156, .045), transparent 55%),
    #06080b;
}
[data-theme="light"] #page-trade-smart {
  --bg: #f7fbff;
  --bg-2: #eef7fb;
  --bg-3: #e5f0f6;
  --ink: #071421;
  --ink-2: #4b6474;
  --ink-3: #78909f;
  --line: #d7e6ef;
  --line-2: #b9cfdd;
  --ts-panel: rgba(255, 255, 255, .82);
  --ts-panel-2: rgba(238, 247, 251, .92);
  --ts-line: #c7dce8;
  --ts-muted: #6f8796;
  --ts-cyan: #00a8d8;
  --ts-green: #00b878;
  --ts-red: #d9304f;
  background:
    radial-gradient(980px 560px at 78% -14%, rgba(0, 168, 216, .18), transparent 62%),
    radial-gradient(760px 460px at -4% 88%, rgba(0, 184, 120, .12), transparent 58%),
    linear-gradient(180deg, #fafdff 0%, #edf8fb 46%, #f8fbfd 100%);
  color: var(--ink);
}
#page-trade-smart::before,
#page-trade-smart::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
#page-trade-smart::before {
  background:
    radial-gradient(440px circle at var(--ts-mx) var(--ts-my), rgba(0, 212, 255, .16), transparent 58%),
    radial-gradient(620px circle at calc(var(--ts-mx) + 90px) calc(var(--ts-my) + 70px), rgba(0, 255, 156, .09), transparent 62%);
  opacity: .92;
  transition: opacity .18s ease;
}
[data-theme="light"] #page-trade-smart::before {
  background:
    radial-gradient(440px circle at var(--ts-mx) var(--ts-my), rgba(0, 168, 216, .16), transparent 58%),
    radial-gradient(620px circle at calc(var(--ts-mx) + 90px) calc(var(--ts-my) + 70px), rgba(0, 184, 120, .11), transparent 62%);
  opacity: .82;
}
#page-trade-smart::after {
  background:
    linear-gradient(rgba(255,255,255,.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-position: 0 0, 0 0;
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at var(--ts-mx) var(--ts-my), #000 0, transparent 58%);
  opacity: .34;
  animation: ts-grid-drift 18s linear infinite;
}
[data-theme="light"] #page-trade-smart::after {
  background:
    linear-gradient(rgba(0, 66, 92, .052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 66, 92, .044) 1px, transparent 1px);
  opacity: .32;
}
#page-trade-smart > * {
  position: relative;
  z-index: 1;
}
#page-trade-smart .ts-bonus {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: 18px;
  align-items: stretch;
  width: min(1450px, 100%);
  margin: 0 auto;
}
#page-trade-smart .ts-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ts-line);
  border-radius: 16px;
  background:
    radial-gradient(760px 420px at 90% -10%, color-mix(in srgb, var(--ts-cyan) 11%, transparent), transparent 62%),
    linear-gradient(180deg, var(--ts-panel), var(--ts-panel-2));
  box-shadow: 0 18px 60px color-mix(in srgb, #000 22%, transparent);
  transform: perspective(1000px) rotateX(var(--ts-tilt-y, 0deg)) rotateY(var(--ts-tilt-x, 0deg));
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  will-change: transform;
}
[data-theme="light"] #page-trade-smart .ts-panel {
  background:
    radial-gradient(760px 420px at 90% -10%, color-mix(in srgb, var(--ts-cyan) 13%, transparent), transparent 62%),
    linear-gradient(180deg, var(--ts-panel), var(--ts-panel-2));
  box-shadow: 0 18px 58px rgba(15, 73, 98, .12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
#page-trade-smart .ts-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(380px circle at var(--ts-local-x, 50%) var(--ts-local-y, 0%), rgba(255,255,255,.11), transparent 54%);
  opacity: var(--ts-hot, .18);
  transition: opacity .18s ease;
}
[data-theme="light"] #page-trade-smart .ts-panel::before {
  background: radial-gradient(380px circle at var(--ts-local-x, 50%) var(--ts-local-y, 0%), rgba(0, 168, 216, .12), transparent 56%);
  opacity: var(--ts-hot, .14);
}
#page-trade-smart .ts-panel > * {
  position: relative;
  z-index: 1;
}
#page-trade-smart .ts-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--ts-muted);
  text-transform: uppercase;
}
#page-trade-smart .ts-live {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ts-green);
}
#page-trade-smart .ts-live i,
#page-trade-smart .ts-eyebrow i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ts-green);
  box-shadow: 0 0 16px color-mix(in srgb, var(--ts-green) 60%, transparent);
}
#page-trade-smart .ts-readout-body {
  padding: 30px 28px 26px;
}
#page-trade-smart .ts-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid color-mix(in srgb, var(--ts-cyan) 38%, transparent);
  border-radius: 999px;
  padding: 6px 13px;
  background: color-mix(in srgb, var(--ts-cyan) 7%, transparent);
  color: var(--ts-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
#page-trade-smart .ts-readout h1 {
  margin: 20px 0 10px;
  color: var(--ink);
  font-size: clamp(34px, 4.6vw, 56px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.04em;
  max-width: 780px;
}
#page-trade-smart .ts-readout h1 em {
  color: var(--ts-cyan);
  font-style: normal;
}
#page-trade-smart .ts-readout p {
  margin: 0 0 24px;
  max-width: 560px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.55;
}
#page-trade-smart .ts-bonus-box {
  display: block;
  position: relative;
  overflow: hidden;
  max-width: 540px;
  border: 1px solid var(--ts-line);
  border-radius: 13px;
  padding: 18px 20px;
  color: inherit;
  text-decoration: none;
  background:
    radial-gradient(130% 140% at 100% 0%, color-mix(in srgb, var(--ts-green) 8%, transparent), transparent 58%),
    color-mix(in srgb, var(--bg) 82%, transparent);
  cursor: pointer;
  transform: translate3d(0, var(--ts-hover-y, 0), 0) perspective(900px) rotateX(var(--ts-tilt-y, 0deg)) rotateY(var(--ts-tilt-x, 0deg));
  transition: border-color .15s, box-shadow .15s, transform .15s;
  will-change: transform;
}
[data-theme="light"] #page-trade-smart .ts-bonus-box {
  background:
    radial-gradient(130% 140% at 100% 0%, color-mix(in srgb, var(--ts-green) 12%, transparent), transparent 58%),
    rgba(255, 255, 255, .74);
}
#page-trade-smart .ts-bonus-box::before,
#page-trade-smart .ts-step::before,
#page-trade-smart .ts-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(220px circle at var(--ts-local-x, 50%) var(--ts-local-y, 50%), rgba(255,255,255,.13), transparent 56%);
  opacity: var(--ts-hot, 0);
  transition: opacity .16s ease;
}
[data-theme="light"] #page-trade-smart .ts-bonus-box::before,
[data-theme="light"] #page-trade-smart .ts-step::before,
[data-theme="light"] #page-trade-smart .ts-primary::before {
  background: radial-gradient(220px circle at var(--ts-local-x, 50%) var(--ts-local-y, 50%), rgba(0, 168, 216, .14), transparent 56%);
}
#page-trade-smart .ts-bonus-box > *,
#page-trade-smart .ts-step > *,
#page-trade-smart .ts-primary > * {
  position: relative;
  z-index: 1;
}
#page-trade-smart .ts-bonus-box:hover,
#page-trade-smart .ts-bonus-box:focus-visible {
  --ts-hover-y: -1px;
  --ts-hot: .95;
  border-color: color-mix(in srgb, var(--ts-green) 48%, var(--ts-line));
  box-shadow: 0 18px 42px color-mix(in srgb, var(--ts-green) 10%, transparent);
}
#page-trade-smart .ts-bonus-box:focus-visible {
  outline: 2px solid var(--ts-cyan);
  outline-offset: 3px;
}
#page-trade-smart .ts-bonus-top,
#page-trade-smart .ts-fill-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ts-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
#page-trade-smart .ts-bignum {
  margin: 6px 0 8px;
  color: var(--ts-green);
  font-size: clamp(72px, 10vw, 116px);
  font-weight: 900;
  line-height: .92;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
}
#page-trade-smart .ts-bignum span {
  color: var(--ink);
  font-size: .42em;
  vertical-align: .58em;
  margin-right: 2px;
}
#page-trade-smart .ts-fill {
  height: 7px;
  border: 1px solid color-mix(in srgb, var(--ts-green) 20%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ts-green) 9%, #06110d);
  overflow: hidden;
  margin: 14px 0 8px;
}
#page-trade-smart .ts-fill i {
  display: block;
  width: 78%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ts-green) 55%, #0a9c63), var(--ts-green));
}
#page-trade-smart .ts-ticket {
  display: flex;
  flex-direction: column;
}
#page-trade-smart .ts-ticket-body {
  padding: 8px 18px 0;
  flex: 1;
}
#page-trade-smart .ts-step {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px dashed var(--line);
  border-radius: 10px;
}
#page-trade-smart .ts-step:last-of-type { border-bottom: 0; }
#page-trade-smart .ts-idx {
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--ts-cyan) 40%, transparent);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--ts-cyan) 7%, transparent);
  color: var(--ts-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 800;
}
#page-trade-smart .ts-step h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
#page-trade-smart .ts-step p {
  margin: 3px 0 0;
  color: var(--ts-muted);
  font-size: 12.5px;
  line-height: 1.5;
}
#page-trade-smart .ts-uid-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
#page-trade-smart .ts-uid-row input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--ts-line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--bg) 90%, #03080c);
  color: var(--ink);
  padding: 11px 13px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
[data-theme="light"] #page-trade-smart .ts-uid-row input {
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
}
#page-trade-smart .ts-uid-row input#ts-okx-uid { flex: .75 1 140px; }
#page-trade-smart .ts-uid-row input#ts-telegram { flex: 1 1 170px; }
#page-trade-smart .ts-uid-row input:focus {
  outline: none;
  border-color: var(--ts-cyan);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ts-cyan) 14%, transparent);
}
#page-trade-smart .ts-uid-row input.is-invalid {
  border-color: var(--ts-red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ts-red) 14%, transparent);
}
#page-trade-smart .ts-uid-row button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  background: var(--ts-green);
  color: #021016;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 900;
  cursor: pointer;
}
#page-trade-smart .ts-uid-row button:disabled {
  cursor: default;
  opacity: .72;
}
#page-trade-smart .ts-uid-note {
  min-height: 16px;
  margin-top: 9px;
  color: var(--ts-muted);
  font-size: 11px;
}
#page-trade-smart .ts-uid-note.ok { color: var(--ts-green); }
#page-trade-smart .ts-uid-note.err { color: var(--ts-red); }
#page-trade-smart .ts-perks {
  border-top: 1px solid var(--line);
  margin: 4px -18px 0;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#page-trade-smart .ts-perks div {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 13px;
}
#page-trade-smart .ts-perks span {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--ts-green) 15%, transparent);
  color: var(--ts-green);
  font-size: 11px;
  flex: 0 0 auto;
}
#page-trade-smart .ts-ticket-foot {
  border-top: 1px solid var(--line);
  padding: 14px 18px 16px;
}
#page-trade-smart .ts-primary {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 48px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: var(--ts-cyan);
  color: #021016;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .02em;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ts-cyan) 45%, transparent), 0 14px 36px -16px var(--ts-cyan);
  transform: translate3d(0, var(--ts-hover-y, 0), 0) perspective(900px) rotateX(var(--ts-tilt-y, 0deg)) rotateY(var(--ts-tilt-x, 0deg));
  transition: transform .15s, box-shadow .15s;
  will-change: transform;
}
[data-theme="light"] #page-trade-smart .ts-primary {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ts-cyan) 38%, transparent), 0 15px 34px -18px rgba(0, 168, 216, .92);
}
#page-trade-smart .ts-primary:hover {
  --ts-hover-y: -1px;
  --ts-hot: .95;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ts-cyan) 65%, transparent), 0 18px 42px -16px var(--ts-cyan);
}
#page-trade-smart .ts-ref {
  margin-top: 10px;
  color: var(--ts-muted);
  font-size: 11px;
  text-align: center;
}
#page-trade-smart .ts-ref b {
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .08em;
}
#page-trade-smart .ts-foot {
  width: min(1450px, 100%);
  margin: 12px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--ts-muted);
  font-size: 11px;
  line-height: 1.5;
}
@keyframes ts-grid-drift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 46px 23px, 23px 46px; }
}

/* ============ Hidden Trade Smart admin page ============ */
#page-trade-smart-julien {
  --tsa-bg: #06080b;
  --tsa-panel: #0b1016;
  --tsa-panel-2: #101820;
  --tsa-line: #263544;
  --tsa-ink: #eaf6ff;
  --tsa-muted: #7c8c9a;
  --tsa-cyan: #00d4ff;
  --tsa-green: #00ff9c;
  --tsa-red: #ff4d67;
  min-height: calc(100vh - 132px);
  padding: 22px;
  border: 1px solid #1b2530;
  border-radius: 18px;
  background:
    radial-gradient(900px 520px at 85% -10%, color-mix(in srgb, var(--tsa-cyan) 12%, transparent), transparent 65%),
    linear-gradient(180deg, var(--tsa-bg), #05070a 72%);
  color: var(--tsa-ink);
}
#page-trade-smart-julien .ts-admin-shell { max-width: 1180px; margin: 0 auto; }
#page-trade-smart-julien .ts-admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
#page-trade-smart-julien .ts-admin-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--tsa-cyan);
  font: 800 12px JetBrains Mono, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
}
#page-trade-smart-julien h1 {
  margin: 0;
  color: var(--tsa-ink);
  font-size: 34px;
  line-height: 1.05;
}
#page-trade-smart-julien p {
  max-width: 620px;
  margin: 10px 0 0;
  color: var(--tsa-muted);
}
#page-trade-smart-julien .ts-admin-login,
#page-trade-smart-julien .ts-admin-board {
  border: 1px solid var(--tsa-line);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--tsa-panel), var(--tsa-panel-2));
  box-shadow: 0 18px 60px color-mix(in srgb, #000 24%, transparent);
}
#page-trade-smart-julien .ts-admin-login {
  max-width: 520px;
  padding: 18px;
}
#page-trade-smart-julien label {
  display: block;
  margin-bottom: 8px;
  color: var(--tsa-muted);
  font: 800 11px JetBrains Mono, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}
#page-trade-smart-julien .ts-admin-login-row {
  display: flex;
  gap: 8px;
}
#page-trade-smart-julien input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--tsa-line);
  border-radius: 10px;
  background: #071018;
  color: var(--tsa-ink);
  padding: 12px 13px;
  font-size: 14px;
}
#page-trade-smart-julien input:focus {
  outline: none;
  border-color: var(--tsa-cyan);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tsa-cyan) 14%, transparent);
}
#page-trade-smart-julien button {
  border: 0;
  border-radius: 10px;
  background: var(--tsa-green);
  color: #03120c;
  padding: 0 15px;
  font-weight: 900;
  cursor: pointer;
}
#page-trade-smart-julien button:disabled {
  cursor: default;
  opacity: .5;
}
#page-trade-smart-julien .ts-admin-export {
  min-height: 42px;
  background: var(--tsa-cyan);
  color: #031018;
}
#page-trade-smart-julien .ts-admin-status {
  min-height: 18px;
  margin-top: 10px;
  color: var(--tsa-muted);
  font-size: 12px;
}
#page-trade-smart-julien .ts-admin-status.err { color: var(--tsa-red); }
#page-trade-smart-julien .ts-admin-status.ok { color: var(--tsa-green); }
#page-trade-smart-julien .ts-admin-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--tsa-line);
  color: var(--tsa-muted);
  font-size: 12px;
}
#page-trade-smart-julien .ts-admin-table-wrap {
  overflow: auto;
  max-height: 68vh;
}
#page-trade-smart-julien .ts-admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12px;
}
#page-trade-smart-julien th,
#page-trade-smart-julien td {
  padding: 11px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--tsa-line) 72%, transparent);
  text-align: left;
  vertical-align: top;
}
#page-trade-smart-julien th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #0b1016;
  color: var(--tsa-muted);
  font: 800 11px JetBrains Mono, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
#page-trade-smart-julien td:first-child {
  color: var(--tsa-green);
  font: 800 13px JetBrains Mono, monospace;
  white-space: nowrap;
}
#page-trade-smart-julien .tsa-muted-cell {
  color: var(--tsa-muted);
  max-width: 340px;
  overflow-wrap: anywhere;
}
@media (max-width: 900px) {
  #page-trade-smart .ts-bonus { grid-template-columns: 1fr; }
  #page-trade-smart .ts-readout-body { padding: 24px 20px; }
  #page-trade-smart .ts-ticket-body { padding: 8px 16px 0; }
  #page-trade-smart .ts-foot { flex-direction: column; gap: 6px; }
}
@media (max-width: 720px) {
  #page-trade-smart {
    min-height: calc(100dvh - 110px);
    padding: 14px 10px calc(78px + env(safe-area-inset-bottom));
    background:
      radial-gradient(760px 420px at 70% -6%, rgba(0, 212, 255, .085), transparent 62%),
      radial-gradient(640px 440px at 0% 48%, rgba(0, 255, 156, .052), transparent 62%),
      #06080b;
  }
  #page-trade-smart::before {
    background:
      radial-gradient(340px circle at 50% 10%, rgba(0, 212, 255, .12), transparent 60%),
      radial-gradient(460px circle at 12% 42%, rgba(0, 255, 156, .06), transparent 64%);
  }
  #page-trade-smart::after {
    background-size: 34px 34px;
    opacity: .24;
    mask-image: linear-gradient(#000, transparent 72%);
  }
  #page-trade-smart .ts-bonus { gap: 12px; }
  #page-trade-smart .ts-panel {
    border-radius: 13px;
    box-shadow: 0 14px 42px color-mix(in srgb, #000 26%, transparent);
  }
  #page-trade-smart .ts-panel-head {
    padding: 10px 14px;
    font-size: 10px;
    letter-spacing: .14em;
  }
  #page-trade-smart .ts-readout-body { padding: 18px 20px 20px; }
  #page-trade-smart .ts-eyebrow {
    padding: 6px 12px;
    font-size: 10px;
    letter-spacing: .16em;
  }
  #page-trade-smart .ts-readout h1 {
    margin: 16px 0 10px;
    font-size: clamp(31px, 9.4vw, 39px);
    line-height: 1.04;
    max-width: 360px;
  }
  #page-trade-smart .ts-readout p {
    margin-bottom: 18px;
    max-width: 330px;
    font-size: 14px;
    line-height: 1.5;
  }
  #page-trade-smart .ts-bonus-box {
    width: 100%;
    max-width: none;
    padding: 15px 16px 16px;
  }
  #page-trade-smart .ts-bignum {
    margin: 8px 0 10px;
    font-size: clamp(76px, 23vw, 96px);
  }
  #page-trade-smart .ts-bonus-top,
  #page-trade-smart .ts-fill-labels {
    font-size: 9.5px;
    letter-spacing: .13em;
  }
  #page-trade-smart .ts-ticket-body { padding: 6px 14px 0; }
  #page-trade-smart .ts-step {
    gap: 11px;
    padding: 13px 2px;
    border-radius: 9px;
  }
  #page-trade-smart .ts-idx {
    width: 29px;
    height: 29px;
    border-radius: 8px;
  }
  #page-trade-smart .ts-step h2 { font-size: 14.5px; }
  #page-trade-smart .ts-step p { font-size: 12.5px; }
  #page-trade-smart .ts-uid-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }
  #page-trade-smart .ts-uid-row input,
  #page-trade-smart .ts-uid-row input#ts-okx-uid,
  #page-trade-smart .ts-uid-row input#ts-telegram,
  #page-trade-smart .ts-uid-row button {
    width: 100%;
    flex: none;
    min-height: 42px;
  }
  #page-trade-smart .ts-perks {
    margin-top: 0;
    padding: 13px 14px;
    gap: 8px;
  }
  #page-trade-smart .ts-ticket-foot { padding: 13px 14px 15px; }
  #page-trade-smart .ts-primary { min-height: 46px; font-size: 13px; }
  #page-trade-smart .ts-foot {
    margin-top: 10px;
    padding: 0 2px;
    font-size: 10.5px;
  }
}
@media (max-width: 760px) {
  #page-trade-smart-julien { padding: 16px; }
  #page-trade-smart-julien .ts-admin-head { align-items: stretch; flex-direction: column; }
  #page-trade-smart-julien .ts-admin-login-row { flex-direction: column; }
  #page-trade-smart-julien button { min-height: 42px; }
}
@media (max-width: 560px) {
  #page-trade-smart .ts-readout h1 { font-size: clamp(30px, 9.1vw, 36px); }
  #page-trade-smart .ts-bignum { font-size: clamp(72px, 22vw, 88px); }
  #page-trade-smart .ts-readout-body { padding-inline: 18px; }
  #page-trade-smart .ts-fill-labels { gap: 8px; }
}
@media (max-width: 370px) {
  #page-trade-smart { padding-inline: 8px; }
  #page-trade-smart .ts-readout-body { padding: 16px 16px 18px; }
  #page-trade-smart .ts-readout h1 { font-size: 28px; }
  #page-trade-smart .ts-readout p { font-size: 13px; }
  #page-trade-smart .ts-bignum { font-size: 68px; }
  #page-trade-smart .ts-bonus-top,
  #page-trade-smart .ts-fill-labels { font-size: 8.5px; }
}
@media (hover: none), (max-width: 760px), (prefers-reduced-motion: reduce) {
  #page-trade-smart {
    --ts-mx: 50%;
    --ts-my: 18%;
  }
  #page-trade-smart::before,
  #page-trade-smart::after {
    transition: none;
  }
  #page-trade-smart .ts-panel,
  #page-trade-smart .ts-bonus-box,
  #page-trade-smart .ts-primary {
    transform: none;
    transition: border-color .15s ease, box-shadow .15s ease;
    will-change: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  #page-trade-smart::after {
    animation: none;
  }
}

/* ─── Telegram CTA chip ────────────────────────────────────────────────────
   Reusable inline pill linking to the Telegram group. Sits in page headers
   under the subtitle/disclaimer (Binance Cabal, Cabal Coin List). Telegram-
   brand gradient with hover lift. */
.tg-cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 14px 8px 10px;
  margin-top: 12px;
  border-radius: 10px;
  text-decoration: none; color: #fff;
  font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 500;
  background: linear-gradient(135deg, #229ED9 0%, #1B8AC0 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 2px 6px rgba(0,0,0,.15);
  transition: transform .15s ease, box-shadow .15s ease;
  max-width: 100%;
}
.tg-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 6px 18px rgba(34,158,217,.5);
}
.tg-cta-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border-radius: 7px;
  background: rgba(255,255,255,.18);
  flex-shrink: 0;
}
.tg-cta-ico svg { width: 16px; height: 16px; }
.tg-cta-msg { line-height: 1.3; color: rgba(255,255,255,.92); }
.tg-cta-msg b { font-weight: 700; color: #fff; margin-right: 4px; }
.tg-cta-btn {
  display: inline-flex; align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: #fff; font-weight: 700; font-size: 12px;
  white-space: nowrap;
  transition: background .15s ease;
}
.tg-cta:hover .tg-cta-btn { background: rgba(255,255,255,.32); }
@media (max-width: 720px) {
  .tg-cta { gap: 9px; padding: 7px 10px 7px 8px; font-size: 11.5px; }
  .tg-cta-ico { width: 22px; height: 22px; }
  .tg-cta-msg b { display: block; margin-right: 0; }
  .tg-cta-btn { padding: 4px 9px; font-size: 11px; }
}

/* ─── Liquidations page ────────────────────────────────────────────────── */
.liq-page .page-head { margin-bottom: 12px; }
.liq-page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
/* Liquidations share button — reuses the cabal cf-share-btn visual identity */
.liq-share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 10px; padding: 7px 14px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .06em;
  color: #0a0e1a; background: linear-gradient(135deg, #00d4ff 0%, #00b8cc 100%);
  border: none; border-radius: 6px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,212,255,.25);
  transition: transform .12s, box-shadow .12s, filter .12s;
  flex-shrink: 0;
}
.liq-share-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,212,255,.45); filter: brightness(1.06); }
.liq-share-btn:active { transform: translateY(0); }
.liq-page .page-head .sub { color: var(--cf-ink-3, var(--ink-3)); font-size: 13px; max-width: 900px; }
.liq-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.liq-hero {
  grid-column: span 12;
  background: var(--cf-bg-2, var(--bg-2));
  border: 1px solid var(--cf-line, var(--line));
  border-radius: 14px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.liq-hero-stats {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 12px;
}
.liq-stat {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--cf-bg-3, var(--bg-3));
  border: 1px solid transparent;
  position: relative; overflow: hidden;
  transition: border-color .15s;
}
.liq-stat .liq-l { font-size: 10px; letter-spacing: .8px; color: var(--cf-ink-3, var(--ink-3)); font-weight: 700; }
.liq-stat .liq-v { font-size: 26px; font-weight: 800; font-family: 'JetBrains Mono', monospace; line-height: 1.1; }
.liq-stat .liq-sub { font-size: 11px; color: var(--cf-ink-3, var(--ink-3)); font-weight: 600; }
.liq-stat .liq-sub.long-heavy { color: #ef4444; }
.liq-stat .liq-sub.short-heavy { color: #22c55e; }
.liq-stat-tot .liq-v { color: var(--cf-ink, var(--ink)); }
.liq-stat-long .liq-l, .liq-stat-long .liq-v { color: #ef4444; }
.liq-stat-short .liq-l, .liq-stat-short .liq-v { color: #22c55e; }
.liq-stat-meta .liq-v { color: var(--cf-ink-2, var(--ink-2)); font-size: 22px; }

/* Flash on new event — reuse keyframes from cabal page */
#liq-long-cell.flash-l, #liq-long-cell.flash-l-big { animation: cf-liq24h-pulse-l 1.1s ease-out 2; }
#liq-short-cell.flash-s, #liq-short-cell.flash-s-big { animation: cf-liq24h-pulse-s 1.1s ease-out 2; }
#liq-long-cell.flash-l-big { animation-iteration-count: 3; box-shadow: 0 0 36px rgba(234,57,67,.85); }
#liq-short-cell.flash-s-big { animation-iteration-count: 3; box-shadow: 0 0 36px rgba(22,199,132,.85); }

.liq-split {
  display: flex; height: 6px; border-radius: 4px; overflow: hidden;
  background: var(--cf-bg-3, var(--bg-3));
}
.liq-bar-l { display: block; height: 100%; background: linear-gradient(90deg, #ef4444, #b91c1c); transition: width .4s ease; }
.liq-bar-s { display: block; height: 100%; background: linear-gradient(90deg, #16a34a, #22c55e); transition: width .4s ease; }

.liq-card {
  background: var(--cf-bg-2, var(--bg-2));
  border: 1px solid var(--cf-line, var(--line));
  border-radius: 14px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0; min-height: 0;
}
.liq-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.liq-card-name { font-size: 11px; letter-spacing: .8px; font-weight: 700; color: var(--cf-ink-2, var(--ink-2)); }
.liq-card-sub { font-size: 10.5px; color: var(--cf-ink-3, var(--ink-3)); font-weight: 600; }

.liq-pulse { grid-column: span 12; }
.liq-pulse-chart { width: 100%; height: 200px; }
.liq-pulse-chart svg { width: 100%; height: 100%; display: block; }
.liq-pulse-chart .liq-ax {
  fill: var(--cf-ink-3, var(--ink-3));
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

.liq-pairs { grid-column: span 8; }
.liq-whales { grid-column: span 4; }
.liq-feed { grid-column: span 12; }

.liq-table-wrap { overflow-x: auto; max-height: 540px; overflow-y: auto; }
.liq-table { width: 100%; border-collapse: collapse; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.liq-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--cf-bg-2, var(--bg-2));
  text-align: left;
  font-size: 10px; letter-spacing: .6px;
  color: var(--cf-ink-3, var(--ink-3));
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 1px solid var(--cf-line, var(--line));
  cursor: pointer;
  user-select: none;
}
.liq-table thead th.liq-num { text-align: right; }
.liq-table thead th.liq-sort:hover { color: var(--cf-ink-2, var(--ink-2)); }
.liq-table thead th.liq-sort.on { color: var(--accent-2, #00d4ff); }
.liq-table thead th.liq-sort.on::after { content: ' ▼'; font-size: 9px; }
.liq-table thead th.liq-sort.on.asc::after { content: ' ▲'; }
.liq-table tbody tr {
  cursor: pointer;
  border-bottom: 1px solid var(--cf-line, var(--line));
  transition: background .12s;
}
.liq-table tbody tr:hover { background: var(--cf-bg-3, var(--bg-3)); }
.liq-table td { padding: 7px 10px; vertical-align: middle; }
.liq-table .liq-num { text-align: right; }
.liq-table .liq-rank { color: var(--cf-ink-3, var(--ink-3)); font-weight: 700; width: 32px; }
.liq-table .liq-pair { display: flex; flex-direction: column; gap: 1px; }
.liq-table .liq-pair .liq-base { font-weight: 800; color: var(--cf-ink, var(--ink)); }
.liq-table .liq-pair .liq-share { font-size: 10px; color: var(--cf-ink-3, var(--ink-3)); font-weight: 600; }
.liq-table .liq-total { font-weight: 800; }
.liq-table .liq-total.long-heavy { color: #ef4444; }
.liq-table .liq-total.short-heavy { color: #22c55e; }
.liq-table .liq-long { color: #ef4444; }
.liq-table .liq-short { color: #22c55e; }
.liq-table .liq-biggest { color: var(--cf-ink-2, var(--ink-2)); }

.liq-whale-list { display: flex; flex-direction: column; gap: 4px; max-height: 540px; overflow-y: auto; }
.liq-whale-row {
  display: grid;
  grid-template-columns: 6px 60px 50px 1fr auto 36px;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 7px;
  background: var(--cf-bg-3, var(--bg-3));
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  text-decoration: none;
  color: var(--cf-ink, var(--ink));
  transition: background .12s;
}
.liq-whale-row:hover { background: var(--cf-bg-4, var(--bg-4, #1a1f2e)); }
.liq-whale-dot { width: 6px; height: 6px; border-radius: 50%; }
.liq-whale-row.l .liq-whale-dot { background: #ef4444; }
.liq-whale-row.s .liq-whale-dot { background: #22c55e; }
.liq-whale-pair { font-weight: 800; }
.liq-whale-side { font-size: 9.5px; font-weight: 700; letter-spacing: .5px; color: var(--cf-ink-3, var(--ink-3)); }
.liq-whale-row.l .liq-whale-side { color: #ef4444; }
.liq-whale-row.s .liq-whale-side { color: #22c55e; }
.liq-whale-amt { font-weight: 800; }
.liq-whale-row.l .liq-whale-amt { color: #ef4444; }
.liq-whale-row.s .liq-whale-amt { color: #22c55e; }
.liq-whale-px { color: var(--cf-ink-3, var(--ink-3)); font-size: 10.5px; }
.liq-whale-ago { color: var(--cf-ink-3, var(--ink-3)); font-size: 10px; text-align: right; }

.liq-feed-list { display: flex; flex-direction: column; gap: 4px; max-height: 460px; overflow-y: auto; }
.liq-feed-row { text-decoration: none; color: var(--cf-ink, var(--ink)); }
.liq-feed-row .liq-feed-pair { color: var(--cf-ink-2, var(--ink-2)); }
.liq-feed-row .liq-feed-pair b { color: var(--cf-ink, var(--ink)); margin-right: 4px; font-weight: 800; }

.liq-empty {
  padding: 30px 12px; text-align: center;
  color: var(--cf-ink-3, var(--ink-3));
  font-size: 12px;
  letter-spacing: .5px;
}

@media (max-width: 980px) {
  .liq-hero-stats { grid-template-columns: 1fr 1fr; }
  .liq-pairs, .liq-whales, .liq-feed, .liq-pulse { grid-column: span 12; }
  .liq-pulse-chart { height: 160px; }
}
@media (max-width: 560px) {
  .liq-hero-stats { grid-template-columns: 1fr; }
  .liq-stat .liq-v { font-size: 22px; }
  .liq-table { font-size: 11px; }
  .liq-table td { padding: 6px 8px; }
}

/* ─── Cabal: bigger CVD + new VPIN wide + augmented Liquidations ────────── */
/* Bigger CVD headline (was 23px via .cf-big; the .lg variant is 28px) */
.cf-big.lg { font-size: 28px; }
.cf-chart.cf-chart-lg { min-height: 160px; }

/* VPIN wide card */
.cf-vpin-wide .cf-head { gap: 12px; }
.cf-vpin-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  align-items: stretch;
  min-height: 0;
}
.cf-vpin-left { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cf-vpin-lbl { font-size: 10px; letter-spacing: .08em; color: var(--cf-ink-3, var(--ink-3)); font-weight: 700; }
.cf-vpin-big { font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -.02em; color: var(--cf-amber, #f59e0b); }
.cf-vpin-big.calm { color: var(--cf-green-2, #22c55e); }
.cf-vpin-big.toxic { color: var(--cf-red-2, #ef4444); }
.cf-vpin-sub { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; color: var(--cf-ink-2, var(--ink-2)); margin-bottom: 6px; }
.cf-vpin-buysell { display: flex; gap: 16px; font-size: 11px; color: var(--cf-ink-3, var(--ink-3)); font-weight: 600; }
.cf-vpin-buysell .cf-vpin-bs-cell b { font-family: 'JetBrains Mono', monospace; font-weight: 700; margin-left: 4px; }

.cf-vpin-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cf-vpin-chart-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10px; letter-spacing: .08em; font-weight: 700;
  color: var(--cf-ink-3, var(--ink-3));
}
.cf-chart.cf-vpin-chart { min-height: 240px; }
/* Threshold band fills inside the VPIN SVG */
.cf-vpin-band-calm { fill: #22c55e; opacity: 0.05; }
.cf-vpin-band-elev { fill: #f59e0b; opacity: 0.08; }
.cf-vpin-band-toxic { fill: #ef4444; opacity: 0.07; }
.cf-vpin-thresh { stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.cf-vpin-line { fill: none; stroke: #00d4ff; stroke-width: 1.6; }
.cf-vpin-area { fill: url(#cfVpinGrad); opacity: .55; }
.cf-vpin-now-dot { stroke: var(--cf-bg-1, var(--bg-1, #0f1626)); stroke-width: 2; }
.cf-vpin-band-lbl { font-family: 'JetBrains Mono', monospace; font-size: 9px; font-weight: 700; letter-spacing: .06em; }

/* Augmented liquidations card */
.cf-liq-grid {
  display: grid;
  grid-template-columns: 1.0fr 1.4fr 1.0fr;
  gap: 14px;
  margin-bottom: 12px;
}
.cf-liq-cell {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--cf-line, var(--line));
  border-radius: 10px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0; min-height: 0;
}
.cf-liq-cell-head {
  font-size: 10px; letter-spacing: .08em; font-weight: 700;
  color: var(--cf-ink-3, var(--ink-3));
}
.cf-liq-pulse { width: 100%; height: 130px; position: relative; }
.cf-liq-pulse svg { width: 100%; height: 100%; display: block; }
.cf-liq-pulse-ax { fill: var(--cf-ink-3, var(--ink-3)); font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 600; }

.cf-liq-biggest { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; max-height: 200px; }
.cf-liq-biggest-row {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--cf-bg-3, var(--bg-3));
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.cf-liq-biggest-row .dot { width: 6px; height: 6px; border-radius: 50%; }
.cf-liq-biggest-row.l .dot { background: #ef4444; }
.cf-liq-biggest-row.s .dot { background: #22c55e; }
.cf-liq-biggest-row .meta { color: var(--cf-ink-2, var(--ink-2)); display: flex; gap: 8px; min-width: 0; }
.cf-liq-biggest-row .meta b { color: var(--cf-ink, var(--ink)); font-weight: 800; }
.cf-liq-biggest-row .meta .side { font-size: 9.5px; letter-spacing: .04em; color: var(--cf-ink-3, var(--ink-3)); font-weight: 700; }
.cf-liq-biggest-row.l .meta .side { color: #ef4444; }
.cf-liq-biggest-row.s .meta .side { color: #22c55e; }
.cf-liq-biggest-row .amt { font-weight: 800; }
.cf-liq-biggest-row.l .amt { color: #ef4444; }
.cf-liq-biggest-row.s .amt { color: #22c55e; }
.cf-liq-biggest-empty {
  padding: 16px 8px; text-align: center;
  color: var(--cf-ink-3, var(--ink-3));
  font-size: 11px; letter-spacing: .04em;
}

.cf-liq-feed-wrap { margin-top: 6px; }

@media (max-width: 980px) {
  .cf-vpin-body { grid-template-columns: 1fr; }
  .cf-liq-grid { grid-template-columns: 1fr; }
  .cf-chart.cf-vpin-chart { min-height: 200px; }
}
