/* ============================================================
   Congress Trading page — quiverquant-style list view.
   Iter 25B: list shell, filters, modal scaffolding.
   Tokens come from style.css. Stay on the design system.
   ============================================================ */

.ct-page {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.ct-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}

/* ── Hero ───────────────────────────────────────────────── */
.ct-hero {
  margin-bottom: 20px;
}
.ct-hero-inner {
  padding: 18px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.ct-hero-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.ct-hero-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 760px;
}

/* ── Toolbar ────────────────────────────────────────────── */
.ct-toolbar {
  margin-bottom: 16px;
}
.ct-toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.ct-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.ct-filter-group--search {
  flex: 1 1 200px;
  max-width: 280px;
}
.ct-filter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.ct-select, .ct-input {
  height: 36px;
  padding: 0 10px;
  background: var(--bg-card-inner);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font: 500 13px/1 'Inter', system-ui, sans-serif;
  outline: none;
  transition: border-color var(--transition);
}
.ct-select:focus, .ct-input:focus {
  border-color: var(--accent-orange);
}

/* Iter 25M — Politician filter typeahead. The wrap is the relative
   positioning context; the dropdown is absolutely positioned beneath. The
   suffix `-suggestions` and z-index <= 12000 follow the market-insights-ux-ui
   convention. */
.ct-typeahead {
  position: relative;
}
.ct-typeahead-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1100;
  background: #1e2735;
  border: 1px solid #2a3340;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  min-width: 240px;
}
.ct-typeahead-suggestions[hidden] { display: none; }
.ct-typeahead-suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.3;
}
.ct-typeahead-suggestion:hover,
.ct-typeahead-suggestion.is-active {
  background: #28324a;
}
.ct-typeahead-suggestion-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ct-typeahead-suggestion-meta {
  color: var(--text-muted);
  font-size: 11px;
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.ct-typeahead-suggestion-empty {
  padding: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.ct-toolbar-summary {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  padding-bottom: 8px;
}

/* ── Table ──────────────────────────────────────────────── */
.ct-list-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.ct-list-scroll {
  overflow-x: auto;
}
.ct-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  min-width: 980px;
}
.ct-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg-tertiary);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  z-index: 5;
}
.ct-table tbody tr {
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color var(--transition);
}
.ct-table tbody tr:hover {
  background: var(--bg-tertiary);
}
.ct-table tbody tr:last-child {
  border-bottom: none;
}
.ct-table td {
  padding: 12px 14px;
  vertical-align: middle;
  color: var(--text-primary);
}
.ct-th-ret, .ct-td-ret {
  text-align: right;
  font-weight: 600;
}
.ct-loading {
  text-align: center;
  padding: 60px 20px !important;
  color: var(--text-muted);
}

/* ── Stock cell ─────────────────────────────────────────── */
.ct-stock-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ct-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: var(--radius-sm);
  background: var(--bg-card-inner);
  overflow: hidden;
  flex-shrink: 0;
}
.ct-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.ct-logo-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-orange);
  background: var(--accent-orange-dim);
  letter-spacing: 0.02em;
  text-align: center;
}
.ct-logo-empty {
  background: var(--bg-tertiary);
}
.ct-stock-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ct-stock-ticker {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-orange);
  letter-spacing: 0.01em;
}
.ct-stock-name {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

/* Iter 25V — Asset-type chip (ST / OP) under the ticker, mirroring Quiver. */
.ct-asset-chip {
  display: inline-block;
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: var(--radius-pill, 999px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.ct-asset-chip-stock {
  color: var(--text-muted, #8a8a8e);
  background: var(--bg-tertiary, #222226);
  border: 1px solid var(--border, #2a2a30);
}
.ct-asset-chip-option {
  color: var(--accent-cyan, #4F98A3);
  background: var(--accent-orange-dim, rgba(79, 152, 163, 0.18));
  border: 1px solid var(--accent-orange-border, rgba(79, 152, 163, 0.40));
}

/* ── Transaction badges ─────────────────────────────────── */
.ct-txn-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.ct-txn-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  width: max-content;
  max-width: 100%;
}
.ct-txn-purchase {
  color: var(--green);
  background: var(--green-bg);
  border: 1px solid rgba(14, 179, 91, 0.3);
}
.ct-txn-sale {
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid rgba(194, 74, 74, 0.3);
}
.ct-txn-exchange {
  color: var(--yellow);
  background: rgba(187, 101, 59, 0.12);
  border: 1px solid rgba(187, 101, 59, 0.3);
}
.ct-txn-amount {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ── Politician cell ────────────────────────────────────── */
.ct-pol-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ct-pol-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
}
.ct-pol-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ct-pol-avatar-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 13px;
}
.ct-pol-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ct-pol-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  background: none;
  border: none;
  text-align: left;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.ct-pol-name:hover {
  color: var(--accent-orange);
  text-decoration: underline;
}
.ct-pol-sub {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.ct-party-d { color: #5a9ee6; font-weight: 600; }
.ct-party-r { color: #e36464; font-weight: 600; }
.ct-party-i { color: var(--text-muted); font-weight: 600; }

/* ── Date cells ─────────────────────────────────────────── */
.ct-td-filed, .ct-td-traded {
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-secondary);
}
.ct-lag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ct-lag-fast { color: var(--green); background: var(--green-bg); }
.ct-lag-med { color: var(--yellow); background: rgba(187, 101, 59, 0.12); }
.ct-lag-slow { color: var(--red); background: var(--red-bg); }

/* ── Description cell ───────────────────────────────────── */
.ct-td-desc {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Return cell ────────────────────────────────────────── */
/* Iter 25V — the unqualified rules below were being overridden by the
   `.ct-table td { color: var(--text-primary); }` declaration above, so
   positive/negative %'s rendered in white instead of green/red. Qualifying
   with `.ct-table` raises specificity above the td color rule. */
.ct-table .ct-ret-pos { color: var(--green); }
.ct-table .ct-ret-neg { color: var(--red); }
.ct-table .ct-ret-na { color: var(--text-muted); font-weight: 400; }
/* Keep unqualified selectors for consumers outside .ct-table */
.ct-ret-pos { color: var(--green); }
.ct-ret-neg { color: var(--red); }
.ct-ret-na { color: var(--text-muted); font-weight: 400; }

/* ── Empty / error states ───────────────────────────────── */
.ct-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Pager ──────────────────────────────────────────────── */
.ct-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card-inner);
  font-size: 12px;
  color: var(--text-secondary);
}
.ct-pager-btn {
  height: 32px;
  padding: 0 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font: 600 12px/1 'Inter', system-ui, sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}
.ct-pager-btn:hover:not(:disabled) {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}
.ct-pager-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ct-pager-info {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ── Modal ──────────────────────────────────────────────── */
.ct-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 12, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.ct-modal-backdrop[hidden] {
  display: none;
}
.ct-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  position: relative;
  padding: 24px;
  z-index: 10000;
}
.ct-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.ct-modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.ct-modal-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.ct-modal-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .ct-table { min-width: 760px; }
  .ct-stock-name { max-width: 140px; }
  .ct-pol-name { max-width: 140px; }
  .ct-td-desc { max-width: 140px; }
}

@media (max-width: 640px) {
  .ct-main { padding: 16px 12px 60px; }
  .ct-hero-title { font-size: 19px; }
  .ct-hero-sub { font-size: 12px; }
  .ct-toolbar-inner { gap: 10px; padding: 12px; }
  .ct-filter-group { min-width: 120px; flex: 1 1 calc(50% - 8px); }
  .ct-filter-group--search { flex: 1 1 100%; max-width: 100%; }
  .ct-toolbar-summary { margin-left: 0; width: 100%; }
  .ct-table { min-width: 720px; font-size: 12px; }
  .ct-table thead th, .ct-table td { padding: 10px 10px; }
  .ct-pol-avatar { width: 32px; height: 32px; }
  .ct-modal { padding: 16px; }
  .ct-modal-title { font-size: 16px; }
  /* Ensure tap targets meet 44px minimum on mobile */
  .ct-select, .ct-input { min-height: 44px; }
  .ct-pager-btn { min-height: 44px; padding: 0 16px; }
  .ct-pol-name { min-height: 32px; padding: 4px 0; }
  .ct-modal-close { width: 44px; height: 44px; font-size: 24px; }
  /* Iter 25M — typeahead suggestions: 44px touch target on mobile. */
  .ct-typeahead-suggestion { min-height: 44px; padding: 10px 12px; }
}

/* ──────────────────────────────────────────────────────────────
   Iter 25C — trade detail chart stats colours
   ────────────────────────────────────────────────────────────── */
.ct-stat-pos { color: var(--green, #0EB35B); }
.ct-stat-neg { color: var(--red, #C24A4A); }

/* ──────────────────────────────────────────────────────────────
   Iter 25P — Sub-tabs + Politician Stock Portfolio Leaderboard
   ────────────────────────────────────────────────────────────── */

/* Sub-tab switcher: Trades Feed | Leaderboard */
.ct-tabs {
  display: flex;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  background: var(--bg-card-inner, #18181c);
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius-md, 8px);
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
}
.ct-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary, #b0bec5);
  font-family: inherit;
  font-size: var(--fs-sm, 13px);
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition, 180ms cubic-bezier(0.16, 1, 0.3, 1));
  white-space: nowrap;
}
.ct-tab:hover {
  background: var(--bg-tertiary, #222226);
  color: var(--text-primary, #e0e0e0);
}
.ct-tab.is-active {
  background: var(--accent-orange-dim, rgba(79, 152, 163, 0.18));
  color: var(--accent-cyan, #4F98A3);
}

.ct-tab-panel[hidden] { display: none; }

/* Leaderboard toolbar */
.ct-lb-toolbar {
  margin: 0 0 16px;
}
.ct-lb-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-card, #1c1c20);
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius-md, 8px);
  flex-wrap: wrap;
}

/* Period radio group (Weekly / Monthly / YTD) */
.ct-lb-period-group {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-card-inner, #18181c);
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius-md, 8px);
}
.ct-lb-period {
  background: transparent;
  border: none;
  color: var(--text-secondary, #b0bec5);
  font-family: inherit;
  font-size: var(--fs-sm, 13px);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition, 180ms cubic-bezier(0.16, 1, 0.3, 1));
}
.ct-lb-period:hover {
  background: var(--bg-tertiary, #222226);
  color: var(--text-primary, #e0e0e0);
}
.ct-lb-period.is-active {
  background: var(--accent-orange-dim, rgba(79, 152, 163, 0.18));
  color: var(--accent-cyan, #4F98A3);
}

.ct-lb-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
}
.ct-lb-summary {
  color: var(--text-muted, #8a8a8e);
  font-size: var(--fs-xs, 12px);
}
.ct-lb-info {
  background: transparent;
  border: 1px solid var(--border, #2a2a30);
  color: var(--text-secondary, #b0bec5);
  font-family: inherit;
  font-size: var(--fs-xs, 12px);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition, 180ms cubic-bezier(0.16, 1, 0.3, 1));
}
.ct-lb-info:hover {
  background: var(--bg-tertiary, #222226);
  color: var(--text-primary, #e0e0e0);
}

/* Methodology popover — anchored to the info button (right-anchored) */
.ct-lb-info-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--bg-card, #1c1c20);
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius-md, 8px);
  padding: 16px 18px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  z-index: 1200;
  color: var(--text-primary, #e0e0e0);
  font-size: var(--fs-xs, 12px);
  line-height: 1.5;
}
.ct-lb-info-popover[hidden] { display: none; }
.ct-lb-info-title {
  margin: 0 0 8px;
  font-size: var(--fs-sm, 13px);
  font-weight: 700;
}
.ct-lb-info-popover p { margin: 0 0 8px; color: var(--text-secondary, #b0bec5); }
.ct-lb-info-popover ul { margin: 0; padding-left: 18px; color: var(--text-secondary, #b0bec5); }
.ct-lb-info-popover li { margin: 4px 0; }

/* Leaderboard table */
.ct-lb-list-wrap {
  background: var(--bg-card, #1c1c20);
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}
.ct-lb-list-scroll {
  overflow-x: auto;
}
.ct-lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm, 13px);
}
.ct-lb-table thead th {
  text-align: left;
  font-size: var(--fs-xs, 12px);
  font-weight: 600;
  color: var(--text-muted, #8a8a8e);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  background: var(--bg-card-inner, #18181c);
  border-bottom: 1px solid var(--border, #2a2a30);
  white-space: nowrap;
}
.ct-lb-th-rank { width: 48px; text-align: center; }
.ct-lb-th-ret, .ct-lb-th-profit, .ct-lb-th-vol, .ct-lb-th-portfolio { text-align: center; }
.ct-lb-th-portfolio { width: 140px; }
.ct-lb-sort { cursor: pointer; user-select: none; }
.ct-lb-sort:hover { color: var(--text-primary, #e0e0e0); }
.ct-lb-sort.is-sorted { color: var(--accent-cyan, #4F98A3); }
.ct-lb-sort.is-sorted::after { content: ' \25BC'; font-size: 10px; }
.ct-lb-sort.is-sorted.is-asc::after { content: ' \25B2'; }

.ct-lb-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle, rgba(42,42,48,0.3));
  color: var(--text-primary, #e0e0e0);
  vertical-align: middle;
}
.ct-lb-table tbody tr:last-child td { border-bottom: none; }
.ct-lb-table tbody tr:hover { background: var(--bg-tertiary, #222226); }

.ct-lb-td-rank { text-align: center; color: var(--text-muted, #8a8a8e); font-variant-numeric: tabular-nums; }
.ct-lb-td-ret, .ct-lb-td-profit, .ct-lb-td-vol, .ct-lb-td-portfolio { text-align: center; font-variant-numeric: tabular-nums; }
/* Iter 25Z follow-up — bump specificity above `.ct-lb-table tbody td`
   so the green/red colour wins on both RETURN % and PROFIT $ columns. */
.ct-lb-table tbody td.ct-lb-td-ret-pos,
.ct-lb-table tbody td.ct-lb-td-ret-neg {
  font-weight: 600;
}
.ct-lb-table tbody td.ct-lb-td-ret-pos { color: var(--green, #0EB35B); }
.ct-lb-table tbody td.ct-lb-td-ret-neg { color: var(--red,   #C24A4A); }
.ct-lb-td-link { text-align: center; }

.ct-lb-pol {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ct-lb-pol-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card-inner, #18181c);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ct-lb-pol-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ct-lb-pol-avatar-fallback {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #8a8a8e);
}
.ct-lb-pol-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ct-lb-pol-name {
  font-size: var(--fs-sm, 13px);
  font-weight: 600;
  color: var(--text-primary, #e0e0e0);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.ct-lb-pol-name:hover { color: var(--accent-cyan, #4F98A3); }
.ct-lb-pol-meta {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted, #8a8a8e);
  text-transform: uppercase;
}
.ct-lb-party-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.ct-lb-party-dot--D { background: #5b8def; }
.ct-lb-party-dot--R { background: #d35454; }
.ct-lb-party-dot--I { background: #b0bec5; }

.ct-lb-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius-sm, 6px);
  color: var(--text-secondary, #b0bec5);
  font-size: var(--fs-xs, 12px);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition, 180ms cubic-bezier(0.16, 1, 0.3, 1));
  white-space: nowrap;
}
.ct-lb-link-btn:hover {
  background: var(--accent-orange-dim, rgba(79, 152, 163, 0.18));
  border-color: var(--accent-orange-border, rgba(79, 152, 163, 0.40));
  color: var(--accent-cyan, #4F98A3);
}

/* Iter 25R — portfolio cell: dollar amount linked to politician detail page */
.ct-lb-portfolio-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary, #e0e0e0);
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: color var(--transition, 180ms cubic-bezier(0.16, 1, 0.3, 1));
}
.ct-lb-portfolio-link:hover {
  color: var(--accent-cyan, #4F98A3);
}
.ct-lb-portfolio-arrow {
  font-size: 11px;
  color: var(--text-muted, #8a8a8e);
  transition: transform var(--transition, 180ms cubic-bezier(0.16, 1, 0.3, 1));
}
.ct-lb-portfolio-link:hover .ct-lb-portfolio-arrow {
  color: var(--accent-cyan, #4F98A3);
  transform: translateX(2px);
}

/* Responsive — sub-tabs + leaderboard */
@media (max-width: 900px) {
  .ct-lb-table { min-width: 720px; }
  .ct-lb-pol-name { max-width: 160px; }
}
@media (max-width: 640px) {
  .ct-tabs { width: 100%; }
  .ct-tab { flex: 1 1 50%; min-height: 44px; padding: 10px 14px; }
  .ct-lb-toolbar-inner { gap: 10px; padding: 12px; }
  .ct-lb-period-group { width: 100%; }
  .ct-lb-period { flex: 1 1 33%; min-height: 44px; padding: 10px 12px; }
  .ct-lb-meta { flex-wrap: wrap; width: 100%; }
  .ct-lb-info { min-height: 44px; padding: 10px 14px; }
  .ct-lb-info-popover { width: calc(100vw - 32px); right: 0; }
  .ct-lb-table { min-width: 660px; font-size: 12px; }
  .ct-lb-table thead th, .ct-lb-table tbody td { padding: 10px 10px; }
  .ct-lb-pol-avatar { width: 32px; height: 32px; }
  .ct-lb-link-btn { min-height: 44px; padding: 10px 12px; }
}

/* =============================================================
   Iter 25X — Follow List tab (Congress Trading page)
   ============================================================= */

/* --- Tab row: support 3 tabs (Trades / Leaderboard / Follow List) --- */
@media (max-width: 640px) {
  /* Override 2-tab 50% split to evenly fit three tabs on phones */
  .ct-tab { flex: 1 1 33%; }
}

/* --- Panel layout --- */
.ct-fl-intro {
  padding: 14px 24px 0;
}
.ct-fl-intro-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted, #8a8a8e);
  line-height: 1.45;
}

.ct-fl-grid-wrap {
  padding: 16px 24px;
}

.ct-fl-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1100px) {
  .ct-fl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .ct-fl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ct-fl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ct-fl-grid-wrap { padding: 12px 16px; }
}

.ct-fl-loading,
.ct-fl-error {
  grid-column: 1 / -1;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.ct-fl-retry {
  margin-left: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm, 6px);
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  min-height: 32px;
}
.ct-fl-retry:hover { border-color: var(--accent-cyan, #4F98A3); }

.ct-fl-toast {
  margin: 0 auto 12px;
  padding: 8px 14px;
  background: rgba(194, 74, 74, 0.12);
  border: 1px solid rgba(194, 74, 74, 0.4);
  color: #e0c0c0;
  border-radius: var(--radius-sm, 6px);
  font-size: 12px;
  text-align: center;
  max-width: 480px;
}

/* --- Card --- */
.ct-fl-card {
  position: relative;
  background: var(--bg-card, #1c1c20);
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius-md, 8px);
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  min-height: 160px;
  cursor: pointer;
  transition: border-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
              background 180ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.ct-fl-card:hover {
  border-color: var(--accent-cyan, #4F98A3);
  background: var(--bg-tertiary, #222226);
}
.ct-fl-card:focus-visible {
  outline: 2px solid var(--accent-cyan, #4F98A3);
  outline-offset: 2px;
}

.ct-fl-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-tertiary, #222226);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border, #2a2a30);
  position: relative;
  flex-shrink: 0;
}
.ct-fl-card-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ct-fl-card-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-secondary, #b0bec5);
  background: var(--bg-tertiary, #222226);
}

.ct-fl-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #e0e0e0);
  margin-bottom: 4px;
  line-height: 1.3;
  word-break: break-word;
}
.ct-fl-card-meta {
  font-size: 11px;
  color: var(--text-muted, #8a8a8e);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.4;
}
.ct-fl-card-party {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill, 999px);
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-tertiary, #222226);
  color: var(--text-secondary, #b0bec5);
}
.ct-fl-card.is-dem .ct-fl-card-party {
  background: rgba(64, 120, 200, 0.18);
  color: #7eb0e8;
}
.ct-fl-card.is-rep .ct-fl-card-party {
  background: rgba(194, 74, 74, 0.18);
  color: #e0a0a0;
}

/* --- Remove (X) and bell buttons --- */
.ct-fl-card-remove,
.ct-fl-bell {
  position: absolute;
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border, #2a2a30);
  color: var(--text-muted, #8a8a8e);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  transition: color 180ms cubic-bezier(0.16, 1, 0.3, 1),
              border-color 180ms cubic-bezier(0.16, 1, 0.3, 1),
              background 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.ct-fl-card-remove { right: 8px; }
.ct-fl-bell        { right: 40px; }

.ct-fl-card-remove:hover {
  color: var(--red, #C24A4A);
  border-color: var(--red, #C24A4A);
  background: rgba(194, 74, 74, 0.15);
}
.ct-fl-bell:hover {
  color: var(--accent-cyan, #4F98A3);
  border-color: var(--accent-cyan, #4F98A3);
}
.ct-fl-bell.is-on {
  color: var(--accent-cyan, #4F98A3);
  border-color: var(--accent-cyan, #4F98A3);
  background: rgba(79, 152, 163, 0.18);
}

/* --- Mobile touch targets (44x44 minimum per market-insights-ux-ui) --- */
@media (max-width: 640px) {
  .ct-fl-card-remove,
  .ct-fl-bell { width: 32px; height: 32px; }
  /* Extend hit area via ::before transparent overlay */
  .ct-fl-card-remove::before,
  .ct-fl-bell::before {
    content: '';
    position: absolute;
    inset: -8px;
  }
}

/* --- Empty + add slots --- */
.ct-fl-card--empty {
  background: transparent;
  border: 1px dashed rgba(138, 138, 142, 0.45);
  cursor: default;
}
.ct-fl-card--padding {
  /* visual disabled state */
  opacity: 0.4;
}
.ct-fl-card--add {
  cursor: pointer;
  color: var(--text-muted, #8a8a8e);
  font-family: inherit;
  font-size: inherit;
}
.ct-fl-card--add:hover {
  border-color: var(--accent-cyan, #4F98A3);
  color: var(--accent-cyan, #4F98A3);
  background: rgba(79, 152, 163, 0.06);
}
.ct-fl-card-add-plus {
  font-size: 36px;
  line-height: 1;
  font-weight: 300;
  margin-bottom: 6px;
}
.ct-fl-card-add-label {
  font-size: 12px;
  color: inherit;
}

/* --- Charts row (NANC / GOP, formerly KRUZ pre-2025-03-21) --- */
.ct-fl-charts-wrap {
  padding: 8px 24px 32px;
}
.ct-fl-charts-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #e0e0e0);
  margin: 0 0 12px;
  text-transform: none;
  letter-spacing: 0;
}
.ct-fl-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 900px) {
  .ct-fl-charts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ct-fl-charts-wrap { padding: 8px 16px 24px; }
}

/* Borrow politician.css pol-chart-* card look so the charts match style.
   (We can't @import politician.css from a different page; the matched
   selectors below replicate the relevant rules so nothing depends on
   load order.) */
.ct-fl-charts .pol-chart-card {
  background: var(--bg-card, #1c1c20);
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius-md, 8px);
  padding: 16px 18px 18px;
}
.ct-fl-charts .pol-chart-card-header { margin-bottom: 12px; }
.ct-fl-charts .pol-chart-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary, #e0e0e0);
  margin-bottom: 2px;
}
.ct-fl-charts .pol-chart-sub {
  font-size: 11px;
  color: var(--text-muted, #8a8a8e);
}
.ct-fl-charts .pol-chart-wrap {
  position: relative;
  height: 240px;
}
.ct-fl-charts .pol-chart-wrap canvas {
  max-width: 100%;
  height: 100% !important;
}
.ct-fl-charts .pol-chart-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted, #8a8a8e);
  pointer-events: none;
}

/* --- Add-politician modal --- */
.ct-fl-add-modal { max-width: 480px; }
.ct-fl-add-body { margin-top: 12px; }
.ct-fl-add-body .ct-typeahead { position: relative; }
.ct-fl-add-suggestions {
  position: relative;
  top: 6px;
  left: 0; right: auto;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-secondary, #1c1c20);
}
.ct-fl-add-hint {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted, #8a8a8e);
}

/* --- Politician detail modal (inside CT page) --- */
.ct-pol-modal { max-width: 720px; }
.ct-pol-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 4px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border, #2a2a30);
}
.ct-pol-modal-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-tertiary, #222226);
  border: 1px solid var(--border, #2a2a30);
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ct-pol-modal-id { flex: 1 1 auto; min-width: 0; }
.ct-pol-modal-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary, #e0e0e0);
  margin-bottom: 2px;
}
.ct-pol-modal-meta {
  font-size: 12px;
  color: var(--text-muted, #8a8a8e);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ct-pol-modal-party {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill, 999px);
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-tertiary, #222226);
  color: var(--text-secondary, #b0bec5);
}
.ct-pol-modal-link {
  font-size: 12px;
  color: var(--accent-cyan, #4F98A3);
  text-decoration: none;
  padding: 8px 12px;
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius-sm, 6px);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.ct-pol-modal-link:hover {
  border-color: var(--accent-cyan, #4F98A3);
  background: rgba(79, 152, 163, 0.08);
}

.ct-pol-modal-trades-wrap {
  overflow-x: auto;
  border: 1px solid var(--border, #2a2a30);
  border-radius: var(--radius-sm, 6px);
}
.ct-pol-modal-trades {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 520px;
}
.ct-pol-modal-trades thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #8a8a8e);
  border-bottom: 1px solid var(--border, #2a2a30);
  background: var(--bg-card-inner, #18181c);
}
.ct-pol-modal-trades tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle, rgba(42, 42, 48, 0.3));
  color: var(--text-primary, #e0e0e0);
  vertical-align: top;
}
.ct-pol-modal-trades tbody tr:last-child td { border-bottom: none; }
.ct-pol-modal-trades-co {
  font-size: 11px;
  color: var(--text-muted, #8a8a8e);
  margin-top: 2px;
}
.ct-pol-modal-trades-txn {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill, 999px);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-tertiary, #222226);
  color: var(--text-secondary, #b0bec5);
}
.ct-pol-modal-trades-txn.is-buy {
  background: var(--green-bg, rgba(14, 179, 91, 0.12));
  color: var(--green, #0EB35B);
}
.ct-pol-modal-trades-txn.is-sell {
  background: var(--red-bg, rgba(194, 74, 74, 0.12));
  color: var(--red, #C24A4A);
}

@media (max-width: 640px) {
  .ct-pol-modal-header { gap: 10px; }
  .ct-pol-modal-avatar { width: 44px; height: 44px; }
  .ct-pol-modal-name { font-size: 15px; }
  .ct-pol-modal-link { width: 100%; justify-content: center; }
}
