/* ════════════════════════════════════════════════════════════════════════════
   TheWaveRadar — Radar móvil (vista principal de la Home en ≤768px)
   Scroll vertical NORMAL (sin snap), densidad alta pero legible (13-16px).
   Usa las variables de base.css / ui-v2.css. Solo se monta en móvil (gate en
   app.js), pero los estilos no rompen nada si se pintara en pantallas grandes.
   ════════════════════════════════════════════════════════════════════════════ */

.tw-rmobile {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 24px;
}
.rm-loading { color: var(--tw-text-mute); font-size: 14px; padding: 24px 0; }

/* ── Cabecera "Qué ha cambiado hoy" ───────────────────────────────────────── */
.rm-head { margin: 2px 0 14px; }
.rm-head-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px;
}
.rm-title {
  font-size: 19px; font-weight: 800; letter-spacing: -.01em;
  color: var(--tw-text-head, #f2f4f7); margin: 0 0 2px;
}
.rm-sub { font-size: 12.5px; color: var(--tw-text-mute); }
.rm-bias { font-weight: 800; }
.rm-date { color: var(--tw-text-soft, #6b7280); }
.rm-resumen-link {
  flex: 0 0 auto; margin-top: 3px;
  font-size: 12px; font-weight: 700; text-decoration: none;
  color: var(--tw-info, #0891b2); white-space: nowrap;
}

.rm-chips {
  display: flex; gap: 6px; margin-top: 10px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none;
}
.rm-chips::-webkit-scrollbar { display: none; }
.rm-chip {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 6px 10px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--tw-border); background: var(--tw-bg-elev);
  color: var(--tw-text-main, #d3d7de);
}
.rm-chip--up    { color: #4ade80; border-color: rgba(34,197,94,.35); }
.rm-chip--down  { color: #f87171; border-color: rgba(239,68,68,.35); }
/* [SL-042/P5] extremo de aceleración = extensión (ámbar), no subida verde */
.rm-chip--ext   { color: #fbbf24; border-color: rgba(245,158,11,.35); }
.rm-chip--phase { color: #a78bfa; border-color: rgba(167,139,250,.35); }
.rm-chip--visit { color: var(--tw-text-mute); }

/* ── Ranking de narrativas ────────────────────────────────────────────────── */
.rm-ranking-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; margin: 0 2px 8px;
}
.rm-ranking-t { font-size: 13px; font-weight: 700; color: var(--tw-text-head); }
.rm-ranking-hint { font-size: 10.5px; color: var(--tw-text-soft); text-align: right; }

/* ── Selector de período (1S/1M/3M) — lente temporal del ranking ─────────── */
.rm-period {
  display: inline-flex; gap: 2px; margin: 0 2px 8px;
  padding: 2px; border-radius: 999px;
  border: 1px solid var(--tw-border); background: var(--tw-bg-elev);
}
.rm-period-btn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 700; line-height: 1;
  padding: 6px 12px; border-radius: 999px; color: var(--tw-text-mute);
  -webkit-tap-highlight-color: rgba(255,255,255,.06);
}
.rm-period-btn.is-active {
  background: var(--tw-bg-soft, #1b2029); color: var(--tw-text-head, #f2f4f7);
  box-shadow: inset 0 0 0 1px var(--tw-border);
}
/* Δ sin dato para el período pedido ("—"): nunca se inventa un valor */
.rm-mom--na, .rm-rd--na { color: var(--tw-text-soft); font-weight: 700; }

.rm-rows {
  display: flex; flex-direction: column; gap: 1px;
  border: 1px solid var(--tw-border); border-radius: var(--tw-radius, 12px);
  overflow: hidden; background: var(--tw-border);
}
.rm-row {
  display: block; padding: 9px 12px 8px;
  background: var(--tw-bg-card, #151a21);
  text-decoration: none; color: inherit;
  -webkit-tap-highlight-color: rgba(255,255,255,.06);
}
.rm-row:active { background: var(--tw-bg-soft, #1b2029); }

.rm-l1 { display: flex; align-items: center; gap: 7px; min-width: 0; }
.rm-emoji { flex: 0 0 auto; font-size: 15px; line-height: 1; }
.rm-name {
  flex: 1 1 auto; min-width: 0;
  font-size: 14px; font-weight: 700; color: var(--tw-text-head, #f2f4f7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rm-why {
  flex: 0 0 auto; font-size: 10px; font-weight: 700; line-height: 1;
  padding: 4px 7px; border-radius: 999px; white-space: nowrap;
}
.rm-why--phase   { background: rgba(167,139,250,.14); color: #a78bfa; }
.rm-why--accel   { background: rgba(245,158,11,.14);  color: #fbbf24; }
.rm-why--cool    { background: rgba(56,189,248,.12);  color: #7dd3fc; }
.rm-why--cartera { background: rgba(168,85,247,.14);  color: #c084fc; }
.rm-mom {
  flex: 0 0 auto; font-size: 12.5px; font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rm-score {
  flex: 0 0 auto; min-width: 30px; text-align: right;
  font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums;
}

.rm-l2 {
  display: flex; align-items: center; gap: 8px;
  margin-top: 5px; padding-left: 22px; min-width: 0;
  font-size: 11px; color: var(--tw-text-mute);
}
/* el badge de fase de twFx (clases tw-tag) queda compacto dentro de la fila */
.rm-l2 .tw-phase-badge, .rm-l2 .rm-phase {
  font-size: 10px; padding: 2px 7px; line-height: 1.4; flex: 0 0 auto;
}
.rm-rd { font-weight: 800; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.rm-rd--up   { color: #4ade80; }
.rm-rd--down { color: #f87171; }
.rm-rd--flat { color: var(--tw-text-soft); }
.rm-heat { flex: 0 0 auto; white-space: nowrap; }
.rm-heat--hot  { color: #fbbf24; }
.rm-heat--up   { color: #4ade80; }
.rm-heat--cool { color: #7dd3fc; }
.rm-heat--down { color: #f87171; }
.rm-spark { flex: 0 1 90px; min-width: 44px; opacity: .85; }
.rm-spark svg { display: block; width: 100%; height: 24px; }
.rm-tk {
  flex: 0 0 auto; margin-left: auto;
  font-family: var(--tw-font-mono, ui-monospace, monospace);
  font-size: 10px; letter-spacing: .02em; color: var(--tw-text-soft);
  white-space: nowrap;
}

/* ── Módulos secundarios colapsables ──────────────────────────────────────── */
.rm-mods { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.rm-mod {
  border: 1px solid var(--tw-border); border-radius: var(--tw-radius, 12px);
  background: var(--tw-bg-card, #151a21); overflow: hidden;
}
.rm-mod-sum {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; cursor: pointer; list-style: none;
  font-size: 13.5px; font-weight: 700; color: var(--tw-text-head);
  -webkit-tap-highlight-color: rgba(255,255,255,.06);
}
.rm-mod-sum::-webkit-details-marker { display: none; }
.rm-mod-ic { flex: 0 0 auto; }
.rm-mod-t { flex: 0 0 auto; }
.rm-mod-hint {
  flex: 1 1 auto; min-width: 0; text-align: right;
  font-size: 11px; font-weight: 600; color: var(--tw-text-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rm-mod-chev {
  flex: 0 0 auto; color: var(--tw-text-soft); font-size: 12px;
  transition: transform var(--tw-dur-base, 200ms) var(--tw-ease-out, ease);
}
.rm-mod[open] .rm-mod-chev { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .rm-mod-chev { transition: none; } }
.rm-mod-body { padding: 0 12px 12px; }

.rm-setup-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.rm-setup-tk { font-size: 16px; font-weight: 800; color: var(--tw-text-head); }
.rm-setup-name {
  font-size: 12px; color: var(--tw-text-mute);
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rm-badge {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  white-space: nowrap;
}
.rm-badge--warn { background: rgba(217,119,6,.15); color: #fbbf24; }

.rm-kpis { display: flex; gap: 6px; flex-wrap: wrap; }
.rm-kpi {
  flex: 1 1 70px; min-width: 70px;
  background: var(--tw-bg-soft, #1b2029); border: 1px solid var(--tw-border);
  border-radius: 10px; padding: 8px 10px;
}
.rm-kpi b {
  display: block; font-size: 14px; font-weight: 800;
  color: var(--tw-text-head); font-variant-numeric: tabular-nums;
}
.rm-kpi span { font-size: 10px; color: var(--tw-text-soft); }

.rm-mod-p {
  margin: 10px 0 0; font-size: 12.5px; line-height: 1.5;
  color: var(--tw-text-main, #d3d7de);
}
.rm-mod-link {
  display: inline-block; margin-top: 10px;
  font-size: 12px; font-weight: 700; text-decoration: none;
  color: var(--tw-info, #0891b2);
}

.rm-list { display: flex; flex-direction: column; gap: 8px; }
.rm-list-row {
  display: flex; align-items: baseline; gap: 8px; min-width: 0;
  font-size: 12.5px; line-height: 1.4;
}
.rm-list-ic { flex: 0 0 auto; }
.rm-list-date {
  flex: 0 0 auto; font-size: 11px; font-weight: 700;
  color: var(--tw-text-mute); font-variant-numeric: tabular-nums;
}
.rm-list-t { color: var(--tw-text-main, #d3d7de); min-width: 0; }

.rm-news-row { align-items: flex-start; }
.rm-news-dot {
  flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px;
}
.rm-news-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rm-news-meta { font-size: 10.5px; color: var(--tw-text-soft); }

/* ── Clima de mercado (chip + detalle desplegable, TW_MACRO_REGIME) ───────── */
button.rm-chip--clima {
  cursor: pointer;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.rm-chip--clima[aria-expanded="true"] { border-color: var(--tw-border-str, rgba(255,255,255,.14)); }
.rm-clima-detail {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--tw-border);
  border-radius: var(--tw-radius, 12px);
  background: var(--tw-bg-card, #151a21);
}
.rm-clima-note {
  font-size: 12px; line-height: 1.45;
  color: var(--tw-text-mute);
  margin: 0 0 8px;
}
.rm-clima-comps { display: flex; flex-direction: column; gap: 4px; }
.rm-clima-row { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px; }
.rm-clima-name {
  min-width: 76px; font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--tw-text-mute);
}
.rm-clima-val { font-weight: 700; color: var(--tw-text-head, #f2f4f7); }
.rm-clima-sig { font-weight: 600; }
