/* ==========================================================================
   TradeFind · Signals desk
   Built on the shared token contract in styles.css, so dark/light themes and
   colours match the scanner, futures, whales and liquidations tools exactly.
   ========================================================================== */

:root {
  --tf-bg: var(--bg, #0a0e1a);
  --tf-bg-soft: var(--bg-soft, #0d1324);
  --tf-card: var(--card, rgba(17, 24, 45, 0.66));
  --tf-card-strong: var(--card-strong, rgba(21, 29, 54, 0.86));
  --tf-border: var(--border, rgba(148, 163, 208, 0.14));
  --tf-border-hot: rgba(34, 197, 94, 0.4);
  --tf-text: var(--text, #e9eefc);
  --tf-dim: var(--text-dim, #a3b0d4);
  --tf-muted: var(--muted, #7d8bb5);
  --tf-green: var(--pos, #22c55e);
  --tf-green-soft: var(--pos, #22c55e);
  --tf-red: var(--neg, #ef4444);
  --tf-cyan: var(--cyan, #22d3ee);
  --tf-violet: var(--purple, #a855f7);
  --tf-gold: var(--warn, #f59e0b);
  --tf-radius: var(--radius-lg, 20px);
  --tf-font: var(--font, "Inter", "Segoe UI", system-ui, sans-serif);
  --tf-mono: var(--mono, "JetBrains Mono", ui-monospace, Consolas, monospace);
  --tf-shadow: var(--shadow, 0 24px 60px -30px rgba(2, 6, 20, 0.9));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Admin-controlled sections stay in the DOM but disappear completely. The
   explicit rule is required because grid/flex display values otherwise win
   over the browser's default [hidden] styling. */
.tf-desk [hidden] {
  display: none !important;
}

/* ------------------------------ backdrop ------------------------------- */

.signals-page {
  position: relative;
  min-height: 100vh;
  transition: none;
}

.tf-aurora {
  position: fixed;
  inset: -18% -18% auto -18%;
  height: 120vh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 38% at 16% 10%, var(--glow-1, rgba(34, 211, 238, 0.16)), transparent 70%),
    radial-gradient(38% 34% at 84% 6%, var(--glow-2, rgba(168, 85, 247, 0.16)), transparent 72%),
    radial-gradient(46% 38% at 50% 52%, rgba(34, 197, 94, 0.08), transparent 78%);
  filter: blur(26px);
  animation: aurora-drift 24s ease-in-out infinite alternate;
}

.tf-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 68px 68px;
  opacity: 0.35;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 76%);
}

@keyframes aurora-drift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  50% { transform: translate3d(2%, 2%, 0) scale(1.06); }
  100% { transform: translate3d(-1%, 3%, 0) scale(1.02); }
}

/* ------------------------------- header -------------------------------- */

.signals-page .brand-name {
  display: block;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(100deg, var(--text) 20%, var(--cyan) 70%, var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tf-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #06121f;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.75), transparent 55%),
    linear-gradient(135deg, var(--cyan), var(--purple));
  box-shadow: 0 10px 26px -10px rgba(34, 211, 238, 0.7);
}

.signals-page .topbar {
  position: relative;
  z-index: 20;
}

.tf-bell-wrap {
  position: relative;
}

.tf-icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border-strong, var(--border));
  background: var(--card);
  backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.tf-icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 211, 238, 0.42);
  background: var(--card-hover, var(--card-strong));
}

.tf-icon-btn.has-new {
  border-color: rgba(245, 158, 11, 0.55);
  animation: bell-ring 2.4s ease-in-out infinite;
}

@keyframes bell-ring {
  0%, 82%, 100% { transform: rotate(0); }
  86% { transform: rotate(-11deg); }
  90% { transform: rotate(9deg); }
  94% { transform: rotate(-5deg); }
  98% { transform: rotate(3deg); }
}

.tf-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: #06121f;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  box-shadow: 0 0 0 2px var(--bg);
}

/* ------------------------- disclaimer ribbon --------------------------- */

.risk-strip {
  position: relative;
  z-index: 2;
  width: min(1480px, calc(100% - 28px));
  margin: 2px auto 0;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.09);
  color: var(--warn);
  font-size: 0.74rem;
  line-height: 1.5;
  text-align: center;
}

.risk-strip b {
  color: inherit;
  font-weight: 700;
}

.risk-strip .shield {
  flex: none;
  font-size: 0.85rem;
}

[data-theme="light"] .risk-strip {
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.38);
  background: rgba(245, 158, 11, 0.13);
}


/* -------------------------------- shell -------------------------------- */

.tf-desk {
  gap: 22px;
  padding-top: 16px;
}

.tf-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(22px, 3vw, 40px);
  align-items: center;
  padding: clamp(24px, 3.4vw, 44px);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius-lg) + 4px);
  background: linear-gradient(135deg, var(--card-strong), var(--card));
  box-shadow: var(--shadow);
}

.tf-hero::before {
  content: "";
  position: absolute;
  inset: auto -120px -180px auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-1, rgba(34, 211, 238, 0.18)), transparent 68%);
  pointer-events: none;
}

.tf-hero::after {
  content: "";
  position: absolute;
  inset: -160px auto auto -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow-2, rgba(168, 85, 247, 0.18)), transparent 68%);
  pointer-events: none;
}

.tf-hero-copy {
  position: relative;
  z-index: 1;
}

.tf-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tf-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
  animation: pulse 1.8s ease-in-out infinite;
}

.tf-hero h1 {
  margin: 14px 0 12px;
  font-size: clamp(2rem, 4.1vw, 3.25rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.tf-hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tf-hero-copy p {
  max-width: 62ch;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.72;
}

.tf-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.tf-stat {
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--card-strong), transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tf-stat-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.tf-stat-value {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tf-stat-value.pos { color: var(--pos); }
.tf-stat-value.neg { color: var(--neg); }

.tf-stat-sub {
  display: block;
  margin-top: 5px;
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ------------------------------- section ------------------------------- */

.tf-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tf-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tf-section-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
}

.tf-section-head p {
  margin-top: 5px;
  font-size: 0.78rem;
  color: var(--muted);
}

.count {
  min-width: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong, var(--border));
  background: var(--card);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-align: center;
}

.tf-stamp {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

.tf-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tf-pills {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(14px);
}

.tf-pill {
  border: 0;
  padding: 7px 15px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.tf-pill:hover {
  color: var(--text);
  background: var(--card-hover, rgba(30, 41, 74, 0.72));
}

.tf-pill.is-active {
  color: #06121f;
  background: linear-gradient(120deg, var(--cyan), var(--purple));
  box-shadow: 0 8px 22px -12px rgba(34, 211, 238, 0.8);
}

[data-theme="light"] .tf-pill.is-active {
  color: #fff;
}

.tf-search input {
  width: 228px;
  padding: 10px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--input-bg, rgba(10, 15, 30, 0.65));
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.tf-search input::placeholder {
  color: var(--muted);
}

.tf-search input:focus {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}



/* ------------------------- live signal banner -------------------------- */

.tf-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tf-banner {
  --side: var(--pos);
  --side-soft: rgba(34, 197, 94, 0.16);
  --side-line: rgba(34, 197, 94, 0.4);
  --ai: rgba(34, 211, 238, 0.16);
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 2.8vw, 30px);
  border: 1px solid var(--side-line);
  border-radius: 24px;
  background:
    radial-gradient(120% 150% at 6% 0%, var(--side-soft), transparent 55%),
    radial-gradient(90% 130% at 102% -10%, var(--ai), transparent 62%),
    linear-gradient(140deg, var(--card-strong), var(--card));
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 26px 80px -58px var(--side);
  animation: banner-in 0.55s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.tf-banner[data-side="short"] {
  --side: var(--neg);
  --side-soft: rgba(239, 68, 68, 0.17);
  --side-line: rgba(239, 68, 68, 0.42);
  --ai: rgba(168, 85, 247, 0.18);
}

.tf-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, var(--side-soft), transparent 38%, transparent 62%, var(--ai));
  opacity: 0.42;
  pointer-events: none;
}

.tf-banner::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--side), var(--cyan) 52%, var(--purple));
}

@keyframes banner-in {
  from { opacity: 0; transform: translateY(16px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.tf-banner-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.tf-avatar {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--side, var(--cyan));
  background: linear-gradient(145deg, var(--side-soft, rgba(34, 211, 238, 0.16)), var(--ai, rgba(168, 85, 247, 0.16)));
  border: 1px solid var(--side-line, var(--border));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.tf-banner-id {
  flex: 1 1 190px;
  min-width: 0;
}

.tf-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tf-banner h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: clamp(1.45rem, 2.8vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.tf-banner h3 small {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.tf-side {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--side-line, var(--border));
  background: var(--side-soft, var(--card));
  color: var(--side, var(--text-dim));
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1;
}

.tf-fresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--side, var(--pos));
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.tf-fresh i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
  animation: pulse 1.8s ease-in-out infinite;
}

.tf-banner-meta {
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--muted);
}

.tf-banner-rr {
  flex: none;
  min-width: 132px;
  padding: 10px 15px;
  text-align: right;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(12px);
}

.tf-banner-rr span {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.tf-banner-rr strong {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tf-desc {
  position: relative;
  max-width: 92ch;
  margin: 15px 0 0;
  color: var(--text-dim);
  font-size: 0.88rem;
  line-height: 1.68;
}



.tf-banner-body {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-top: 18px;
}

.tf-ladder-block {
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--input-bg, rgba(10, 15, 30, 0.65));
}

.tf-block-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.tf-block-label b {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-dim);
}

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

.tf-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1;
}

.tf-chip b {
  font-family: var(--font);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
}

.tf-chip.entry {
  border-color: rgba(34, 211, 238, 0.32);
  color: var(--cyan);
}

.tf-chip.stop {
  border-color: rgba(239, 68, 68, 0.36);
  color: var(--neg);
}

.tf-chip.target {
  border-color: rgba(34, 197, 94, 0.36);
  color: var(--pos);
}

.tf-chip.stop b,
.tf-chip.target b {
  color: currentColor;
  opacity: 0.7;
}

.tf-banner-foot {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.tf-metric span {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.tf-metric b {
  display: block;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.tf-metric b.pos { color: var(--pos); }
.tf-metric b.neg { color: var(--neg); }
.tf-live-price[data-tone='pos'] { color: var(--pos); }
.tf-live-price[data-tone='neg'] { color: var(--neg); }
.tf-countdown { color: var(--text-dim); white-space: nowrap; }
.tf-countdown.is-warning { color: var(--warn); }
.tf-countdown.is-expired { color: var(--neg); }

.tf-card-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 0;
  padding: 9px 12px;
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  color: var(--warn);
  font-size: 0.76rem;
  line-height: 1.45;
}

.tf-card-warning::before {
  content: '⏱';
  flex: 0 0 auto;
}

.tf-card-warning[hidden] { display: none; }

.tf-rr-meter {
  grid-column: 1 / -1;
  height: 6px;
  border-radius: 999px;
  background: var(--track, rgba(148, 163, 208, 0.2));
  overflow: hidden;
}

.tf-rr-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--neg), var(--warn), var(--pos));
}



/* ---------------------------- closed records --------------------------- */

.tf-history {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tf-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.tf-hcard {
  --side: var(--pos);
  --side-soft: rgba(34, 197, 94, 0.13);
  --side-line: rgba(34, 197, 94, 0.36);
  position: relative;
  overflow: hidden;
  padding: 17px 18px;
  border-radius: 19px;
  border: 1px solid var(--side-line);
  background:
    radial-gradient(120% 120% at 8% 0%, var(--side-soft), transparent 62%),
    linear-gradient(150deg, var(--card-strong), var(--card));
  box-shadow: var(--shadow);
  animation: banner-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

.tf-hcard[data-side="short"] {
  --side: var(--neg);
  --side-soft: rgba(239, 68, 68, 0.14);
  --side-line: rgba(239, 68, 68, 0.38);
}

.tf-hcard::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--side), transparent 88%);
}

.tf-hcard-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tf-hcard .tf-avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-size: 0.82rem;
}

.tf-hcard-id {
  flex: 1;
  min-width: 0;
}

.tf-hcard-id strong {
  display: block;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}

.tf-hcard-id small {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tf-result {
  flex: none;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.tf-result[data-result="win"] {
  color: var(--pos);
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.12);
}

.tf-result[data-result="loss"] {
  color: var(--neg);
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
}

.tf-result[data-result="breakeven"] {
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.12);
}

.tf-hcard-pnl {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 13px 0;
  font-family: var(--mono);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--side);
}

.tf-hcard-pnl small {
  font-family: var(--font);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.tf-hcard-levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
  margin: 0;
  padding: 12px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--input-bg, rgba(10, 15, 30, 0.65));
}

.tf-hcard-levels dt {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

.tf-hcard-levels dd {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tf-hcard-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 11px;
  font-size: 0.64rem;
  color: var(--muted);
}

.tf-more {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.tf-btn-ghost {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong, var(--border));
  background: var(--card);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.tf-btn-ghost:hover {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.4);
}



/* --------------------------- empty + skeleton -------------------------- */

.tf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 190px;
  padding: 30px 22px;
  text-align: center;
  border: 1px dashed var(--border-strong, var(--border));
  border-radius: 22px;
  background: var(--card);
}

.tf-empty .glyph {
  font-size: 1.7rem;
  line-height: 1;
}

.tf-empty h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.tf-empty p {
  max-width: 46ch;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}

.tf-empty-wide {
  grid-column: 1 / -1;
  width: 100%;
}

/* ---------------------- side-coloured cards (buy/sell) ------------------ */

.tf-banner[data-side="long"] {
  --side-soft: rgba(34, 197, 94, 0.3);
  --side-line: rgba(34, 197, 94, 0.58);
  --side-glow: rgba(34, 197, 94, 0.24);
}

.tf-banner[data-side="short"] {
  --side-soft: rgba(239, 68, 68, 0.3);
  --side-line: rgba(239, 68, 68, 0.6);
  --side-glow: rgba(239, 68, 68, 0.24);
}

.tf-banner {
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 26px 80px -48px var(--side-glow, var(--side));
}

.tf-banner::before {
  opacity: 0.55;
}

.tf-banner[data-side="long"] .tf-side,
.tf-banner[data-side="long"] .tf-fresh {
  color: #4ade80;
}

.tf-banner[data-side="short"] .tf-side,
.tf-banner[data-side="short"] .tf-fresh {
  color: #f87171;
}

.tf-hcard[data-side="long"] {
  --side-soft: rgba(34, 197, 94, 0.24);
  --side-line: rgba(34, 197, 94, 0.52);
}

.tf-hcard[data-side="short"] {
  --side-soft: rgba(239, 68, 68, 0.24);
  --side-line: rgba(239, 68, 68, 0.54);
}

.tf-hcard-head .tf-side-sm {
  margin-left: auto;
}

.tf-side-sm {
  padding: 5px 9px;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

.tf-hcard-pnl strong {
  font: inherit;
}

.tf-hcard-usdt {
  align-self: center;
  padding: 4px 8px;
  border: 1px solid var(--side-line, var(--border));
  border-radius: 999px;
  background: var(--side-soft, var(--card));
  color: var(--side, var(--text-dim));
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

[data-theme="light"] .tf-banner[data-side="long"] {
  background:
    radial-gradient(120% 150% at 6% 0%, rgba(34, 197, 94, 0.24), transparent 62%),
    radial-gradient(90% 130% at 102% -10%, rgba(34, 211, 238, 0.12), transparent 66%),
    linear-gradient(145deg, #ffffff, #e9fbf0);
}

[data-theme="light"] .tf-banner[data-side="short"] {
  background:
    radial-gradient(120% 150% at 6% 0%, rgba(239, 68, 68, 0.22), transparent 62%),
    radial-gradient(90% 130% at 102% -10%, rgba(168, 85, 247, 0.1), transparent 66%),
    linear-gradient(145deg, #ffffff, #fdecec);
}

[data-theme="light"] .tf-hcard[data-side="long"] {
  background:
    radial-gradient(120% 120% at 8% 0%, rgba(34, 197, 94, 0.16), transparent 66%),
    linear-gradient(150deg, #ffffff, #f1fcf5);
}

[data-theme="light"] .tf-hcard[data-side="short"] {
  background:
    radial-gradient(120% 120% at 8% 0%, rgba(239, 68, 68, 0.14), transparent 66%),
    linear-gradient(150deg, #ffffff, #fdf2f2);
}

[data-theme="light"] .tf-banner[data-side="long"] .tf-side,
[data-theme="light"] .tf-banner[data-side="long"] .tf-fresh {
  color: #15803d;
}

[data-theme="light"] .tf-banner[data-side="short"] .tf-side,
[data-theme="light"] .tf-banner[data-side="short"] .tf-fresh {
  color: #b91c1c;
}

.tf-skel {
  height: 240px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: linear-gradient(100deg, var(--card) 30%, var(--card-strong) 50%, var(--card) 70%);
  background-size: 220% 100%;
  animation: tf-shimmer 1.5s linear infinite;
}

.tf-skel-banner {
  height: 360px;
}

@keyframes tf-shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

/* ----------------------------- momentum radar -------------------------- */

.tf-radar {
  position: relative;
}

.tf-radar .tf-section-head {
  align-items: flex-start;
}

.tf-radar-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 6px 13px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(14px);
}

.tf-radar-state .dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tf-gold);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14), 0 0 14px rgba(245, 158, 11, 0.65);
  animation: radar-dot 1.8s ease-in-out infinite;
}

.tf-radar-state .text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}

.tf-radar-state b {
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tf-radar-state small {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--muted);
  white-space: nowrap;
}

.tf-radar-state[data-state="live"] .dot {
  background: var(--tf-green);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14), 0 0 14px rgba(34, 197, 94, 0.65);
}

.tf-radar-state[data-state="degraded"] .dot {
  background: var(--tf-gold);
}

.tf-radar-state[data-state="offline"] .dot {
  background: var(--tf-red);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14), 0 0 14px rgba(239, 68, 68, 0.55);
  animation: none;
}

@keyframes radar-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.tf-radar-sort select {
  min-height: 40px;
  padding: 9px 32px 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
  font: inherit;
  font-size: 0.74rem;
  outline: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 50%,
    calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.tf-radar-sort select:focus {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.tf-radar-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

.tf-radar-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--card);
}

.tf-radar-stat span {
  font-size: 0.64rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.tf-radar-stat strong {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--text);
}

.tf-radar-stat.is-strong strong {
  color: var(--tf-gold);
}

.tf-radar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tf-radar-warmup {
  padding: 11px 14px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 14px;
  background: rgba(245, 158, 11, 0.07);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tf-radar-warmup.is-hidden {
  display: none;
}

.tf-radar-warmup .head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.tf-radar-warmup .pulse {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tf-gold);
  animation: radar-dot 1.4s ease-in-out infinite;
}

.tf-radar-warmup p {
  flex: 1;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-dim);
}

.tf-radar-warmup b {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--tf-gold);
}

.tf-radar-warmup .track {
  height: 4px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
}

.tf-radar-warmup .track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tf-gold), var(--tf-cyan));
  transition: width 0.5s ease;
}

.tf-radar-warmup[data-state="offline"] {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.07);
}

.tf-radar-warmup[data-state="offline"] .pulse,
.tf-radar-warmup[data-state="offline"] b {
  background: var(--tf-red);
  color: var(--tf-red);
}

.tf-radar-tape {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 8px 13px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--card);
}

.tf-radar-tape .label {
  flex: none;
  padding-right: 10px;
  border-right: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.tf-radar-tape .items {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tf-radar-tape .items::-webkit-scrollbar {
  display: none;
}

.tf-radar-tape .muted {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

.tf-radar-tape .event {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--tf-bg-soft);
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.tf-radar-tape .event b {
  color: var(--text);
}

.tf-radar-tape .event em {
  font-style: normal;
  font-size: 0.54rem;
  letter-spacing: 0.08em;
}

.tf-radar-tape .event.long em { color: var(--tf-green); }
.tf-radar-tape .event.short em { color: var(--tf-red); }
.tf-radar-tape .event.close { opacity: 0.72; }


.tf-radar-tablewrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--tf-shadow);
}

.tf-radar-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.tf-radar-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--tf-card-strong);
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.tf-radar-table th.num,
.tf-radar-table td.num {
  text-align: right;
}

.tf-radar-table th.rank,
.tf-radar-table td.rank {
  width: 44px;
  padding-left: 15px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.tf-radar-table th.venues,
.tf-radar-table td.venues {
  width: 86px;
  text-align: center;
}

.tf-radar-table tbody tr {
  transition: background 0.18s ease;
}

.tf-radar-table tbody tr + tr td {
  border-top: 1px solid rgba(148, 163, 208, 0.08);
}

.tf-radar-table tbody tr:hover {
  background: rgba(34, 211, 238, 0.045);
}

.tf-radar-row td {
  padding: 10px 12px;
  vertical-align: middle;
}

.tf-radar-row .rank {
  border-left: 2px solid transparent;
}

.tf-radar-row .market {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 150px;
}

.tf-radar-row .avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 31px;
  height: 31px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background:
    radial-gradient(circle at 28% 22%, rgba(34, 211, 238, 0.28), transparent 62%),
    var(--tf-bg-soft);
  color: var(--tf-cyan);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.tf-radar-row .name {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tf-radar-row .name strong {
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.tf-radar-row .name small {
  font-family: var(--mono);
  font-size: 0.55rem;
  color: var(--muted);
}

.tf-radar-row .price {
  font-family: var(--mono);
  color: var(--text);
  font-weight: 600;
}

.tf-radar-row .pos,
.tf-radar-table .pos {
  color: var(--tf-green);
}

.tf-radar-row .neg,
.tf-radar-table .neg {
  color: var(--tf-red);
}

.tf-radar-row .momo {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--mono);
  font-weight: 700;
}

.tf-radar-row .momo small {
  font-family: var(--font);
  font-size: 0.55rem;
  font-weight: 500;
  color: var(--muted);
}

.tf-radar-row .score {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 72px;
}

.tf-radar-row .score b {
  width: 24px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.74rem;
  text-align: right;
}

.tf-radar-row .score .bar {
  position: relative;
  width: 34px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 208, 0.18);
}

.tf-radar-row .score .bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--score, 0) * 1%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tf-cyan), var(--tf-green));
}

.tf-radar-row .score.is-strong b {
  color: var(--tf-gold);
}

.tf-radar-row .score.is-strong .bar::after {
  background: linear-gradient(90deg, var(--tf-gold), #fb7185);
}

.tf-radar-row .score.power {
  flex-wrap: wrap;
  row-gap: 2px;
}

.tf-radar-row .score.power small {
  flex: 0 0 100%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.5rem;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.tf-radar-row .read {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tf-radar-row .read small {
  font-family: var(--mono);
  font-size: 0.56rem;
  color: var(--muted);
  white-space: nowrap;
}

.tf-radar-row .side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.tf-radar-row .side.long {
  border-color: rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.12);
  color: var(--tf-green);
}

.tf-radar-row .side.short {
  border-color: rgba(239, 68, 68, 0.38);
  background: rgba(239, 68, 68, 0.11);
  color: var(--tf-red);
}

.tf-radar-row .side.neutral {
  color: var(--muted);
  background: rgba(148, 163, 208, 0.07);
}

.tf-radar-row .venue-dots {
  display: inline-flex;
  gap: 3px;
}

.tf-radar-row .venue-dots i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.5rem;
  font-style: normal;
  font-weight: 700;
}

.tf-radar-row .venue-dots i.on {
  border-color: rgba(34, 211, 238, 0.34);
  background: rgba(34, 211, 238, 0.11);
  color: var(--tf-cyan);
}

.tf-radar-row .venues small {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 0.52rem;
  color: var(--muted);
}

.tf-radar-row.is-hot td {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12), rgba(34, 197, 94, 0.06) 48%, transparent);
  box-shadow: inset 0 1px 0 rgba(245, 158, 11, 0.16), inset 0 -1px 0 rgba(245, 158, 11, 0.16);
  animation: radar-glow 2.8s ease-in-out infinite;
}

.tf-radar-row.is-hot .rank {
  border-left-color: var(--tf-gold);
  color: var(--tf-gold);
}

.tf-radar-row.is-hot .avatar {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 18px -6px rgba(245, 158, 11, 0.75);
  color: var(--tf-gold);
}

@keyframes radar-glow {
  0%, 100% { box-shadow: inset 0 0 0 rgba(245, 158, 11, 0), inset 0 1px 0 rgba(245, 158, 11, 0.16), inset 0 -1px 0 rgba(245, 158, 11, 0.16); }
  50% { box-shadow: inset 0 0 26px -16px rgba(245, 158, 11, 0.6), inset 0 1px 0 rgba(245, 158, 11, 0.3), inset 0 -1px 0 rgba(245, 158, 11, 0.3); }
}

.tf-radar-note {
  margin: 0;
  padding: 11px 14px;
  border: 1px dashed var(--border);
  border-radius: 13px;
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--muted);
}

.tf-radar-note .key {
  display: block;
  margin-top: 4px;
  color: var(--tf-gold);
}

.tf-radar-skeleton {
  height: 220px;
  margin: 8px;
  border-radius: 12px;
}

[data-theme="light"] .tf-radar-state,
[data-theme="light"] .tf-radar-stat,
[data-theme="light"] .tf-radar-tape,
[data-theme="light"] .tf-radar-tablewrap,
[data-theme="light"] .tf-radar-sort select {
  background: rgba(255, 255, 255, 0.82);
}

[data-theme="light"] .tf-radar-table thead th {
  background: #f5f8ff;
}

[data-theme="light"] .tf-radar-row .avatar {
  color: #0e7490;
  background:
    radial-gradient(circle at 28% 22%, rgba(34, 211, 238, 0.22), transparent 62%),
    #eef7fb;
}

[data-theme="light"] .tf-radar-row.is-hot td {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), rgba(34, 197, 94, 0.07) 48%, transparent);
}

.tf-bell-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: min(360px, calc(100vw - 28px));
  max-height: min(62vh, 470px);
  overflow: auto;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--border-strong, var(--border));
  background: var(--card-strong);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  animation: panel-in 0.22s ease both;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.tf-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 4px 10px;
  border-bottom: 1px solid var(--border);
}

.tf-panel-head h3 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.tf-panel-head .tf-btn-ghost {
  padding: 6px 11px;
  font-size: 0.68rem;
}

.tf-note {
  display: flex;
  gap: 10px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
}

.tf-note:last-child {
  border-bottom: 0;
}

.tf-note .bar {
  flex: none;
  width: 3px;
  border-radius: 999px;
  background: var(--cyan);
}

.tf-note[data-level="warning"] .bar { background: var(--warn); }
.tf-note[data-level="danger"] .bar { background: var(--neg); }
.tf-note[data-level="success"] .bar { background: var(--pos); }

.tf-note p {
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.tf-note time {
  display: block;
  margin-top: 4px;
  font-size: 0.62rem;
  color: var(--muted);
}

/* ------------------------------ promotions ----------------------------- */

.tf-promo-slot {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.tf-promo-slot[hidden] {
  display: none;
}

.tf-promo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border: 1px solid color-mix(in srgb, var(--promo-color, #22d3ee) 42%, transparent);
  border-radius: 16px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--promo-color, #22d3ee) 16%, transparent), transparent 62%),
    var(--card);
  color: var(--text-dim);
  font-size: var(--promo-size, 14px);
  line-height: 1.55;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.tf-promo:hover {
  border-color: var(--promo-color, #22d3ee);
  transform: translateY(-1px);
}

.tf-promo.is-small { padding: 10px 13px; }
.tf-promo.is-large { padding: 18px 20px; }

.tf-promo strong {
  color: var(--promo-color, #22d3ee);
  font-size: 0.78em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tf-promo span { flex: 1 1 220px; }

.tf-promo em {
  color: var(--promo-color, #22d3ee);
  font-family: var(--mono);
  font-size: 0.72em;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

/* ------------------------------- toasts ------------------------------- */

.tf-toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}

.tf-toast {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: var(--card-strong);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: toast-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
  pointer-events: auto;
}

.tf-toast[data-level="danger"] { border-color: rgba(239, 68, 68, 0.42); }
.tf-toast[data-level="warning"] { border-color: rgba(245, 158, 11, 0.42); }

.tf-toast.is-out {
  animation: toast-out 0.28s ease forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

.tf-toast .glyph {
  flex: none;
  font-size: 0.9rem;
  line-height: 1.4;
}

.tf-toast strong {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
}

.tf-toast p {
  margin: 3px 0 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.tf-smart-alert {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 13px 13px 15px;
  border: 1px solid rgba(34, 211, 238, 0.42);
  border-left: 3px solid var(--tf-cyan);
  border-radius: 14px;
  background: var(--card-strong);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  animation: toast-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
  pointer-events: auto;
}

.tf-smart-alert[data-tone="success"] { border-color: rgba(34, 197, 94, 0.46); border-left-color: var(--tf-green); }
.tf-smart-alert[data-tone="danger"] { border-color: rgba(239, 68, 68, 0.46); border-left-color: #ef4444; }
.tf-smart-alert[data-tone="alert"] { border-color: rgba(251, 191, 36, 0.5); border-left-color: var(--tf-gold); }

.tf-smart-alert.is-out { animation: toast-out 0.28s ease forwards; }

.tf-smart-alert .pulse {
  position: absolute;
  top: 13px;
  left: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  color: var(--tf-cyan);
  box-shadow: 0 0 0 0 currentColor;
  animation: smart-pulse 1.9s ease-out infinite;
}

.tf-smart-alert[data-tone="success"] .pulse { color: var(--tf-green); }
.tf-smart-alert[data-tone="danger"] .pulse { color: #ef4444; }
.tf-smart-alert[data-tone="alert"] .pulse { color: var(--tf-gold); }

@keyframes smart-pulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.tf-smart-alert .glyph {
  flex: none;
  font-size: 0.95rem;
  line-height: 1.4;
}

.tf-smart-alert .copy { flex: 1; min-width: 0; }

.tf-smart-alert strong {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.01em;
}

.tf-smart-alert p {
  margin: 3px 0 0;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--text-dim);
}

.tf-smart-alert button {
  flex: none;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(148, 163, 208, 0.14);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.tf-smart-alert button:hover { background: rgba(148, 163, 208, 0.26); }

/* One-line momentum crossing alert (the only automatic public popup). */
.tf-momentum-alert {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid rgba(34, 211, 238, 0.34);
  border-left: 3px solid var(--tf-cyan);
  border-radius: 12px;
  background: var(--tf-card-strong);
  backdrop-filter: blur(18px);
  box-shadow: var(--tf-shadow);
  animation: toast-in 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
  pointer-events: auto;
}

.tf-momentum-alert.is-out { animation: toast-out 0.28s ease forwards; }

.tf-momentum-alert .glyph {
  flex: none;
  font-size: 0.95rem;
  line-height: 1;
}

.tf-momentum-alert p {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--tf-text);
}

.tf-momentum-alert b {
  font-family: var(--tf-mono);
  font-size: 0.76rem;
  color: var(--tf-cyan);
}

.tf-momentum-alert span {
  color: var(--tf-muted);
}

.tf-momentum-alert button {
  flex: none;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(148, 163, 208, 0.14);
  color: var(--tf-dim);
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1;
}

.tf-momentum-alert button:hover { background: rgba(148, 163, 208, 0.26); }

/* -------------------------------- footer ------------------------------- */

.tf-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  font-size: 0.72rem;
  line-height: 1.65;
  color: var(--muted);
}

.tf-footer strong {
  color: var(--text-dim);
}

.tf-footer nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.tf-footer nav a {
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.tf-footer nav a:hover {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.5);
}

/* ------------------------------ responsive ----------------------------- */

@media (max-width: 1180px) {
  .tf-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .tf-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .tf-banner-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .tf-banner-foot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tf-banner-rr {
    margin-left: auto;
  }
}

@media (max-width: 680px) {
  .signals-page .topbar {
    padding-top: 16px;
  }

  .signals-page .topnav {
    max-width: 100%;
    justify-content: flex-start;
    border-radius: 22px;
  }

  .tf-desk {
    padding-left: 14px;
    padding-right: 14px;
  }

  .tf-hero {
    padding: 20px 18px;
  }

  .tf-hero h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .tf-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tf-controls {
    width: 100%;
  }

  .tf-search {
    flex: 1 1 100%;
  }

  .tf-search input {
    width: 100%;
  }

  .tf-banner {
    border-radius: 20px;
    padding: 18px 16px;
  }

  .tf-banner-head {
    align-items: flex-start;
  }

  .tf-banner-rr {
    width: 100%;
    text-align: left;
  }

  .tf-banner-foot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tf-history-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tf-footer {
    flex-direction: column;
  }

  .tf-toasts {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
  }
}

@media (max-width: 1180px) {
  .tf-radar-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .tf-radar-tape {
    align-items: flex-start;
  }

  .tf-radar-tape .label {
    padding-top: 5px;
  }
}

@media (max-width: 680px) {
  .tf-radar-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tf-radar-state {
    flex: 1 1 100%;
    order: -1;
  }

  .tf-radar-sort {
    flex: 1 1 100%;
  }

  .tf-radar-sort select {
    width: 100%;
  }

  .tf-radar-tape {
    flex-direction: column;
    gap: 7px;
  }

  .tf-radar-tape .label {
    padding: 0;
    border-right: 0;
  }

  .tf-radar-warmup .head {
    flex-wrap: wrap;
  }

  .tf-radar-warmup p {
    flex: 1 1 calc(100% - 26px);
  }

  .tf-radar-warmup b {
    margin-left: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong, rgba(148, 163, 208, 0.26));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.4); }

/* -------------------- score bands, auto-trade gate, badges ---------------- */

.tf-radar-stats {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.tf-radar-stat.is-auto {
  border-color: rgba(34, 211, 238, 0.24);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 62%),
    var(--card);
}

.tf-radar-stat.is-auto strong {
  color: var(--tf-cyan);
}

.tf-pills-band .tf-pill {
  gap: 6px;
}

.tf-pills-band .tf-pill b {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(148, 163, 208, 0.14);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.54rem;
  font-weight: 700;
  line-height: 1.45;
}

.tf-pills-band .tf-pill.is-active b {
  background: rgba(255, 255, 255, 0.18);
  color: inherit;
}

.tf-pills-band .tf-pill[data-radar-band="80"].is-active {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.14);
  color: var(--tf-gold);
}

.tf-pills-band .tf-pill[data-radar-band="90"].is-active {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(251, 113, 133, 0.14);
  color: #fb7185;
}

.tf-pills-band .tf-pill[data-radar-band="100"].is-active {
  border-color: rgba(250, 204, 21, 0.6);
  background: rgba(250, 204, 21, 0.16);
  color: #facc15;
}

.tf-radar-gate {
  border-color: rgba(34, 211, 238, 0.3);
  background:
    linear-gradient(120deg, rgba(34, 211, 238, 0.09), transparent 52%),
    rgba(34, 211, 238, 0.04);
}

.tf-radar-gate .track {
  background: rgba(34, 211, 238, 0.16);
}

.tf-radar-gate .pulse {
  background: var(--tf-cyan);
}

.tf-radar-gate b {
  color: var(--tf-cyan);
}

.tf-radar-gate.is-armed {
  border-color: rgba(34, 197, 94, 0.4);
  background:
    linear-gradient(120deg, rgba(34, 197, 94, 0.12), transparent 58%),
    rgba(34, 197, 94, 0.05);
}

.tf-radar-gate.is-armed .pulse {
  background: var(--tf-green);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.65);
  animation: none;
}

.tf-radar-gate.is-armed b {
  color: var(--tf-green);
}

.tf-radar-gate.is-armed .track span {
  background: linear-gradient(90deg, var(--tf-green), var(--tf-cyan));
}

/* A small, explicit badge on every auto-published position. */
.tf-band {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(34, 211, 238, 0.42);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--tf-cyan);
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.tf-band[data-band="100"] {
  border-color: rgba(250, 204, 21, 0.55);
  background: rgba(250, 204, 21, 0.16);
  color: #facc15;
}

.tf-band[data-band="90"] {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(251, 113, 133, 0.14);
  color: #fb7185;
}

.tf-band[data-band="80"] {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.14);
  color: var(--tf-gold);
}

.tf-band[data-band="70"] {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
}

.tf-band[data-band="60"] {
  border-color: rgba(129, 140, 248, 0.5);
  background: rgba(129, 140, 248, 0.12);
  color: #a5b4fc;
}

.tf-band-sm {
  padding: 3px 6px;
  font-size: 0.5rem;
}

.tf-hcard-head {
  flex-wrap: wrap;
}

/* Radar score colours make the five bands readable at a glance. */
.tf-radar-row[data-band="100"] .rank {
  border-left-color: #facc15;
  color: #facc15;
}

.tf-radar-row[data-band="90"] .rank {
  border-left-color: #fb7185;
  color: #fb7185;
}

.tf-radar-row[data-band="80"] .rank {
  border-left-color: var(--tf-gold);
  color: var(--tf-gold);
}

.tf-radar-row[data-band="70"] .rank {
  border-left-color: #38bdf8;
  color: #38bdf8;
}

.tf-radar-row[data-band="60"] .rank {
  border-left-color: #818cf8;
  color: #a5b4fc;
}

.tf-radar-row .score[data-band="100"] b {
  color: #facc15;
}

.tf-radar-row .score[data-band="90"] b {
  color: #fb7185;
}

.tf-radar-row .score[data-band="80"] b {
  color: var(--tf-gold);
}

.tf-radar-row .score[data-band="70"] b {
  color: #38bdf8;
}

.tf-radar-row .score[data-band="60"] b {
  color: #a5b4fc;
}

[data-theme="light"] .tf-band {
  background: rgba(8, 145, 178, 0.1);
  color: #0e7490;
}

[data-theme="light"] .tf-radar-gate b,
[data-theme="light"] .tf-radar-gate .pulse {
  color: #0e7490;
  background-color: #0891b2;
}

[data-theme="light"] .tf-radar-gate.is-armed b,
[data-theme="light"] .tf-radar-gate.is-armed .pulse {
  color: #15803d;
  background-color: #16a34a;
}
