/* ============================================================
   SevenTicker — Follow the Money Section
   ============================================================ */

/* ── Section wrapper ── */
.ftm {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px clamp(16px, 4vw, 48px) 64px;
}

.ftm__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.ftm__heading-group {}

.ftm__title {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ftm__title-icon {
  font-size: 1.2rem;
}

.ftm__subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ftm__meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ftm__meta-dot {
  opacity: 0.4;
}

/* ── Consensus stepper (4-step: All / Mag7 / Quantum / Commodities) ── */
.ftm__stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  flex-shrink: 0;
}

.ftm__stepper-btn {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 5px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}

.ftm__stepper-btn--active {
  color: var(--bg-primary);
  background: var(--accent);
}

/* ── Divider ── */
.ftm__divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ── Consensus section ── */
.ftm__consensus {
  margin-bottom: 40px;
}

.ftm__consensus-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ftm__consensus-title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.ftm__consensus-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(245, 197, 24, 0.08);
  border: 1px solid rgba(245, 197, 24, 0.2);
  border-radius: 20px;
  padding: 2px 10px;
}

.ftm__consensus-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

/* ── Consensus card ── */
.ftm__consensus-card[hidden] {
  display: none;
}

.ftm__consensus-card {
  background: var(--bg-card);
  border: 1px solid rgba(245, 197, 24, 0.2);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.ftm__consensus-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(245, 197, 24, 0.04) 100%);
  pointer-events: none;
}

.ftm__consensus-card:hover {
  border-color: rgba(245, 197, 24, 0.4);
  box-shadow: 0 0 20px rgba(245, 197, 24, 0.08);
}

.ftm__consensus-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.ftm__consensus-card__ticker {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.ftm__consensus-card__rank {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 20px;
  padding: 2px 8px;
}

.ftm__consensus-card__company {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: -4px;
}

.ftm__consensus-card__value {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ftm__consensus-card__value-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Consensus strength bar */
.ftm__consensus-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
}

.ftm__consensus-bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

.ftm__consensus-card__institutions {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}

.ftm__inst-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.7;
  title: '';
}

.ftm__consensus-card__quarters {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.ftm__quarters-val {
  color: var(--accent);
  font-weight: 600;
}

/* ── Institution tabs ── */
.ftm__tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.ftm__tab {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.ftm__tab:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.ftm__tab--active {
  color: var(--bg-primary);
  background: var(--accent);
  border-color: var(--accent);
}

/* ── New Bets section ── */
.ftm__newbets {
  margin-bottom: 24px;
}

.ftm__newbets-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.ftm__newbets-title {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ftm__newbets-title-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #818cf8;
  flex-shrink: 0;
}

.ftm__newbets-badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(129, 140, 248, 0.1);
  border: 1px solid rgba(129, 140, 248, 0.2);
  border-radius: 20px;
  padding: 2px 10px;
}

.ftm__newbets-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── New Bet card ── */
.ftm__newbet-card {
  background: var(--bg-card);
  border: 1px solid rgba(129, 140, 248, 0.18);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 148px;
  flex: 1;
  max-width: 200px;
  position: relative;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.ftm__newbet-card:hover {
  border-color: rgba(129, 140, 248, 0.35);
  box-shadow: 0 0 16px rgba(129, 140, 248, 0.06);
}

.ftm__newbet-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.ftm__newbet-card__ticker {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.ftm__new-badge {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #818cf8;
  background: rgba(129, 140, 248, 0.12);
  border-radius: 20px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ftm__newbet-card__company {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ftm__newbet-card__value {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ftm__newbet-card__opened {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.ftm__newbet-card__opened span {
  color: var(--text-secondary);
}

/* "more" overflow pill */
.ftm__newbets-more {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: default;
  flex-shrink: 0;
}

/* ── Q4 2025 Moves section ── */
.ftm__moves {
  margin-bottom: 28px;
}

.ftm__moves-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ftm__moves-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ftm__moves-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ftm__common-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.ftm__common-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
}

.ftm__common-block--opened {
  border-color: rgba(52, 211, 153, 0.15);
}

.ftm__common-block--closed {
  border-color: rgba(248, 113, 113, 0.15);
}

.ftm__common-block__label {
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.ftm__common-block--opened .ftm__common-block__label { color: var(--positive); }
.ftm__common-block--closed .ftm__common-block__label { color: var(--negative); }

.ftm__common-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ftm__common-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
}

.ftm__common-chip--all {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(245, 197, 24, 0.3);
}

.ftm__common-chip__count {
  font-family: var(--font-heading);
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.65;
}

.ftm__common-chip--all .ftm__common-chip__count {
  opacity: 1;
}

.ftm__common-more {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: color var(--transition), border-color var(--transition);
}

.ftm__common-more:hover {
  color: var(--text-secondary);
  border-color: var(--border-hover);
}

.ftm__common-empty {
  font-size: 0.75rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .ftm__common-row {
    grid-template-columns: 1fr;
  }
}

/* ── Consensus ticker selector ── */
.ftm__consensus-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.ftm__cs-pill {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  white-space: nowrap;
}

.ftm__cs-pill:hover {
  color: var(--text-secondary);
  border-color: var(--border-hover);
}

.ftm__cs-pill--active {
  color: var(--bg-primary);
  background: var(--accent);
  border-color: var(--accent);
}

/* ── Consensus detail panel ── */
.ftm__consensus-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.ftm__cs-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.ftm__cs-ticker {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ftm__cs-company {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex: 1;
}

.ftm__cs-total {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.ftm__cs-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ftm__cs-row {
  display: grid;
  grid-template-columns: 100px 1fr 72px;
  align-items: center;
  gap: 10px;
}

.ftm__cs-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.ftm__cs-bar-wrap {
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
}

.ftm__cs-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.ftm__cs-value {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .ftm__cs-row {
    grid-template-columns: 80px 1fr 60px;
  }
}

/* ── Group positions ── */
.ftm__group-positions {
  margin-bottom: 32px;
}

.ftm__group-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.ftm__group-header--spaced {
  margin-top: 32px;
}

.ftm__group-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ftm__group-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ftm__group-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.ftm__group-tab {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.ftm__group-tab:hover {
  border-color: var(--accent);
  color: var(--text-secondary);
}

.ftm__group-tab--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.ftm__group-matrix-wrap {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
}

/* Matrix table */
.ftm__matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 560px;
}

.ftm__matrix-table thead th {
  font-family: var(--font-heading);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.ftm__matrix-th-ticker {
  text-align: left !important;
  min-width: 160px;
}

.ftm__matrix-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--transition);
}

.ftm__matrix-table tbody tr:last-child { border-bottom: none; }

.ftm__matrix-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ftm__matrix-table tbody td {
  padding: 11px 14px;
  vertical-align: middle;
  text-align: right;
}

.ftm__matrix-td-ticker {
  text-align: left !important;
}

.ftm__matrix-sym {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ftm__matrix-co {
  display: block;
  font-size: 0.66rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.ftm__matrix-val {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.ftm__matrix-val--active {
  color: var(--text-primary);
}

.ftm__matrix-val--none {
  color: rgba(255, 255, 255, 0.18);
}

/* ── Tables grid ── */
.ftm__tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Table card ── */
.ftm__table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  /* overflow: hidden removed — required for sticky table headers to work */
}

.ftm__table-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.ftm__table-card__title {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ftm__table-card__title--accumulate { color: var(--positive); }
.ftm__table-card__title--exit       { color: var(--negative); }

.ftm__table-card__period {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* ── Data table ── */
.ftm__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.ftm__table thead th {
  font-family: var(--font-heading);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.ftm__table thead th:last-child { text-align: right; }

.ftm__table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--transition);
}

.ftm__table tbody tr:last-child { border-bottom: none; }

.ftm__table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.ftm__table tbody td {
  padding: 13px 18px;
  vertical-align: middle;
  color: var(--text-secondary);
}

.ftm__table tbody td:last-child { text-align: right; }

/* Rank */
.ftm__rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Ticker cell */
.ftm__cell-ticker {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ftm__ticker {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ftm__company {
  font-family: var(--font-body, var(--font-heading));
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* Delta badge */
.ftm__delta {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.ftm__delta--up {
  color: var(--positive);
  background: var(--positive-dim);
}

.ftm__delta--down {
  color: var(--negative);
  background: var(--negative-dim);
}

/* Value */
.ftm__value {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.ftm__value.ftm__delta--up {
  color: var(--positive);
  background: var(--positive-dim);
  padding: 3px 10px;
  border-radius: 20px;
}

.ftm__value.ftm__delta--down {
  color: var(--negative);
  background: var(--negative-dim);
  padding: 3px 10px;
  border-radius: 20px;
}

/* Quarters consistency */
.ftm__quarters {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.ftm__quarters span {
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── JS states ── */
.ftm__fetch-error {
  font-size: 0.8rem;
  color: var(--negative);
  background: var(--negative-dim);
  border: 1px solid var(--negative);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 20px;
}

.ftm__empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 16px 0;
}

/* ── Disclaimer ── */
.ftm__disclaimer {
  margin-top: 24px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .ftm__consensus-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .ftm__tables {
    grid-template-columns: 1fr;
  }

  .ftm__consensus-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .ftm__consensus-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ftm__newbet-card {
    min-width: calc(50% - 5px);
    max-width: calc(50% - 5px);
  }

  .ftm__newbets-more {
    min-width: calc(50% - 5px);
  }

  /* Mobile: tabella → lista card */
  .ftm__table thead { display: none; }

  .ftm__table tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .ftm__table tbody td {
    padding: 0;
    border: none;
  }

  .ftm__table tbody td.td-rank { order: 0; }
  .ftm__table tbody td.td-ticker { order: 1; flex: 1; min-width: 0; }
  .ftm__table tbody td.td-ticker .ftm__company { max-width: 100%; }
  .ftm__table tbody td.td-delta { order: 2; }
  .ftm__table tbody td.td-value { order: 2; }
  .ftm__table tbody td.td-quarters { display: none; }
}
