/* Cheetah Trenches dashboard — two professional palettes (Amber / Slate),
   switchable via the sidebar pill. Amber (default) is a warm graphite/gold
   terminal look; Slate is a cool neutral slate/indigo alternate. */

:root {
  /* Graphite + Amber — professional default palette */
  --bg:        #0c0c0e;
  --bg-2:      #111114;
  --surface:   #17171b;
  --surface-2: #1e1e23;
  --line:      rgba(255,255,255,0.06);
  --line-2:    rgba(255,255,255,0.11);
  --fg:        #eceae6;
  --fg-2:      #c4c0b8;
  --fg-3:      #8f8c84;
  --muted:     #64615a;
  --accent:    #e0a23c;
  --accent-rgb: 224,162,60;
  --accent-fg:  #17120a;
  --up:        #4fa86e;
  --down:      #d85a52;
  --warn:      #d98f30;

  --sans:    'Geist', system-ui, -apple-system, sans-serif;
  --mono:    'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --display: 'Geist', system-ui, sans-serif;

  --radius: 6px;
  --radius-lg: 10px;
  --row-h: 56px;
}

/* Slate + Indigo — professional cool alternate. */
[data-theme="trenches"] {
  --bg:        #0b0d10;
  --bg-2:      #0f1217;
  --surface:   #14171c;
  --surface-2: #1b1f26;
  --line:      rgba(255,255,255,0.06);
  --line-2:    rgba(255,255,255,0.11);
  --fg:        #e6e8ec;
  --fg-2:      #b6bbc6;
  --fg-3:      #858b99;
  --muted:     #565d6c;
  --accent:    #6e8bff;
  --accent-rgb: 110,139,255;
  --accent-fg:  #0a0e1a;
  --up:        #3fb37f;
  --down:      #e0556b;
  --warn:      #d9a23c;
}

/* Theme switcher pill (sidebar foot) */
.cc-theme-switch {
  display: flex; gap: 0; padding: 3px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 7px; margin: 8px 0 4px;
}
.cc-theme-pill {
  flex: 1; padding: 5px 8px; font-size: 11px; color: var(--fg-3);
  border-radius: 4px; text-align: center; font-weight: 600;
  letter-spacing: 0.3px;
}
.cc-theme-pill:hover:not(.active) { color: var(--fg-2); }
.cc-theme-pill.active {
  background: rgba(var(--accent-rgb), 0.16); color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 13px; -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; color: inherit; background: none; border: none; outline: none; }
a { color: inherit; text-decoration: none; }
.cc-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cc-muted { color: var(--muted); }

/* No old-school draggable scrollbars anywhere — touch / wheel / overflow only.
   Apply broadly so any pane that scrolls (rails, tables, modals, app body)
   never paints a grab-handle scrollbar. */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none !important; }
*::-webkit-scrollbar-track,
*::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-corner { display: none !important; background: transparent !important; }

/* Ambient grain — subtle accent glow, kept faint for a calm, pro feel */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(var(--accent-rgb),0.05), transparent 60%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(var(--accent-rgb),0.025), transparent 60%);
  z-index: 0;
}

/* APP SHELL */
.cc-app { display: flex; height: 100vh; position: relative; z-index: 1; }

/* SIDEBAR */
.cc-sidebar {
  width: 232px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 14px 10px 12px;
  gap: 14px;
}
.cc-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 6px; }
.cc-brand-text { display: flex; flex-direction: column; line-height: 1; }
.cc-brand-name { font-family: var(--display); font-size: 17px; font-weight: 700; color: var(--fg); letter-spacing: -0.3px; }
.cc-brand-sub  { font-family: var(--mono); font-size: 9.5px; color: var(--accent); letter-spacing: 2px; margin-top: 2px; }
.cc-nav { display: flex; flex-direction: column; gap: 1px; }
.cc-nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--radius);
  color: var(--fg-3); text-align: left; width: 100%;
  font-size: 13px; font-weight: 500;
  transition: all 0.12s ease;
}
.cc-nav-item:hover { background: rgba(255,255,255,0.03); color: var(--fg-2); }
.cc-nav-item.active {
  background: linear-gradient(to right, rgba(var(--accent-rgb),0.14), rgba(var(--accent-rgb),0.02));
  color: var(--fg);
  box-shadow: inset 2px 0 0 var(--accent);
}
.cc-nav-item.active svg { color: var(--accent); }
.cc-nav-item.subtle { font-size: 12px; color: var(--fg-3); padding: 6px 10px; }
.cc-nav-badge {
  margin-left: auto; font-family: var(--mono); font-size: 10px;
  padding: 1px 5px; border-radius: 3px;
  background: rgba(var(--accent-rgb), 0.15); color: var(--accent);
}
.cc-side-section { padding: 0 6px; }
.cc-side-title {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.5px;
  color: var(--muted); text-transform: uppercase;
  padding: 6px 4px; margin-top: 4px;
}
.cc-pin-list { display: flex; flex-direction: column; gap: 1px; }
.cc-pin-row {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 6px; border-radius: var(--radius);
  color: var(--fg-2); font-size: 12px; width: 100%; text-align: left;
  min-width: 0;
}
.cc-pin-row:hover { background: rgba(255,255,255,0.03); }
.cc-pin-row .cc-pin-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-pin-count { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.cc-side-footer { display: flex; flex-direction: column; gap: 1px; padding-top: 8px; border-top: 1px solid var(--line); margin-top: auto; }
.cc-status {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px; font-size: 11px; color: var(--fg-3);
  font-family: var(--mono);
}
.cc-status-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--up); box-shadow: 0 0 6px var(--up); animation: cc-pulse 2s ease-in-out infinite; }
@keyframes cc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* MAIN — scrollbars are hidden globally via the universal `*` rule above. */
.cc-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cc-scroll { flex: 1; overflow-y: auto; padding: 18px 24px 0; }

/* TOPBAR */
.cc-topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
/* Mobile-only brand row inside the topbar (sidebar carries it on desktop). */
.cc-topbar-brand { display: none; }
.cc-topbar-titlewrap { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.cc-topbar-title { font-family: var(--display); font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.4px; white-space: nowrap; }
.cc-page-sub { font-size: 12px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-topbar-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  width: 320px; margin-left: 8px;
  color: var(--fg-3);
}
.cc-topbar-search input { flex: 1; }
.cc-topbar-search input::placeholder { color: var(--muted); }
.cc-topbar-search kbd {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  background: rgba(255,255,255,0.04); padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--line);
}
.cc-segment { display: flex; gap: 0; background: var(--surface); border-radius: var(--radius); padding: 3px; border: 1px solid var(--line); }
.cc-seg-item { padding: 5px 12px; border-radius: 4px; font-size: 12px; color: var(--fg-3); font-weight: 500; }
.cc-seg-item.active { background: rgba(var(--accent-rgb),0.14); color: var(--accent); }
.cc-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cc-pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12px; color: var(--fg-2);
}
.cc-pill-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.cc-pill-btn.small { padding: 4px 9px; font-size: 11px; }
.cc-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-fg);
  font-size: 12px; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb),0.4), 0 4px 16px rgba(var(--accent-rgb),0.18);
}
.cc-cta:hover { filter: brightness(1.08); }

/* ICON BTN */
.cc-icon-btn {
  width: 28px; height: 28px; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-3); background: var(--surface); border: 1px solid var(--line);
}
.cc-icon-btn:hover { color: var(--fg); background: var(--surface-2); }

/* METRIC STRIP */
.cc-metric-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 22px;
}
.cc-metric { padding: 14px 16px; background: var(--bg-2); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cc-metric-label { font-size: 10.5px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-metric-value { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -0.3px; white-space: nowrap; }
.cc-metric-sub { font-size: 11px; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-metric-delta { font-size: 11px; font-family: var(--mono); }

/* SECTION HEADS */
.cc-section { margin-bottom: 28px; }
.cc-section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cc-section-head h2 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -0.2px; display: flex; align-items: baseline; gap: 8px; }
.cc-section-sub { font-size: 12px; color: var(--muted); font-weight: 400; }
.cc-section-tabs { display: flex; gap: 1px; background: var(--surface); padding: 2px; border-radius: var(--radius); border: 1px solid var(--line); }
.cc-mini-tab { padding: 3px 9px; border-radius: 4px; font-size: 11px; font-family: var(--mono); color: var(--fg-3); }
.cc-mini-tab.active { background: rgba(var(--accent-rgb),0.14); color: var(--accent); }

/* TOP MOVERS RAIL — pan/wheel/swipe only. */
.cc-rail {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}

.cc-mover {
  flex: 0 0 220px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  text-align: left;
  transition: all 0.15s ease;
  scroll-snap-align: start;
  position: relative;
  cursor: pointer;
}
.cc-mover:hover { background: var(--surface); border-color: var(--line-2); transform: translateY(-1px); }
.cc-mover.highlight {
  border-color: rgba(var(--accent-rgb),0.35);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb),0.2), 0 8px 24px rgba(var(--accent-rgb),0.08);
  background: linear-gradient(180deg, rgba(var(--accent-rgb),0.06), var(--bg-2) 50%);
}
.cc-mover-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cc-mover-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cc-mover-symrow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cc-symbol { font-weight: 700; font-size: 15px; color: var(--fg); letter-spacing: -0.2px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cc-mc { font-size: 11px; color: var(--fg-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-mover-gain { font-family: var(--mono); font-weight: 600; font-size: 22px; letter-spacing: -0.4px; }
.cc-mover-bottom { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.cc-mover-age { margin-left: auto; font-size: 11px; color: var(--muted); }
.cc-ath-tag {
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: 1px;
  padding: 1px 5px; border-radius: 3px;
  background: rgba(var(--accent-rgb),0.18); color: var(--accent);
}

/* FEEDS */
.cc-feeds { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px; }
@media (max-width: 1280px) { .cc-feeds { grid-template-columns: 1fr; } }

.cc-table-section { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.cc-table-head-bar { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cc-table-head-bar h3 { margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: -0.1px; }
.cc-table-count { font-size: 11px; color: var(--muted); }
.cc-info-dot { color: var(--muted); display: inline-flex; }

/* TABLE */
.cc-table { display: flex; flex-direction: column; }
.cc-tr {
  display: flex; align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  gap: 12px; min-height: var(--row-h);
}
.cc-tr:last-child { border-bottom: none; }
.cc-thead {
  min-height: 30px; background: rgba(0,0,0,0.18);
  font-size: 10px; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.cc-th, .cc-td { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cc-th-token, .cc-td-token { flex: 2; min-width: 180px; }
.cc-th-callers, .cc-td-callers { width: 130px; }
.cc-th-pressure, .cc-td-pressure { width: 170px; justify-content: flex-end; }
.cc-num { justify-content: flex-end; flex-direction: column; align-items: flex-end; gap: 1px; flex: 1; }
.cc-row { transition: background 0.1s; cursor: pointer; }
.cc-row:hover { background: rgba(var(--accent-rgb), 0.04); }
.cc-row:hover .cc-symbol-sm { color: var(--accent); }

.cc-td-token-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cc-td-name-row { display: flex; align-items: center; gap: 6px; }
.cc-symbol-sm { font-weight: 600; font-size: 13px; color: var(--fg); transition: color 0.12s; }
.cc-td-meta { font-size: 11px; color: var(--fg-3); display: flex; align-items: center; gap: 5px; }
.cc-td-meta .cc-mono { color: var(--muted); }
.cc-num-sub { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }

.cc-mini-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 4px; border-radius: 3px; color: var(--muted);
  position: relative;
}
.cc-mini-btn:hover { background: rgba(255,255,255,0.06); color: var(--fg); }
.cc-mini-btn-light { padding: 4px 8px; gap: 4px; font-size: 10.5px; font-family: var(--mono); color: var(--fg-3); border: 1px solid var(--line); border-radius: var(--radius); }
.cc-mini-btn-light:hover { background: var(--surface); }
.cc-mini-btn-light.active { background: rgba(var(--accent-rgb),0.14); color: var(--accent); border-color: rgba(var(--accent-rgb),0.35); }

/* Buy-handoff pill — green to stand out against the muted row controls. The
 * `.primary` variant is used in the token drawer where we want it to read
 * "press me first" without yelling at the viewport. */
.cc-buy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 3px 8px; gap: 4px; font-size: 11px; font-weight: 700;
  font-family: var(--mono); color: var(--accent);
  background: rgba(var(--accent-rgb), 0.12);
  border-radius: 4px; text-decoration: none; line-height: 1.2;
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  transition: transform 0.08s ease, background 0.12s ease, border-color 0.12s ease;
}
.cc-buy-btn:hover { background: rgba(var(--accent-rgb), 0.20); border-color: rgba(var(--accent-rgb), 0.50); transform: translateY(-1px); }
.cc-buy-btn:active { transform: translateY(0); background: rgba(var(--accent-rgb), 0.16); }
.cc-buy-btn.primary {
  padding: 8px 14px; font-size: 13px; border-radius: 8px;
  color: var(--accent-fg); background: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.50);
  box-shadow: 0 4px 16px rgba(var(--accent-rgb), 0.18);
}
.cc-buy-btn.primary:hover { filter: brightness(1.05); }

.cc-tip {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); padding: 2px 6px; border-radius: 3px;
  font-size: 10px; color: var(--fg); white-space: nowrap;
  border: 1px solid var(--line-2);
}

.cc-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10.5px; line-height: 1.1; letter-spacing: 0.4px;
  font-weight: 600; text-transform: uppercase;
  background: rgba(255,255,255,0.04); color: var(--fg-2);
  border: 1px solid rgba(255,255,255,0.06);
}
.cc-pill.accent { background: rgba(var(--accent-rgb),0.10); color: var(--accent); border-color: rgba(var(--accent-rgb),0.25); }
.cc-pill.up { background: rgba(80,232,176,0.10); color: var(--up); border-color: rgba(80,232,176,0.22); }
.cc-pill.down { background: rgba(255,91,150,0.10); color: var(--down); border-color: rgba(255,91,150,0.22); }
.cc-pill.bond { background: rgba(var(--accent-rgb),0.10); color: #d3b3f6; border-color: rgba(var(--accent-rgb),0.20); }
.cc-pill.amm { background: rgba(120,170,255,0.10); color: #9bb6e7; border-color: rgba(120,170,255,0.18); }

/* TOKEN DETAIL MODAL — centered popup, replaces the old right-side drawer.
   Class names still say "drawer" because the JS references them; only the
   positioning + animation are modal-style now. */
.cc-drawer-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,0.62); backdrop-filter: blur(4px);
  z-index: 50; animation: cc-fade 0.2s ease;
  display: flex; align-items: center; justify-content: center;
}
@keyframes cc-fade { from { opacity: 0; } to { opacity: 1; } }
.cc-drawer {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 720px; max-width: 94vw;
  max-height: 88vh;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  z-index: 51;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: cc-pop 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 28px 80px rgba(0,0,0,0.55), 0 6px 18px rgba(0,0,0,0.35);
}
@keyframes cc-pop {
  from { transform: translate(-50%, -48%) scale(0.96); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.cc-drawer-head { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); position: relative; background: linear-gradient(180deg, rgba(var(--accent-rgb),0.05), transparent 100%); }
.cc-drawer-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--fg-3); background: var(--surface);
}
.cc-drawer-close:hover { color: var(--fg); background: var(--surface-2); }
.cc-drawer-symbol { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.cc-drawer-name { font-size: 14px; color: var(--fg-3); }
.cc-drawer-meta {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 12px; color: var(--fg-3); margin-top: 6px;
}
.cc-ca-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.cc-ca {
  font-size: 11px; color: var(--fg-3); padding: 5px 8px;
  background: rgba(0,0,0,0.3); border-radius: 4px;
  border: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; font-family: var(--mono);
}

/* PRICE STRIP */
.cc-price-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  margin-top: 16px;
}
.cc-price-strip > div { padding: 12px 14px; background: var(--bg); display: flex; flex-direction: column; gap: 3px; }
.cc-strip-label { font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 500; }
.cc-strip-value { font-size: 17px; font-weight: 600; color: var(--fg); letter-spacing: -0.3px; }
.cc-strip-sub { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* TABS */
.cc-drawer-tabs { display: flex; padding: 0 22px; gap: 4px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.cc-drawer-tab {
  padding: 11px 14px; font-size: 13px; color: var(--fg-3); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: flex; align-items: center; gap: 6px;
}
.cc-drawer-tab:hover { color: var(--fg-2); }
.cc-drawer-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.cc-tab-badge {
  font-family: var(--mono); font-size: 10px; padding: 1px 5px; border-radius: 3px;
  background: rgba(255,255,255,0.06); color: var(--fg-2);
}
.cc-drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; }

.cc-panel { display: flex; flex-direction: column; gap: 14px; }
.cc-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; }
.cc-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cc-card-title { font-size: 12px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }

/* STATS GRID */
.cc-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.cc-stat { background: var(--bg); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.cc-stat-label { font-size: 10.5px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 500; }
.cc-stat-value { font-family: var(--mono); font-size: 16px; font-weight: 600; color: var(--fg); }
.cc-stat-sub { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* SECURITY */
.cc-sec-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cc-sec-chip {
  display: flex; flex-direction: column; gap: 3px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.cc-sec-chip.warn { background: rgba(232,170,75,0.08); border-color: rgba(232,170,75,0.25); }
.cc-sec-label { font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.4px; }
.cc-sec-val { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--fg); }
.cc-dev-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* CALLERS */
.cc-caller-list { display: flex; flex-direction: column; gap: 1px; }
.cc-caller-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.cc-caller-row:last-child { border-bottom: none; }
.cc-caller-name { font-weight: 600; color: var(--fg); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.cc-caller-sub { font-size: 11px; color: var(--fg-3); margin-top: 2px; }
.cc-caller-mc { text-align: right; font-family: var(--mono); }
.cc-caller-mc small { display: block; color: var(--muted); font-size: 10.5px; }

/* SOCIAL / LINKS */
.cc-link-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cc-link-tile {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cc-link-tile:hover { background: var(--surface-2); border-color: var(--line-2); }
.cc-link-tile > div { flex: 1; min-width: 0; }
.cc-link-label { font-size: 12.5px; font-weight: 600; color: var(--fg); }
.cc-link-host { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }

/* Leaderboard standings — channel cell internals (used by mobile rules too). */
.cc-lb-ch-name { font-weight: 600; color: var(--fg); }

/* RANK */
.cc-rank { font-size: 13px; color: var(--muted); font-weight: 600; }
.cc-win-bar { width: 60px; height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; margin-top: 3px; }
.cc-win-bar > div { height: 100%; background: linear-gradient(to right, var(--accent), var(--up)); }

/* PAGE HEADER */
.cc-page { padding: 6px 0 0; }
.cc-page-head {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.cc-page-head .cc-page-title { font-size: 24px; margin-bottom: 4px; font-weight: 700; }
.cc-page-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.cc-page-eyebrow { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* CHANNELS PAGE */
.cc-channel-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.cc-channel-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  transition: all 0.15s ease; cursor: pointer;
}
.cc-channel-card:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.cc-channel-card-head { display: flex; align-items: center; gap: 12px; }
.cc-channel-name {
  font-size: 14.5px; font-weight: 600; color: var(--fg);
  display: flex; align-items: center; gap: 8px;
}
.cc-channel-handle { font-size: 11.5px; color: var(--fg-3); font-family: var(--mono); }
.cc-channel-bio {
  font-size: 12.5px; color: var(--fg-2); margin: 0;
  line-height: 1.5; min-height: 36px;
}
.cc-channel-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden;
}
.cc-channel-stats > div {
  background: var(--bg); padding: 8px 10px;
  display: flex; flex-direction: column; gap: 3px;
}
.cc-channel-stats .cc-stat-label { font-size: 9.5px; }
.cc-channel-stats .cc-mono { font-size: 13px; font-weight: 600; color: var(--fg); }
.cc-channel-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-channel-last { font-size: 11.5px; color: var(--fg-3); display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.cc-live-dot {
  display: inline-block; width: 8px; height: 8px; position: relative;
}
.cc-live-dot > span {
  position: absolute; inset: 0; border-radius: 999px; background: var(--up);
  animation: cc-pulse 1.4s ease-in-out infinite;
}
.cc-live-dot::after {
  content: ''; position: absolute; inset: -4px; border-radius: 999px;
  background: var(--up); opacity: 0.2;
  animation: cc-ring 1.4s ease-out infinite;
}
@keyframes cc-ring { 0% { transform: scale(0.7); opacity: 0.5; } 100% { transform: scale(1.6); opacity: 0; } }

/* PODIUM */
.cc-podium {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px;
  margin-bottom: 24px; align-items: end;
}
.cc-podium-col { display: flex; flex-direction: column; align-items: stretch; }
.cc-podium-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  padding: 16px 14px; display: flex; flex-direction: column;
  align-items: center; gap: 8px; text-align: center;
  position: relative;
}
.cc-podium-col.first .cc-podium-card {
  border-color: rgba(var(--accent-rgb),0.4);
  background: linear-gradient(180deg, rgba(var(--accent-rgb),0.10), var(--bg-2) 60%);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb),0.2);
}
.cc-podium-medal { position: absolute; top: 8px; left: 10px; font-size: 20px; }
.cc-podium-name { font-weight: 700; font-size: 14px; color: var(--fg); margin-top: 4px; }
.cc-podium-metric { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--accent); }
.cc-podium-sub { font-size: 11px; color: var(--fg-3); font-family: var(--mono); }
.cc-podium-base {
  background: var(--surface); border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 10px 10px; padding: 7px; text-align: center;
  font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 700; letter-spacing: 1px;
}

/* WATCHLIST */
.cc-watch-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.cc-watch-card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  cursor: pointer; transition: all 0.15s; position: relative;
  text-align: left;
}
.cc-watch-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.cc-watch-head { display: flex; align-items: center; gap: 10px; }
.cc-watch-symbol { font-size: 15px; font-weight: 700; color: var(--fg); letter-spacing: -0.2px; }
.cc-watch-name { font-size: 11.5px; color: var(--fg-3); font-family: var(--mono); }
.cc-watch-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: var(--line); border-radius: 6px; overflow: hidden; }
.cc-watch-stats > div { background: var(--bg); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.cc-watch-stats .cc-stat-label { font-size: 9.5px; }
.cc-watch-empty {
  background: transparent; border: 2px dashed var(--line-2); border-radius: 10px;
  padding: 30px 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  color: var(--fg-3); font-size: 13px; min-height: 200px;
}
.cc-watch-empty:hover { border-color: var(--accent); color: var(--accent); }
.cc-watch-empty-sub { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.cc-watch-input {
  display: flex; gap: 8px; padding: 14px 0; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.cc-watch-input input {
  flex: 1; padding: 9px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--fg); font-family: var(--mono); font-size: 12px;
}
.cc-watch-input input:focus { border-color: var(--accent); }

/* RADAR */
.cc-radar-live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-family: var(--mono); color: var(--up);
  padding: 5px 10px; border-radius: 999px;
  background: rgba(80,232,176,0.08); border: 1px solid rgba(80,232,176,0.25);
}
.cc-radar-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--up); animation: cc-pulse 1.4s ease-in-out infinite; box-shadow: 0 0 8px var(--up); }

.cc-radar-hist {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 18px;
}
.cc-radar-hist-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.cc-radar-bars { display: flex; align-items: flex-end; gap: 3px; height: 80px; padding: 4px 0; }
.cc-radar-bar {
  flex: 1; min-height: 2px;
  background: linear-gradient(to top, rgba(var(--accent-rgb),0.4), var(--accent));
  border-radius: 2px 2px 0 0; transition: height 0.4s ease;
}
.cc-radar-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 6px; }

.cc-radar-stream { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cc-radar-stream-head { display: flex; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cc-radar-list { display: flex; flex-direction: column; }
.cc-radar-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; cursor: pointer; transition: background 0.1s;
}
.cc-radar-row:last-child { border-bottom: none; }
.cc-radar-row:hover { background: rgba(var(--accent-rgb), 0.04); }
.cc-radar-row.fresh { background: rgba(var(--accent-rgb), 0.10); animation: cc-flash 0.6s ease-out; }
@keyframes cc-flash {
  0% { background: rgba(var(--accent-rgb), 0.28); }
  100% { background: rgba(var(--accent-rgb), 0.10); }
}
.cc-radar-time { width: 60px; color: var(--fg-3); font-size: 11px; }
.cc-radar-ch { color: var(--fg-2); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-radar-arrow { color: var(--muted); font-family: var(--mono); }
.cc-radar-tok { font-weight: 700; color: var(--fg); }
.cc-radar-mc { color: var(--fg-3); }
.cc-radar-delta { width: 80px; text-align: right; font-family: var(--mono); }

.cc-mover-live {
  display: flex; align-items: center; gap: 8px;
  margin-top: 2px; font-size: 11px; font-weight: 600;
}
.cc-mover-live-label { font-size: 9px; text-transform: uppercase; opacity: 0.7; letter-spacing: 0.5px; }
.cc-mover-live-mc { color: var(--fg-3); font-weight: 500; margin-left: auto; }

.cc-radar-deltas { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; min-width: 170px; }
.cc-radar-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px; border-radius: 5px; font-size: 11px; font-weight: 600;
  font-family: var(--mono); white-space: nowrap;
}
.cc-radar-pill .cc-pill-label { font-size: 9px; opacity: 0.7; }
.cc-radar-ath { background: rgba(80,232,176,0.10); color: var(--up); border: 1px solid rgba(80,232,176,0.18); }
.cc-radar-live.up   { background: rgba(80,232,176,0.14); color: var(--up); border: 1px solid rgba(80,232,176,0.30); }
.cc-radar-live.down { background: rgba(255,91,150,0.12); color: var(--down); border: 1px solid rgba(255,91,150,0.28); }
[data-theme="trenches"] .cc-radar-ath   { background: rgba(var(--accent-rgb),0.10); border-color: rgba(var(--accent-rgb),0.20); }
[data-theme="trenches"] .cc-radar-live.up { background: rgba(var(--accent-rgb),0.16); border-color: rgba(var(--accent-rgb),0.32); }

.cc-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.cc-spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--line-2); border-top-color: var(--accent);
  border-radius: 50%; animation: cc-spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes cc-spin { to { transform: rotate(360deg); } }

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

/* Mobile theme toggle — hidden on desktop, shown via @media below. */
.cc-mobile-theme-btn { display: none; }

/* ============================================================
   MOBILE — bottom-nav layout, horizontal-scroll components,
   compact topbar, full-screen token drawer. Below 900px so
   tablets and phablets in landscape also get the mobile shell.
   ============================================================ */

@media (max-width: 900px) {
  /* Dynamic viewport so iOS Safari's chrome doesn't cover bottom nav.
     100vh first as a fallback for older iOS / non-dvh browsers. */
  html, body { height: 100vh; height: 100dvh; }
  body { overflow: hidden; font-size: 13px; }
  body::before { display: none; }      /* drop the radial-gradient glow on mobile (paint cost > benefit) */

  /* Mobile shell: main fills the screen, nav is fixed at the bottom.
     `position: fixed` survives every iOS quirk; column-reverse alone
     was failing on real devices (some users saw no nav at all). */
  .cc-app {
    flex-direction: column;
    height: 100vh; height: 100dvh;
  }

  /* ─── SIDEBAR → FIXED BOTTOM TAB BAR ──────────────────── */
  .cc-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    border-right: none;
    border-top: 1px solid var(--line);
    background: var(--bg-2);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.55);
    flex-shrink: 0;
    z-index: 50;
  }
  .cc-brand,
  .cc-side-section,
  .cc-side-footer { display: none; }
  .cc-nav {
    flex: 1;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
  }
  .cc-nav-item {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px;
    line-height: 1;
    min-width: 0;
    height: 54px;
    border-radius: 8px;
    position: relative;
    font-size: 10px;
    font-weight: 500;
  }
  .cc-nav-item span { font-size: 10px; letter-spacing: 0; font-weight: 500; }
  .cc-nav-item svg { width: 20px; height: 20px; }
  .cc-nav-item.active {
    background: rgba(var(--accent-rgb), 0.10);
    box-shadow: none;
  }
  .cc-nav-badge {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(2px);
    margin-left: 0;
    padding: 0 4px;
    min-width: 16px;
    height: 14px;
    line-height: 14px;
    font-size: 9px;
    text-align: center;
    border-radius: 999px;
  }

  /* ─── MAIN PANE & SCROLL ──────────────────────────────── */
  .cc-main { width: 100%; flex: 1 1 auto; min-height: 0; }
  .cc-scroll {
    /* Bottom padding clears the fixed nav (54px nav + safe-area).
       Without this the last section is hidden under the tab bar. */
    padding: 12px 12px calc(78px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  /* ─── TOPBAR — brand row + title row + search row + segment row ───── */
  .cc-topbar {
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
    gap: 8px;
    row-gap: 8px;
    flex-wrap: wrap;
  }
  /* Brand row: full width above the page-title so logo + wordmark are visible. */
  .cc-topbar-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    flex: 1 1 100%;
  }
  .cc-topbar-brand svg { flex-shrink: 0; }
  .cc-topbar-brand-name {
    font-family: var(--display); font-size: 16px; font-weight: 700;
    color: var(--fg); letter-spacing: -0.3px; line-height: 1;
  }
  .cc-topbar-brand-sub {
    font-family: var(--mono); font-size: 9px;
    color: var(--accent); letter-spacing: 1.5px;
    margin-left: auto;
    text-transform: uppercase;
  }
  .cc-topbar-titlewrap { flex: 1; align-items: center; }
  .cc-topbar-title { font-size: 18px; letter-spacing: -0.3px; }
  .cc-page-sub { display: none; }
  .cc-topbar-right { display: none; }

  .cc-mobile-theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    flex-shrink: 0;
  }
  .cc-mobile-theme-btn:active { background: var(--surface-2); }

  .cc-topbar-search {
    flex: 1 1 100%;
    order: 10;
    margin: 0;
    padding: 9px 12px;
  }
  .cc-topbar-search kbd { display: none; }
  .cc-topbar-search input { font-size: 14px; }     /* >=14px stops iOS auto-zoom */

  .cc-segment {
    flex: 1 1 100%;
    order: 11;
    padding: 2px;
  }
  .cc-seg-item {
    flex: 1;
    text-align: center;
    padding: 7px 10px;
    font-size: 12px;
  }

  /* ─── METRIC STRIP → HORIZONTAL SCROLL ────────────────── */
  .cc-metric-strip {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    margin-bottom: 16px;
    border-radius: var(--radius);
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    gap: 1px;
  }
  .cc-metric {
    flex: 0 0 138px;
    padding: 10px 12px;
    gap: 3px;
    scroll-snap-align: start;
  }
  .cc-metric-value { font-size: 17px; }
  .cc-metric-label { font-size: 9.5px; }
  .cc-metric-sub { font-size: 10px; }

  /* ─── SECTION HEADS ───────────────────────────────────── */
  .cc-section { margin-bottom: 18px; }
  .cc-section-head { gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
  .cc-section-head h2 { font-size: 14px; }
  .cc-section-head h2 .cc-section-sub { display: none; }
  /* On feed page the section head has a flex-1 spacer + 3 chevron buttons.
     Hide chevrons on mobile — users swipe natively. */
  .cc-section-head .cc-icon-btn { display: none; }

  /* ─── TOP MOVERS → SMALLER CARDS (see iter 2 block below for final sizes) */
  .cc-rail {
    gap: 8px;
    padding-bottom: 6px;
    scroll-padding-left: 12px;
    overscroll-behavior-x: contain;
  }
  .cc-mover { border-radius: 8px; }
  .cc-mover-top { gap: 8px; }
  .cc-symbol { font-size: 13px; }
  .cc-mc { font-size: 10.5px; }
  .cc-mover-age { font-size: 10px; }
  .cc-mover-live { font-size: 10.5px; gap: 6px; }
  .cc-mover-live-mc { font-size: 10px; }
  .cc-mover-live-label { font-size: 8.5px; }
  .cc-ath-tag { font-size: 8px; padding: 1px 4px; letter-spacing: 0.5px; }
  /* Force inline sparkline to shrink to card width */
  .cc-mover svg { width: 100% !important; height: 30px !important; }

  /* ─── FEED TABLES ─────────────────────────────────────── */
  .cc-feeds { gap: 14px; margin-bottom: 18px; }
  .cc-table-head-bar { padding: 10px 12px; gap: 6px; }
  .cc-table-head-bar h3 { font-size: 12.5px; }
  .cc-tr {
    padding: 0 10px;
    gap: 8px;
    min-height: 54px;
  }
  .cc-th-token, .cc-td-token { flex: 1.6; min-width: 0; }
  .cc-th-callers, .cc-td-callers { width: 52px; }
  .cc-th-pressure, .cc-td-pressure { display: none; }
  /* Hide First MC column (#4) on phones for breathing room */
  .cc-tr .cc-th:nth-child(4),
  .cc-tr .cc-td:nth-child(4) { display: none; }
  .cc-symbol-sm { font-size: 12.5px; }
  .cc-td-meta { font-size: 10.5px; gap: 4px; flex-wrap: wrap; }
  .cc-num-sub { font-size: 9.5px; }
  .cc-thead { font-size: 9.5px; }
  .cc-thead .cc-th { letter-spacing: 0.5px; }

  /* ─── DRAWER → FULL-SCREEN SHEET ──────────────────────── */
  .cc-drawer-scrim { backdrop-filter: blur(2px); }
  .cc-drawer {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    top: 0;
    left: 0;
    transform: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
    animation: cc-slide-up 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  @keyframes cc-slide-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .cc-drawer-head { padding: calc(14px + env(safe-area-inset-top)) 16px 12px; }
  .cc-drawer-symbol { font-size: 19px; }
  .cc-drawer-close { top: calc(10px + env(safe-area-inset-top)); }
  .cc-ca { font-size: 10px; }
  .cc-drawer-tabs {
    padding: 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cc-drawer-tab { padding: 10px 14px; font-size: 12.5px; white-space: nowrap; }
  .cc-drawer-body {
    padding: 14px 14px calc(20px + env(safe-area-inset-bottom));
  }
  .cc-price-strip { grid-template-columns: repeat(2, 1fr); }
  .cc-strip-value { font-size: 15px; }
  .cc-strip-label { font-size: 9.5px; }
  .cc-card { padding: 12px 14px; }
  .cc-stats-grid { grid-template-columns: 1fr 1fr; }
  .cc-sec-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .cc-sec-chip { padding: 7px 8px; }
  .cc-link-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .cc-link-tile { padding: 9px 10px; gap: 8px; }
  .cc-link-label { font-size: 12px; }

  /* ─── INNER PAGES (Channels / LB / Watchlist / Radar) ─── */
  .cc-page { padding: 0; }
  .cc-page-head { gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
  .cc-page-head .cc-page-title { font-size: 20px; }
  .cc-page-eyebrow { font-size: 9.5px; }
  .cc-page-actions {
    width: 100%;
    margin-left: 0;
    gap: 6px;
    flex-wrap: wrap;
  }
  .cc-page-actions .cc-topbar-search {
    width: 100%;
    margin: 0;
    order: 0;
    flex: 1 1 100%;
  }
  .cc-page-actions .cc-segment {
    flex: 1 1 auto;
    width: auto;
    order: 1;
  }

  /* Channels list → 1 col */
  .cc-channel-grid { grid-template-columns: 1fr; gap: 10px; }
  .cc-channel-card { padding: 13px; gap: 10px; }
  .cc-channel-card-head { gap: 10px; }
  .cc-channel-bio { display: none; }
  .cc-channel-name { font-size: 14px; }
  .cc-channel-stats > div { padding: 6px 8px; }
  .cc-channel-stats .cc-mono { font-size: 12px; }

  /* Watchlist → 1 col */
  .cc-watch-grid { grid-template-columns: 1fr; gap: 10px; }
  .cc-watch-card { padding: 12px; }
  .cc-watch-input { padding: 10px 0; margin-bottom: 12px; flex-wrap: wrap; }
  .cc-watch-input input { font-size: 14px; }     /* prevent iOS zoom */

  /* Leaderboard podium — fits but tighter */
  .cc-podium { gap: 6px; margin-bottom: 16px; align-items: end; }
  .cc-podium-card { padding: 12px 8px !important; min-height: auto !important; }
  .cc-podium-card .cc-podium-name { font-size: 12px; }
  .cc-podium-metric { font-size: 17px; }
  .cc-podium-sub { font-size: 10px; }
  .cc-podium-medal { font-size: 16px; top: 6px; left: 7px; }
  .cc-podium-base { padding: 5px; font-size: 10px; }

  /* Leaderboard standings — the table has 7 columns and they all squash on
     phones, causing the channel name to overlap the avatar and the AVG ROI to
     collide with W/L. Drop the Trend (last), Avg ROI (6th from end), and the
     Win% bar so #/Channel/Calls/Win%/W-L all have room to breathe.
     Indexes here are 1-based against the rendered .cc-tr children:
       1 #, 2 Channel, 3 Calls, 4 Win%, 5 Avg ROI, 6 W/L, 7 Trend           */
  .cc-lb-standings .cc-tr {
    gap: 6px;
    padding: 0 8px;
    min-height: 56px;
  }
  .cc-lb-standings .cc-tr > .cc-th:nth-child(1),
  .cc-lb-standings .cc-tr > .cc-td:nth-child(1) { width: 26px !important; flex: 0 0 26px; }
  .cc-lb-standings .cc-tr > .cc-th:nth-child(2),
  .cc-lb-standings .cc-tr > .cc-td:nth-child(2) { flex: 1 1 auto !important; min-width: 0; gap: 8px !important; }
  .cc-lb-standings .cc-tr > .cc-th:nth-child(5),
  .cc-lb-standings .cc-tr > .cc-td:nth-child(5),
  .cc-lb-standings .cc-tr > .cc-th:nth-child(7),
  .cc-lb-standings .cc-tr > .cc-td:nth-child(7) { display: none; }
  .cc-lb-standings .cc-win-bar { display: none; }
  .cc-lb-standings .cc-rank { font-size: 11px; }
  /* Channel cell internals: stack name/handle, allow them to ellipsis. */
  .cc-lb-standings .cc-lb-ch { min-width: 0; flex: 1; }
  .cc-lb-standings .cc-lb-ch-name {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  .cc-lb-standings .cc-lb-ch .cc-td-meta {
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
  }

  /* Radar */
  .cc-radar-row {
    padding: 9px 10px;
    gap: 7px;
    font-size: 12px;
  }
  .cc-radar-time { width: 46px; font-size: 10px; }
  .cc-radar-ch { font-size: 11.5px; min-width: 0; flex: 1; }
  .cc-radar-arrow { display: none; }
  .cc-radar-mc { display: none; }
  .cc-radar-deltas { min-width: 0; gap: 4px; }
  .cc-radar-pill { padding: 2px 5px; font-size: 10px; }
  .cc-radar-tok { font-size: 11.5px; }
  .cc-radar-hist { padding: 10px 12px; margin-bottom: 12px; }
  .cc-radar-bars { height: 50px; }
  .cc-radar-live { padding: 4px 8px; font-size: 10.5px; }

  /* Toasts — anchor above bottom nav */
  #cc-toast-host {
    right: 12px !important;
    left: 12px !important;
    bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  }

  /* === iter 2: tighter movers, internal-scroll tables, slimmer drawer === */

  /* Top Movers: smaller cards, drop the inline chart, make swipe reliable.
     Rail: free pan (snap was fighting touch on iOS).
     Mover: touch-action: manipulation so swipes pass through the button. */
  .cc-rail {
    scroll-snap-type: none;
    touch-action: pan-x;
  }
  .cc-mover {
    flex: 0 0 140px;
    padding: 10px;
    gap: 5px;
    touch-action: manipulation;
  }
  .cc-mover-gain { font-size: 17px; }
  .cc-mover-spark { display: none; }

  /* Tables scroll inside themselves so Fresh + Top Prey + mini-LB all fit on
     screen at once. Sticky header keeps columns readable while scrolling. */
  .cc-feeds .cc-table,
  .cc-section > .cc-table,
  .cc-table-section .cc-table {
    max-height: 360px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .cc-feeds .cc-thead,
  .cc-section > .cc-table .cc-thead,
  .cc-table-section .cc-table .cc-thead {
    position: sticky; top: 0; z-index: 2; background: var(--bg-2);
  }

  /* Token detail drawer — slim down: smaller fonts, tighter padding,
     denser price strip so more info fits without scrolling. */
  .cc-drawer-head { padding: calc(11px + env(safe-area-inset-top)) 14px 10px; }
  .cc-drawer-symbol { font-size: 17px; }
  .cc-drawer-name { font-size: 12px; }
  .cc-drawer-meta { gap: 5px; font-size: 11px; margin-top: 5px; }
  .cc-ca { font-size: 10.5px; padding: 4px 7px; }
  .cc-ca-row { margin-top: 8px; gap: 6px; }
  .cc-price-strip { margin-top: 12px; }
  .cc-price-strip > div { padding: 8px 10px; }
  .cc-strip-value { font-size: 13.5px; }
  .cc-strip-label { font-size: 9px; }
  .cc-strip-sub { font-size: 10px; }
  .cc-drawer-tab { padding: 9px 12px; font-size: 12px; }
  .cc-drawer-body { padding: 12px 12px calc(18px + env(safe-area-inset-bottom)); }
  .cc-panel { gap: 10px; }
  .cc-card { padding: 11px 12px; }
  .cc-card-head { margin-bottom: 8px; }
  .cc-card-title { font-size: 10.5px; }
  .cc-stat { padding: 8px 10px; }
  .cc-stat-value { font-size: 13.5px; }
  .cc-stat-label { font-size: 9.5px; }
  .cc-sec-chip { padding: 6px 7px; }
  .cc-sec-val { font-size: 12px; }
  .cc-link-tile { padding: 8px 9px; gap: 7px; }
  .cc-link-label { font-size: 11.5px; }
  .cc-link-host { font-size: 9.5px; }
  .cc-caller-row { padding: 8px 0; }
  .cc-caller-name { font-size: 12.5px; }
  .cc-caller-sub { font-size: 10.5px; }
}

/* ─── Extra-tight (small phones, 320–400px) ─────────────── */
@media (max-width: 400px) {
  .cc-metric { flex: 0 0 124px; padding: 9px 10px; }
  .cc-metric-value { font-size: 15px; }
  .cc-mover { flex: 0 0 132px; padding: 9px; }
  .cc-mover-gain { font-size: 16px; }
  .cc-topbar-title { font-size: 16px; }
  /* Labels stay visible at every phone width — they're the whole point of the nav. */
  .cc-nav-item { padding: 5px 1px; gap: 2px; }
  .cc-nav-item span { font-size: 9.5px; }
  .cc-nav-item svg { width: 19px; height: 19px; }
}

/* Respect users who ask for reduced motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
