/* Desk Dashboard — Dark Mode / Fintech elegant */

:root {
  --dd-bg: #0D0D0D;
  --dd-bg-elevated: #121212;
  --dd-card: #1E1E1E;
  --dd-card-hover: #2A2A2A;
  --dd-border: rgba(255, 255, 255, 0.06);
  --dd-border-strong: rgba(255, 255, 255, 0.1);

  --dd-accent-start: #FF6B35;
  --dd-accent-mid: #FF8C42;
  --dd-accent-end: #FFA066;
  --dd-accent-gradient: linear-gradient(135deg, #FF6B35, #FFA066);
  --dd-accent-soft: rgba(255, 107, 53, 0.18);

  --dd-fg: #FFFFFF;
  --dd-muted: #A0A0A0;
  --dd-muted-dim: #707070;

  --dd-ok: #34D399;
  --dd-bad: #F87171;
  --dd-warn: #FBBF24;

  --dd-radius-card: 20px;
  --dd-radius-chip: 999px;
  --dd-radius-btn: 10px;
  --dd-shadow: 0px 10px 30px rgba(0, 0, 0, 0.5);
  --dd-shadow-sm: 0px 4px 16px rgba(0, 0, 0, 0.35);

  --dd-space: 28px;
  --dd-max: 1280px;

  --dd-font: "Plus Jakarta Sans", Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  --dd-sticky-rank-w: 3rem;
  --dd-sticky-ticker-w: 7rem;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--dd-font);
  font-weight: 400;
  background: var(--dd-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 107, 53, 0.08), transparent),
    linear-gradient(180deg, var(--dd-bg) 0%, var(--dd-bg-elevated) 100%);
  color: var(--dd-fg);
  line-height: 1.5;
}

.dd-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;
}

/* ── Header ── */

.dd-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 1.75rem 2rem;
  max-width: var(--dd-max);
  margin: 0 auto;
  border-bottom: 1px solid var(--dd-border);
}

.dd-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  flex: 1 1 auto;
}

.dd-logo {
  display: block;
  width: 44px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.dd-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.dd-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--dd-accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--dd-accent-start);
  word-break: break-word;
}

.dd-subtitle {
  margin: 0;
  color: var(--dd-muted);
  font-size: 0.875rem;
  font-weight: 500;
}

.dd-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.dd-meta {
  text-align: right;
  padding: 0.65rem 1rem;
  background: var(--dd-card);
  border: 1px solid var(--dd-border);
  border-radius: var(--dd-radius-btn);
  box-shadow: var(--dd-shadow-sm);
  min-width: 0;
}

.dd-meta .dd-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--dd-muted-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dd-meta .dd-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dd-fg);
  display: block;
  word-break: break-all;
}

.dd-refresh-status,
.dd-last-ui-refresh {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--dd-muted-dim);
}

.dd-btn-refresh {
  appearance: none;
  border: 1px solid rgba(255, 107, 53, 0.45);
  background: var(--dd-accent-soft);
  color: var(--dd-accent-end);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.7rem 1.15rem;
  min-height: 44px;
  border-radius: var(--dd-radius-btn);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.dd-btn-refresh:hover:not(:disabled) {
  background: rgba(255, 107, 53, 0.28);
  border-color: rgba(255, 107, 53, 0.7);
}

.dd-btn-refresh:disabled,
.dd-btn-refresh.is-loading {
  opacity: 0.65;
  cursor: wait;
}

/* ── Main layout ── */

.dd-main {
  padding: var(--dd-space) 2rem 2.5rem;
  max-width: var(--dd-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--dd-space);
}

.dd-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 1.15rem;
  letter-spacing: -0.01em;
  color: var(--dd-fg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dd-section-title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 1em;
  border-radius: 2px;
  background: var(--dd-accent-gradient);
  flex-shrink: 0;
}

/* ── Panels ── */

.dd-panel {
  background: var(--dd-card);
  border: 1px solid var(--dd-border);
  border-radius: var(--dd-radius-card);
  padding: 1.5rem 1.65rem;
  box-shadow: var(--dd-shadow);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dd-panel:hover {
  border-color: var(--dd-border-strong);
}

/* ── KPI cards ── */

.dd-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.dd-kpi-card {
  background: var(--dd-card);
  border: 1px solid var(--dd-border);
  border-radius: 16px;
  padding: 1.15rem 1.2rem;
  box-shadow: var(--dd-shadow-sm);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 96px;
}

.dd-kpi-card:hover {
  background: var(--dd-card-hover);
  border-color: rgba(255, 107, 53, 0.25);
  transform: translateY(-2px);
  box-shadow: var(--dd-shadow);
}

.dd-kpi-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dd-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dd-kpi-value {
  margin: 0.45rem 0 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--dd-fg);
  line-height: 1.2;
}

.dd-kpi-card[data-kpi="regime"] .dd-kpi-value {
  font-size: 1.15rem;
  text-transform: capitalize;
  -webkit-text-fill-color: unset;
  background: none;
}

.dd-kpi-card[data-kpi="regime"][data-regime="alcista"] {
  border-color: rgba(52, 211, 153, 0.35);
}

.dd-kpi-card[data-kpi="regime"][data-regime="alcista"] .dd-kpi-value {
  color: var(--dd-ok);
}

.dd-kpi-card[data-kpi="regime"][data-regime="mixto"] {
  border-color: rgba(251, 191, 36, 0.4);
}

.dd-kpi-card[data-kpi="regime"][data-regime="mixto"] .dd-kpi-value {
  color: var(--dd-warn);
}

.dd-kpi-card[data-kpi="regime"][data-regime="bajista"] {
  border-color: rgba(248, 113, 113, 0.4);
}

.dd-kpi-card[data-kpi="regime"][data-regime="bajista"] .dd-kpi-value {
  color: var(--dd-bad);
}

.dd-kpi-sub {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--dd-muted-dim);
}

/* ── Earnings chips ── */

.dd-earnings-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.dd-earn-chip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  background: var(--dd-bg-elevated);
  border: 1px solid var(--dd-border);
  border-radius: var(--dd-radius-chip);
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.dd-earn-chip:hover {
  background: var(--dd-card-hover);
  border-color: rgba(255, 107, 53, 0.4);
  box-shadow: 0 0 0 1px rgba(255, 107, 53, 0.15);
}

.dd-earn-chip[data-hour="BMO"] {
  border-color: rgba(251, 191, 36, 0.45);
}

.dd-earn-chip[data-hour="AMC"] {
  border-color: rgba(255, 107, 53, 0.5);
}

.dd-earn-sym {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dd-earn-date {
  color: var(--dd-muted);
  margin-left: 0.15rem;
}

.dd-earn-hour {
  margin-left: 0.15rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: var(--dd-radius-chip);
  background: var(--dd-accent-soft);
  color: var(--dd-accent-end);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dd-earn-chip[data-hour="BMO"] .dd-earn-hour {
  background: rgba(251, 191, 36, 0.15);
  color: var(--dd-warn);
}

.dd-empty {
  color: var(--dd-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ── Ranking filters ── */

.dd-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0 0 1rem;
}

.dd-filter-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  max-width: 100%;
  padding-bottom: 0.15rem;
}

.dd-filter-group.dd-filter-flags {
  flex-wrap: wrap;
  overflow: visible;
}

.dd-chip {
  appearance: none;
  border: 1px solid var(--dd-border-strong);
  background: var(--dd-bg-elevated);
  color: var(--dd-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem 0.95rem;
  min-height: 40px;
  border-radius: var(--dd-radius-chip);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dd-chip:hover {
  border-color: rgba(255, 107, 53, 0.4);
  color: var(--dd-fg);
}

.dd-chip.is-active {
  background: var(--dd-accent-soft);
  border-color: rgba(255, 107, 53, 0.55);
  color: var(--dd-accent-end);
}

.dd-chip-toggle.is-active {
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.45);
  color: var(--dd-ok);
}

.dd-filter-search {
  flex: 1 1 140px;
  min-width: 120px;
  max-width: 220px;
}

.dd-search {
  width: 100%;
  appearance: none;
  border: 1px solid var(--dd-border-strong);
  background: var(--dd-bg-elevated);
  color: var(--dd-fg);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.55rem 0.85rem;
  min-height: 40px;
  border-radius: var(--dd-radius-btn);
  outline: none;
}

.dd-search::placeholder {
  color: var(--dd-muted-dim);
}

.dd-search:focus {
  border-color: rgba(255, 107, 53, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.15);
}

.dd-filter-count {
  margin: 0;
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--dd-muted);
  white-space: nowrap;
}

/* ── Ranking table ── */

.dd-ranking .dd-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--dd-border);
  border-radius: 14px;
  background: var(--dd-bg-elevated);
  margin: 0 -0.15rem;
}

.dd-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.dd-table th,
.dd-table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--dd-border);
  white-space: nowrap;
  background: var(--dd-bg-elevated);
}

.dd-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1A1A1A;
  color: var(--dd-muted);
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--dd-border-strong);
}

.dd-table tbody tr {
  transition: background 0.15s ease;
}

.dd-table tbody tr:hover td {
  background: rgba(255, 107, 53, 0.07);
}

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

.dd-sticky-col {
  position: sticky;
  z-index: 1;
  background: var(--dd-bg-elevated);
}

.dd-table th.dd-sticky-col {
  z-index: 3;
  background: #1A1A1A;
}

.dd-col-rank {
  left: 0;
  min-width: var(--dd-sticky-rank-w);
  width: var(--dd-sticky-rank-w);
  box-shadow: 2px 0 0 rgba(255, 255, 255, 0.04);
}

.dd-col-ticker {
  left: var(--dd-sticky-rank-w);
  min-width: var(--dd-sticky-ticker-w);
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.25);
}

.dd-table tbody tr:hover .dd-sticky-col {
  background: #221c18;
}

.dd-ticker {
  font-weight: 700;
  letter-spacing: 0.03em;
}

.dd-score {
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--dd-accent-end);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  background: var(--dd-accent-soft);
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.2);
}

.dd-score.dd-score-high {
  background: rgba(255, 107, 53, 0.28);
  box-shadow: 0 0 16px rgba(255, 107, 53, 0.35);
  color: #FFB080;
}

.dd-score.dd-score-mid {
  background: rgba(255, 140, 66, 0.15);
  box-shadow: 0 0 10px rgba(255, 140, 66, 0.15);
}

.dd-score.dd-score-low {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
  color: var(--dd-muted);
}

.dd-kind {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--dd-radius-chip);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--dd-border);
  color: var(--dd-muted);
}

.dd-kind[data-kind="etf"] {
  color: var(--dd-ok);
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
}

.dd-kind[data-kind="cedear_proxy"] {
  color: var(--dd-warn);
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.08);
}

.dd-kind[data-kind="us"] {
  color: var(--dd-fg);
  border-color: var(--dd-border-strong);
}

.dd-num-pos {
  color: var(--dd-ok);
  font-weight: 600;
}

.dd-num-neg {
  color: var(--dd-bad);
  font-weight: 600;
}


/* ── Retorno Top 10 ── */

.dd-top10-head {
  margin-bottom: 1rem;
}

.dd-top10-subtitle {
  margin: -0.55rem 0 0 0.7rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dd-muted);
}

.dd-top10-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.dd-top10-card {
  background: var(--dd-bg-elevated);
  border: 1px solid var(--dd-border);
  border-radius: 16px;
  padding: 1.05rem 1.15rem;
  box-shadow: var(--dd-shadow-sm);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dd-top10-card:hover {
  border-color: rgba(255, 107, 53, 0.3);
  background: var(--dd-card-hover);
}

.dd-top10-card .dd-kpi-value {
  font-size: 1.55rem;
  margin-top: 0.4rem;
}

.dd-top10-table-wrap {
  margin-top: 0.25rem;
}

.dd-top10-table {
  min-width: 0;
  width: 100%;
}

.dd-col-entro {
  white-space: nowrap;
}

.dd-entro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.dd-entro-date {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--dd-fg);
}

.dd-entro-sessions {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--dd-muted);
  letter-spacing: 0.01em;
}

.dd-entro-empty {
  color: var(--dd-muted-dim);
  font-weight: 500;
}

.dd-entro-inline {
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--dd-fg);
}

.dd-top10-table th,
.dd-top10-table td {
  vertical-align: middle;
}

.dd-col-spark {
  width: 100px;
}

.dd-spark {
  display: block;
  overflow: visible;
}

.dd-spark-up {
  color: var(--dd-ok);
}

.dd-spark-down {
  color: var(--dd-bad);
}

.dd-spark-empty {
  color: var(--dd-muted-dim);
  font-size: 0.85rem;
}

.dd-ret-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 7.5rem;
}

.dd-ret-pct {
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.dd-ret-track {
  display: block;
  width: 100%;
  max-width: 120px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.dd-ret-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 4px;
}

.dd-ret-bar-pos {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.55), var(--dd-ok));
}

.dd-ret-bar-neg {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.55), var(--dd-bad));
}

.dd-ret-empty {
  color: var(--dd-muted-dim);
}

.dd-top10-table .dd-empty {
  text-align: left;
  color: var(--dd-muted);
  padding: 1rem 0.75rem;
}

@media (max-width: 720px) {
  .dd-top10-summary {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .dd-top10-table {
    min-width: 620px;
  }
}

/* ── Atribución del exceso Top 10 vs SPY ── */

.dd-attr {
  margin-top: 1.15rem;
  padding: 0.95rem 1rem 0.75rem;
  background: var(--dd-bg-elevated);
  border: 1px solid var(--dd-border);
  border-radius: 16px;
}

.dd-attr-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}

.dd-attr-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dd-attr-value {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dd-attr-line {
  margin: 0.45rem 0 0.85rem;
  font-size: 0.92rem;
  line-height: 1.4;
}

.dd-attr-row {
  margin-bottom: 0.7rem;
}

.dd-attr-row-h {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.28rem;
  font-size: 0.82rem;
  font-weight: 650;
}

.dd-attr-track {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.dd-attr-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 4px;
}

.dd-attr-bar-pos {
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.55), var(--dd-ok));
}

.dd-attr-bar-neg {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.55), var(--dd-bad));
}

.dd-attr-foot {
  margin: 0.15rem 0 0.65rem;
  color: var(--dd-muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.dd-attr-partial {
  margin-top: -0.35rem;
}

.dd-attr-more {
  margin-top: 0.15rem;
}

.dd-attr-more summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  color: var(--dd-fg);
  font-size: 0.86rem;
  font-weight: 700;
  list-style: none;
}

.dd-attr-more summary::-webkit-details-marker {
  display: none;
}

.dd-attr-h {
  margin: 0.85rem 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dd-muted);
}

.dd-attr-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dd-attr-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.12rem 0.75rem;
  align-items: baseline;
  padding: 0.55rem 0;
  border-top: 1px solid var(--dd-border);
}

.dd-attr-sym {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dd-attr-meta {
  grid-column: 1 / -1;
  color: var(--dd-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.dd-attr-contrib {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dd-attr-list li.is-total {
  border-top-color: var(--dd-border-strong);
}

.dd-attr-list li.is-total .dd-attr-sym {
  font-size: 0.82rem;
}

/* ── Simulación walk-forward Top 10 vs SPY ── */

.dd-wf-caption {
  margin: 0 0 1.1rem;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--dd-muted);
}

.dd-wf-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.dd-wf-kpis .dd-top10-card {
  padding: 0.9rem 1rem;
}

.dd-wf-kpis .dd-kpi-value {
  font-size: 1.35rem;
}

.dd-wf-kpis .dd-kpi-sub {
  margin-top: 0.2rem;
}

.dd-wf-chart-wrap {
  margin: 0.25rem 0 1.15rem;
  padding: 0.85rem 0.9rem 0.7rem;
  background: var(--dd-bg-elevated);
  border: 1px solid var(--dd-border);
  border-radius: 16px;
}

.dd-wf-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--dd-muted);
}

.dd-wf-key {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.dd-wf-swatch {
  width: 1.15rem;
  height: 3px;
  border-radius: 999px;
}

.dd-wf-swatch-port {
  background: #ff6b35;
}

.dd-wf-swatch-spy {
  background: #7eb6ff;
}

.dd-wf-chart {
  width: 100%;
  min-height: 180px;
}

.dd-wf-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.dd-wf-chart text {
  fill: var(--dd-muted);
  font-family: var(--dd-font);
  font-size: 11px;
  font-weight: 600;
}

.dd-wf-table {
  min-width: 0;
  width: 100%;
}

.dd-wf-table th,
.dd-wf-table td {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dd-wf-table .dd-empty {
  text-align: left;
  color: var(--dd-muted);
  padding: 0.85rem 0.75rem;
  white-space: normal;
}

@media (max-width: 900px) {
  .dd-wf-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dd-wf-kpis .dd-kpi-value {
    font-size: 1.2rem;
  }

  .dd-wf-caption {
    font-size: 0.82rem;
  }
}

/* ── Notes ── */

.dd-tip {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--dd-muted);
  background: var(--dd-bg-elevated);
  border: 1px solid var(--dd-border);
  border-radius: var(--dd-radius-btn);
  line-height: 1.5;
}

.dd-tip code {
  font-size: 0.78rem;
  color: var(--dd-accent-end);
  background: var(--dd-accent-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.dd-notes-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--dd-muted);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.65;
}

.dd-notes-list li + li {
  margin-top: 0.4rem;
}

/* ── Footer ── */

.dd-footer {
  padding: 1.5rem 2rem 2.5rem;
  max-width: var(--dd-max);
  margin: 0 auto;
  border-top: 1px solid var(--dd-border);
}

.dd-disclaimer {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--dd-muted-dim);
  line-height: 1.55;
}

.dd-disclaimer strong {
  color: var(--dd-muted);
  font-weight: 600;
}

/* ── Responsive ── */

@media (max-width: 640px) {
  .dd-header,
  .dd-main,
  .dd-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .dd-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .dd-brand {
    flex-wrap: wrap;
  }

  .dd-title {
    font-size: 1.35rem;
  }

  .dd-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .dd-meta {
    text-align: left;
    flex: 1 1 auto;
  }

  .dd-main {
    gap: 1.25rem;
    padding-top: 1.25rem;
  }

  .dd-panel {
    padding: 1rem 1rem;
    border-radius: 16px;
  }

  .dd-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .dd-kpi-card {
    padding: 0.95rem 0.9rem;
    min-height: 88px;
  }

  .dd-kpi-value {
    font-size: 1.4rem;
  }

  .dd-chip {
    min-height: 44px;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
  }

  .dd-search {
    min-height: 44px;
  }

  .dd-filter-count {
    margin-left: 0;
    width: 100%;
  }

  .dd-filters {
    gap: 0.65rem;
  }
}

@media (max-width: 480px) {
  .dd-header,
  .dd-main,
  .dd-footer {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .dd-logo {
    width: 36px;
    height: 33px;
  }

  .dd-title {
    font-size: 1.2rem;
  }

  .dd-subtitle {
    font-size: 0.8rem;
  }

  .dd-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dd-btn-refresh {
    width: 100%;
  }

  .dd-kpis {
    gap: 0.6rem;
  }

  .dd-kpi-card {
    padding: 0.8rem 0.75rem;
    border-radius: 12px;
  }

  .dd-kpi-label {
    font-size: 0.65rem;
  }

  .dd-kpi-value {
    font-size: 1.25rem;
  }

  .dd-kpi-card[data-kpi="regime"] .dd-kpi-value {
    font-size: 1rem;
  }

  .dd-panel {
    padding: 0.85rem 0.8rem;
  }

  .dd-table {
    font-size: 0.8rem;
    min-width: 760px;
  }

  .dd-table th,
  .dd-table td {
    padding: 0.55rem 0.6rem;
  }

  --dd-sticky-rank-w: 2.5rem;
  --dd-sticky-ticker-w: 6rem;
}


/* Alert flags in ranking */
.dd-flags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-width: 14rem;
}

.dd-flags-empty {
  color: var(--dd-muted-dim);
}

.dd-flag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
  color: #FBBF24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.dd-flag[data-flag="extendido_vs_ema200"],
.dd-flag[data-flag="posible_distribucion"],
.dd-flag[data-flag="rsi_sobrecompra"] {
  color: #F87171;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}

.dd-flag[data-flag="rsi_sobreventa"] {
  color: #60A5FA;
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.35);
}

.dd-flag[data-flag="atr_elevado"] {
  color: #FBBF24;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
}


/* ---- Company logos (ticker cells, Top 10, earnings) ---- */
.dd-ticker-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  white-space: nowrap;
  vertical-align: middle;
}

.dd-tlogo {
  --dd-tlogo-size: 20px;
  flex: 0 0 var(--dd-tlogo-size);
  width: var(--dd-tlogo-size);
  height: var(--dd-tlogo-size);
  border-radius: 50%;
  background: #1a1a1a;
  padding: 2px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 1px 3px rgba(0, 0, 0, 0.45);
}

.dd-tlogo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.dd-tlogo.dd-tlogo-fallback {
  padding: 0;
  background: linear-gradient(135deg, #FF6B35 0%, #FFA066 100%);
  color: #1a0f08;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  font-family: inherit;
}

.dd-earn-chip .dd-ticker-wrap {
  gap: 0.35rem;
}

.dd-tlogo.dd-tlogo-lg {
  --dd-tlogo-size: 42px;
}

.dd-tlogo.dd-tlogo-lg.dd-tlogo-fallback {
  font-size: 13px;
}

@media (max-width: 640px) {
  .dd-tlogo {
    --dd-tlogo-size: 18px;
  }
  .dd-tlogo.dd-tlogo-lg {
    --dd-tlogo-size: 42px;
  }
  .dd-tlogo.dd-tlogo-fallback {
    font-size: 7.5px;
  }
  .dd-tlogo.dd-tlogo-lg.dd-tlogo-fallback {
    font-size: 13px;
  }
  .dd-ticker-wrap {
    gap: 0.35rem;
  }
}

/* Top 10 table: scroll inside its card on narrow screens (no page-level overflow) */
.dd-top10-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Top 10 compacto en móvil: entra en ~390px sin scroll horizontal */
@media (max-width: 480px) {
  .dd-top10-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
  }
  .dd-top10-table th,
  .dd-top10-table td {
    padding-left: 0.15rem;
    padding-right: 0.15rem;
    overflow: hidden;
  }
  .dd-top10-table th {
    font-size: 0.56rem;
    letter-spacing: 0;
  }
  .dd-top10-table .dd-col-rank {
    width: 7%;
    min-width: 0;
  }
  .dd-top10-table .dd-col-ticker {
    width: 20%;
    min-width: 0;
  }
  .dd-top10-table .dd-col-entro {
    width: 20%;
  }
  .dd-top10-table .dd-col-spark {
    width: 21%;
  }
  .dd-top10-table th:nth-child(5),
  .dd-top10-table td:nth-child(5) {
    width: 14%;
  }
  .dd-top10-table th:nth-child(6),
  .dd-top10-table td:nth-child(6) {
    width: 18%;
  }
  .dd-top10-table .dd-entro-date {
    font-size: 0.68rem;
    white-space: normal;
  }
  .dd-top10-table .dd-entro-sessions {
    font-size: 0.6rem;
    white-space: normal;
  }
  .dd-top10-table .dd-spark {
    width: 100%;
    max-width: 100%;
    height: 20px;
  }
  .dd-top10-table .dd-ret-cell {
    min-width: 0;
  }
  .dd-top10-table .dd-ret-track {
    max-width: 100%;
  }
  .dd-top10-table .dd-score {
    padding: 0.12rem 0.28rem;
  }
}

@media (max-width: 370px) {
  .dd-top10-table th {
    font-size: 0.5rem;
  }
}

/* Top 10 no usa columnas sticky: sin sombras separadoras */
.dd-top10-table .dd-col-rank,
.dd-top10-table .dd-col-ticker {
  box-shadow: none;
}

.dd-section-sub {
  margin: -0.7rem 0 1rem;
  color: var(--dd-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.dd-top10-head .dd-section-sub {
  margin: 0.35rem 0 0 0.7rem;
}

.dd-table tbody tr[data-symbol] {
  cursor: pointer;
}

.dd-table tbody tr[data-symbol]:focus-visible {
  outline: 2px solid rgba(255, 107, 53, 0.85);
  outline-offset: -2px;
}

/* ── Ficha del ticker ── */

body.is-ficha .dd-header,
body.is-ficha .dd-main,
body.is-ficha .dd-footer {
  display: none;
}

.dd-ficha {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 1rem calc(2rem + env(safe-area-inset-bottom, 0px));
}

.dd-ficha-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.dd-ficha-back {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--dd-border-strong);
  background: var(--dd-card);
  color: var(--dd-fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: var(--dd-shadow-sm);
}

.dd-ficha-back:hover,
.dd-ficha-back:focus-visible {
  border-color: rgba(255, 107, 53, 0.55);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}

.dd-ficha-ident-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  min-width: 0;
}

.dd-ficha-ticker {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.dd-ficha-rank {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: var(--dd-radius-chip);
  background: var(--dd-accent-soft);
  color: var(--dd-accent-end);
  white-space: nowrap;
}

.dd-ficha-sub {
  margin: 0.2rem 0 0;
  color: var(--dd-muted);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.3;
}

.dd-ficha-quote {
  text-align: right;
}

.dd-ficha-price {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.dd-ficha-change {
  margin: 0.12rem 0 0;
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dd-ficha-card {
  position: relative;
  background: var(--dd-card);
  border: 1px solid var(--dd-border);
  border-radius: 18px;
  padding: 0.95rem 1rem 1rem 1.15rem;
  box-shadow: var(--dd-shadow-sm);
  margin: 0 0 0.75rem;
  overflow: hidden;
}

.dd-ficha-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--dd-accent-gradient);
}

.dd-ficha-kicker {
  margin: 0 0 0.8rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dd-muted);
}

.dd-ficha-score {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dd-gauge {
  position: relative;
  width: 118px;
  height: 118px;
  flex: 0 0 auto;
}

.dd-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.dd-gauge-track,
.dd-gauge-value-ring {
  fill: none;
  stroke-width: 10;
}

.dd-gauge-track {
  stroke: rgba(255, 255, 255, 0.08);
}

.dd-gauge-value-ring {
  stroke: #ff6b35;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(255, 107, 53, 0.45));
}

.dd-gauge-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.dd-pillars {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.dd-pillar {
  display: grid;
  grid-template-columns: max-content minmax(2.2rem, 1fr) max-content;
  gap: 0.45rem;
  align-items: center;
}

.dd-pillar-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dd-muted);
  white-space: nowrap;
}

.dd-pillar-track {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.dd-pillar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  min-width: 0;
}

.dd-pillar-fill[data-pillar="tendencia"] { background: #ff6b35; }
.dd-pillar-fill[data-pillar="fuerza_rs"] { background: #34d399; }
.dd-pillar-fill[data-pillar="contraccion"] { background: #a78bfa; }
.dd-pillar-fill[data-pillar="setup"] { background: #fbbf24; }

.dd-pillar-pts {
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--dd-fg);
  white-space: nowrap;
}

.dd-range-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--dd-fg);
}

.dd-range-head strong {
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
}

.dd-range-track {
  position: relative;
  height: 8px;
  margin: 0.95rem 8px 0.75rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #f87171 0%, #fbbf24 50%, #34d399 100%);
}

.dd-range-knob {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #141414;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.dd-range-scale {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dd-muted);
  font-variant-numeric: tabular-nums;
}

.dd-ficha-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.dd-ficha-row-text {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
}

.dd-ficha-row-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.95rem;
}

.dd-ficha-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex: 0 0 auto;
  line-height: 1;
}

.dd-ficha-mark.is-ok {
  background: rgba(52, 211, 153, 0.16);
  color: var(--dd-ok);
}

.dd-ficha-mark.is-bad {
  background: rgba(248, 113, 113, 0.16);
  color: var(--dd-bad);
}

.dd-ficha-mark.is-warn {
  background: rgba(251, 191, 36, 0.16);
  color: var(--dd-warn);
}

.dd-ficha-note,
.dd-ficha-empty {
  margin: 0.7rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--dd-muted);
  line-height: 1.45;
}

.dd-ficha-card > .dd-ficha-empty:first-child,
.dd-ficha-top .dd-ficha-empty {
  margin-top: 0;
}

.dd-ficha-entro {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dd-ficha-flags .dd-flags {
  max-width: none;
}

.dd-rs-chart {
  width: 100%;
  height: auto;
  display: block;
}

.dd-ficha-disclaimer {
  margin: 0.4rem 0 0;
  font-size: 0.75rem;
  color: var(--dd-muted-dim);
  line-height: 1.45;
}

.dd-ficha-disclaimer strong {
  color: var(--dd-muted);
  font-weight: 600;
}

@media (max-width: 380px) {
  .dd-ficha-score {
    flex-direction: column;
    align-items: stretch;
  }

  .dd-gauge {
    margin: 0 auto;
  }

  .dd-ficha-price {
    font-size: 1.02rem;
  }
}

@media (min-width: 900px) {
  .dd-ficha {
    padding-top: 1.75rem;
  }
}

/* ── Vista por sectores ── */

.dd-sector-caption,
.dd-sector-note {
  margin: 0 0 0.85rem;
  color: var(--dd-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 68rem;
}

.dd-sector-note {
  margin-bottom: 1.1rem;
  font-size: 0.8rem;
  color: var(--dd-muted-dim);
}

.dd-sector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 0.85rem;
}

.dd-sector-card {
  --heat: 0.4;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.95rem 1rem 0.85rem;
  border-radius: 16px;
  border: 1px solid var(--dd-border);
  background:
    linear-gradient(160deg, rgba(255, 107, 53, calc(var(--heat) * 0.38)) 0%, transparent 62%),
    var(--dd-bg-elevated);
  box-shadow: var(--dd-shadow-sm);
  min-width: 0;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.dd-sector-card:hover,
.dd-sector-card:focus-within {
  border-color: rgba(255, 107, 53, 0.45);
}

.dd-sector-card.is-active {
  border-color: rgba(255, 107, 53, 0.75);
  box-shadow: 0 0 0 1px rgba(255, 107, 53, 0.35), var(--dd-shadow-sm);
}

.dd-sector-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.dd-sector-select {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
  min-width: 0;
}

.dd-sector-name {
  display: block;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.02rem;
}

.dd-sector-count {
  display: block;
  margin-top: 0.1rem;
  color: var(--dd-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.dd-sector-trend {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--dd-muted);
  white-space: nowrap;
}

.dd-sector-trend.is-up {
  color: var(--dd-ok);
  background: rgba(52, 211, 153, 0.12);
}

.dd-sector-trend.is-down {
  color: var(--dd-bad);
  background: rgba(248, 113, 113, 0.12);
}

.dd-sector-trend.is-flat {
  color: var(--dd-warn);
  background: rgba(251, 191, 36, 0.12);
}

.dd-sector-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: -0.2rem;
}

.dd-sector-low {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--dd-warn);
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
}

.dd-sector-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.dd-sector-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--dd-accent-gradient);
  min-width: 0;
}

.dd-sector-bar.dd-score-low > span {
  background: rgba(255, 255, 255, 0.28);
}

.dd-sector-bar.dd-score-mid > span {
  background: linear-gradient(90deg, #c45a32, #ff8c42);
}

.dd-sector-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem 0.6rem;
  margin: 0;
}

.dd-sector-metrics div:nth-child(4),
.dd-sector-metrics div:nth-child(5) {
  grid-column: span 1;
}

.dd-sector-metrics dt {
  margin: 0;
  color: var(--dd-muted-dim);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dd-sector-metrics dd {
  margin: 0.05rem 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dd-sector-metrics .dd-score-high {
  color: #ffb080;
}

.dd-sector-metrics .dd-score-mid {
  color: var(--dd-accent-end);
}

.dd-sector-metrics .dd-score-low {
  color: var(--dd-muted);
}

.dd-sector-best {
  margin: 0;
  font-size: 0.82rem;
  color: var(--dd-muted);
  font-weight: 600;
}

.dd-sector-link {
  color: var(--dd-fg);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 107, 53, 0.55);
}

.dd-sector-link:hover,
.dd-sector-link:focus-visible {
  color: var(--dd-accent-end);
}

.dd-sector-best-score {
  color: var(--dd-muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 420px) {
  .dd-sector-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Resumen, insiders, escáner, salud ── */

.dd-resumen-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
}

.dd-resumen-head .dd-section-title {
  margin-bottom: 0;
}

.dd-resumen-when {
  color: var(--dd-muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.dd-resumen-text {
  margin: 0.9rem 0 0;
  font-size: 1rem;
  line-height: 1.55;
  max-width: 68rem;
}

.dd-link-list {
  display: flex;
  flex-direction: column;
  margin-top: 0.35rem;
}

.dd-link-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.45rem 0.1rem;
  border-bottom: 1px solid var(--dd-border);
  text-decoration: none;
  color: inherit;
}

.dd-link-row:hover,
.dd-link-row:focus-visible {
  color: var(--dd-accent-end);
}

.dd-link-sym {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dd-link-score {
  color: var(--dd-muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.dd-link-extra {
  margin-left: auto;
  color: var(--dd-muted);
  font-size: 0.78rem;
  text-align: right;
  line-height: 1.35;
  white-space: normal;
}

.dd-flag-insider,
.dd-flag[data-flag="insider_buy"] {
  color: var(--dd-ok);
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.4);
}

.dd-pat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dd-pat-chip {
  display: inline-block;
  border-radius: var(--dd-radius-chip);
  padding: 0.28rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--dd-accent-soft);
  color: var(--dd-accent-end);
  border: 1px solid rgba(255, 107, 53, 0.35);
}

.dd-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.5rem;
}

.dd-health-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border: 1px solid var(--dd-border);
  border-radius: 12px;
  padding: 0.55rem 0.65rem;
  background: var(--dd-bg-elevated);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
  min-width: 0;
}

.dd-health-item[data-cue="green"] {
  border-color: rgba(52, 211, 153, 0.5);
}

.dd-health-item[data-cue="amber"] {
  border-color: rgba(251, 191, 36, 0.5);
}

.dd-health-item[data-cue="red"] {
  border-color: rgba(248, 113, 113, 0.5);
}

.dd-health-cue {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--dd-muted);
}

.dd-health-item[data-cue="green"] .dd-health-cue { color: var(--dd-ok); }
.dd-health-item[data-cue="red"] .dd-health-cue { color: var(--dd-bad); }
.dd-health-item[data-cue="amber"] .dd-health-cue { color: var(--dd-warn); }

.dd-ins-tx {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.dd-ins-tx li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.65rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--dd-border);
  font-size: 0.82rem;
}

.dd-ins-name {
  font-weight: 700;
}

.dd-ins-role {
  color: var(--dd-muted);
  font-size: 0.75rem;
}

.dd-ins-side {
  font-weight: 700;
}

.dd-ins-side.is-buy { color: var(--dd-ok); }
.dd-ins-side.is-sell { color: var(--dd-bad); }

.dd-ins-date {
  margin-left: auto;
  color: var(--dd-muted);
  font-variant-numeric: tabular-nums;
}

.dd-scan .dd-filter-group {
  margin: 0.2rem 0 0.6rem;
}

@media (max-width: 640px) {
  .dd-link-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .dd-link-extra {
    margin-left: 0;
    width: 100%;
    text-align: left;
  }

  .dd-resumen-text {
    font-size: 0.95rem;
  }

  .dd-ins-date {
    margin-left: 0;
  }
}

/* ── Semáforo de entrada y analistas ── */

.dd-session-banner {
  max-width: var(--dd-max);
  margin: 0 auto;
  padding: 0 1.25rem 0.55rem;
  color: var(--dd-muted);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.dd-session-banner.is-live::before {
  content: "";
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--dd-ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
  vertical-align: 0.05em;
}

.dd-sample-notice {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
}

.dd-col-luz,
.dd-col-compra {
  text-align: center;
  white-space: nowrap;
}

.dd-luz {
  display: inline-block;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  vertical-align: middle;
  background: var(--dd-muted-dim);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

.dd-luz[data-verdict="verde"] {
  background: var(--dd-ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18), 0 0 10px rgba(52, 211, 153, 0.55);
}

.dd-luz[data-verdict="ambar"] {
  background: var(--dd-warn);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18), 0 0 10px rgba(251, 191, 36, 0.45);
}

.dd-luz[data-verdict="rojo"] {
  background: var(--dd-bad);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18), 0 0 10px rgba(248, 113, 113, 0.45);
}

.dd-buy-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.82rem;
}

.dd-entry-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dd-entry-light {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--dd-muted-dim);
}

.dd-entry-light[data-verdict="verde"] {
  background: var(--dd-ok);
  box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.16), 0 0 16px rgba(52, 211, 153, 0.65);
}

.dd-entry-light[data-verdict="ambar"] {
  background: var(--dd-warn);
  box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.16), 0 0 16px rgba(251, 191, 36, 0.55);
}

.dd-entry-light[data-verdict="rojo"] {
  background: var(--dd-bad);
  box-shadow: 0 0 0 6px rgba(248, 113, 113, 0.16), 0 0 16px rgba(248, 113, 113, 0.55);
}

.dd-entry-card[data-verdict="verde"]::before { background: var(--dd-ok); }
.dd-entry-card[data-verdict="ambar"]::before { background: var(--dd-warn); }
.dd-entry-card[data-verdict="rojo"]::before { background: var(--dd-bad); }

.dd-entry-label {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.dd-entry-checks {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.dd-entry-checks li {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.88rem;
  line-height: 1.35;
}

.dd-entry-mark {
  flex: 0 0 auto;
  width: 1.1rem;
  font-weight: 700;
}

.dd-entry-checks .is-ok .dd-entry-mark { color: var(--dd-ok); }
.dd-entry-checks .is-bad .dd-entry-mark { color: var(--dd-bad); }

.dd-entry-disclaimer {
  margin: 0.85rem 0 0;
  font-size: 0.75rem;
  color: var(--dd-muted);
  line-height: 1.4;
}

.dd-an-bar {
  display: flex;
  height: 14px;
  margin-top: 0.75rem;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}

.dd-an-seg { display: block; height: 100%; }
.dd-an-sb { background: #16a34a; }
.dd-an-b { background: #34d399; }
.dd-an-h { background: #fbbf24; }
.dd-an-s { background: #fb923c; }
.dd-an-ss { background: #f87171; }

.dd-an-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  margin-top: 0.55rem;
  font-size: 0.75rem;
  color: var(--dd-muted);
}

.dd-an-key {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.dd-an-key i {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  display: inline-block;
}

.dd-an-target {
  margin: 0.7rem 0 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 420px) {
  .dd-entry-label { font-size: 1.02rem; }
  .dd-entry-checks li { font-size: 0.82rem; }
  .dd-an-legend { font-size: 0.7rem; }
}

/* ── Historial del semáforo ── */

.dd-hist {
  min-width: 0;
}

.dd-hist-meta,
.dd-hist-sentence,
.dd-hist-split,
.dd-hist-alt,
.dd-hist-rule,
.dd-hist-equity-note,
.dd-hist-disclaimer,
.dd-hist-ficha {
  margin: 0.35rem 0 0;
  color: var(--dd-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.dd-hist-sentence {
  color: var(--dd-fg);
  font-size: 1.02rem;
  margin-top: 0.8rem;
}

.dd-hist-sample {
  margin: 0 0 0.8rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(251, 191, 36, 0.12);
  color: var(--dd-warn);
  font-size: 0.85rem;
}

.dd-hist-groups {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.dd-hist-group {
  border: 1px solid var(--dd-border);
  border-radius: 14px;
  padding: 0.85rem 0.9rem;
  background: var(--dd-bg-elevated);
  min-width: 0;
}

.dd-hist-group h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.dd-hist-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--dd-muted);
  flex: 0 0 auto;
}

.dd-hist-group[data-group="verde"] .dd-hist-dot { background: var(--dd-ok); }
.dd-hist-group[data-group="ambar"] .dd-hist-dot { background: var(--dd-warn); }
.dd-hist-group[data-group="rojo"] .dd-hist-dot { background: var(--dd-bad); }

.dd-hist-horizons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.dd-hist-h {
  min-width: 0;
}

.dd-hist-h .dd-kpi-label {
  margin-bottom: 0.2rem;
}

.dd-hist-prov {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.16);
  color: var(--dd-warn);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.dd-hist-prov-note {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  color: var(--dd-warn);
  line-height: 1.35;
  white-space: normal;
}

.dd-hist-n,
.dd-hist-vs,
.dd-hist-hit,
.dd-hist-more,
.dd-hist-empty {
  margin: 0.12rem 0 0;
  font-size: 0.78rem;
  color: var(--dd-muted);
  line-height: 1.35;
}

.dd-hist-avg {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dd-hist-more {
  font-size: 0.72rem;
}

.dd-hist-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.9rem;
}

.dd-hist-signal {
  display: grid;
  grid-template-columns: 6.4rem minmax(3.2rem, auto) minmax(0, 1fr) auto;
  gap: 0.25rem 0.7rem;
  align-items: baseline;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.03);
}

.dd-hist-signal:hover,
.dd-hist-signal:focus-visible {
  background: var(--dd-card-hover);
  outline: none;
}

.dd-hist-sym {
  font-weight: 700;
}

.dd-hist-tag {
  color: var(--dd-warn);
  font-size: 0.75rem;
}

.dd-hist-svg {
  width: 100%;
  height: auto;
  margin-top: 0.6rem;
  display: block;
}

.dd-hist-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--dd-muted);
}

.dd-hist-legend i {
  display: inline-block;
  width: 0.8rem;
  height: 0.18rem;
  margin-right: 0.3rem;
  vertical-align: middle;
  border-radius: 2px;
}

.dd-hist-legend .is-stocks { background: #ff8c42; }
.dd-hist-legend .is-universe { background: #5b8def; }
.dd-hist-legend .is-spy { background: #a0a0a0; }

.dd-hist-legacy {
  margin-top: 1.25rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dd-hist-legacy > h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.dd-hist-legacy-note,
.dd-hist-def {
  margin: 0 0 0.7rem;
  color: var(--dd-warn, #e0b15a);
  font-size: 0.86rem;
}

.dd-hist-ficha {
  margin: 0.55rem 0 0.15rem;
}

@media (max-width: 720px) {
  .dd-hist-horizons {
    grid-template-columns: 1fr;
  }

  .dd-hist-signal {
    grid-template-columns: 1fr 1fr;
  }

  .dd-hist-signal .dd-hist-ret {
    grid-column: 1 / -1;
  }
}

/* ── Régimen de mercado ── */

.dd-regime-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--dd-ok);
}

.dd-regime-title svg {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}

.dd-regime-accent {
  width: 3px;
  height: 1.05em;
  border-radius: 2px;
  background: var(--dd-ok);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.45);
}

.dd-regime-hero {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  margin-top: 0.85rem;
}

.dd-regime-gauge-wrap {
  position: relative;
  width: 196px;
  height: 118px;
  flex: 0 0 auto;
}

.dd-regime-gauge {
  display: block;
  width: 100%;
  height: auto;
}

.dd-regime-score {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
  line-height: 1;
}

.dd-regime-score-num {
  display: block;
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.dd-regime-score-of {
  display: block;
  margin-top: 0.2rem;
  color: var(--dd-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.dd-regime-exposure {
  flex: 1 1 240px;
  min-width: 0;
  max-width: 440px;
  border: 1px solid var(--regime-color, #ff8c42);
  border-radius: 16px;
  padding: 0.95rem 1.05rem 0.8rem;
  background:
    linear-gradient(180deg, rgba(255, 140, 66, 0.06), rgba(0, 0, 0, 0.18));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.dd-regime[data-band="red"] .dd-regime-exposure {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.08), rgba(0, 0, 0, 0.2));
}

.dd-regime[data-band="yellow"] .dd-regime-exposure {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.08), rgba(0, 0, 0, 0.2));
}

.dd-regime[data-band="green"] .dd-regime-exposure {
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.08), rgba(0, 0, 0, 0.2));
}

.dd-regime-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c4c4c4;
}

.dd-regime-exposure-line {
  margin: 0.35rem 0 0;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.015em;
  color: var(--regime-color, #ff8c42);
}

.dd-regime-disclaimer {
  margin: 0.55rem 0 0;
  font-size: 0.68rem;
  line-height: 1.35;
  font-weight: 500;
  color: var(--dd-muted-dim);
}

.dd-regime-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.78rem 0.1rem;
  border-top: 1px solid var(--dd-border);
}

.dd-regime-hero + .dd-regime-row {
  margin-top: 0.85rem;
}

.dd-regime-ico {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #d7d7d7;
}

.dd-regime-ico svg {
  width: 22px;
  height: 22px;
}

.dd-regime-row-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.dd-regime-row-sub {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--dd-muted-dim);
  line-height: 1.35;
}

.dd-regime-pts {
  flex: 0 0 auto;
  font-size: 0.98rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.dd-regime-pts.is-green { color: var(--dd-ok); }
.dd-regime-pts.is-orange { color: #ff8c42; }
.dd-regime-pts.is-red { color: var(--dd-bad); }
.dd-regime-pts.is-yellow { color: var(--dd-warn); }
.dd-regime-pts.is-muted { color: var(--dd-muted); }

.dd-regime-hl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 0.1rem;
  border-top: 1px solid var(--dd-border);
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.dd-regime-hoy {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.38rem;
  border-radius: 5px;
  background: #3b82f6;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.dd-regime-hl-high { color: var(--dd-ok); }
.dd-regime-hl-low { color: #fb7185; }

.dd-regime-chart-title {
  margin: 0.85rem 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #bdbdbd;
}

.dd-regime-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.dd-regime-chart-empty {
  margin: 0.4rem 0 0;
  color: var(--dd-muted);
  font-size: 0.85rem;
}

.dd-regime-foot {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: #8a8a8a;
}

@media (max-width: 720px) {
  .dd-regime-hero {
    gap: 0.85rem;
  }

  .dd-regime-gauge-wrap {
    width: 148px;
    height: 96px;
  }

  .dd-regime-score-num {
    font-size: 2.35rem;
  }

  .dd-regime-exposure {
    max-width: none;
    padding: 0.75rem 0.8rem 0.65rem;
  }

  .dd-regime-exposure-line {
    font-size: 0.98rem;
  }

  .dd-regime-row-label,
  .dd-regime-hl,
  .dd-regime-pts {
    font-size: 0.9rem;
  }
}

@media (max-width: 390px) {
  .dd-regime-gauge-wrap {
    width: 124px;
    height: 84px;
  }

  .dd-regime-score-num {
    font-size: 1.9rem;
  }

  .dd-regime-score-of {
    font-size: 0.68rem;
  }

  .dd-regime-kicker {
    font-size: 0.62rem;
  }

  .dd-regime-exposure-line {
    font-size: 0.88rem;
  }
}

/* ── Jerarquía simple: hoy, ranking, detalle plegado ── */

:root {
  --dd-radius-card: 16px;
  --dd-shadow: none;
  --dd-shadow-sm: none;
  --dd-space: 14px;
}

body.is-ficha .dd-topbar {
  display: none;
}

.dd-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(13, 13, 13, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--dd-border);
}

.dd-topbar .dd-header {
  border-bottom: 0;
  padding-top: 0.7rem;
  padding-bottom: 0.15rem;
}

.dd-section-nav-inner {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  max-width: var(--dd-max);
  margin: 0 auto;
  padding: 0.35rem 1.25rem 0.65rem;
  scrollbar-width: none;
}

.dd-section-nav-inner::-webkit-scrollbar {
  display: none;
}

.dd-section-nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--dd-border);
  background: transparent;
  color: var(--dd-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.dd-section-nav a.is-active {
  color: #fff;
  border-color: rgba(255, 107, 53, 0.55);
  background: var(--dd-accent-soft);
}

.dd-main {
  gap: 0.8rem;
  padding-top: 0.9rem;
}

#hoy,
#top10,
#ranking,
#earnings,
.dd-fold,
.dd-more-label {
  scroll-margin-top: var(--dd-topbar-h, 8.6rem);
}

.dd-hoy {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dd-panel {
  box-shadow: none;
}

.dd-panel:hover {
  border-color: var(--dd-border-strong);
}

.dd-kpi-card:hover,
.dd-top10-card:hover {
  transform: none;
  box-shadow: none;
}

.dd-section-title {
  margin-bottom: 0.7rem;
}

.dd-section-sub {
  margin-top: -0.35rem;
}

.dd-resumen-text {
  margin-top: 0.55rem;
}

.dd-resumen-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dd-text-more {
  appearance: none;
  margin: 0.45rem 0 0;
  padding: 0.35rem 0;
  border: 0;
  background: none;
  color: var(--dd-accent-end);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}

.dd-today-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.dd-today-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-align: left;
  text-decoration: none;
  color: inherit;
  background: var(--dd-card);
  border: 1px solid var(--dd-border);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  min-height: 92px;
  font: inherit;
  cursor: pointer;
}

.dd-today-stat .dd-kpi-value {
  font-size: 1.7rem;
}

.dd-today-stat .dd-kpi-sub {
  color: var(--dd-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

#today-clear {
  color: var(--dd-ok);
}

.dd-kpis-wrap .dd-kpis {
  gap: 0.6rem;
}

.dd-kpis-wrap .dd-kpi-card {
  background: rgba(255, 255, 255, 0.03);
  min-height: 0;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  box-shadow: none;
}

.dd-kpis-wrap .dd-kpi-value {
  font-size: 1.35rem;
  margin-top: 0.25rem;
}

.dd-help {
  margin: 0.15rem 0 0.75rem;
}

.dd-help summary {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 32px;
  cursor: pointer;
  color: var(--dd-muted);
  font-size: 0.82rem;
  font-weight: 650;
  list-style: none;
}

.dd-help summary::-webkit-details-marker {
  display: none;
}

.dd-help-i {
  color: var(--dd-accent-end);
  font-style: normal;
}

.dd-help p,
.dd-help .dd-wf-caption,
.dd-help .dd-sector-caption,
.dd-help .dd-sector-note,
.dd-help .dd-tip {
  margin: 0.4rem 0 0;
  color: var(--dd-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.dd-score {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--dd-fg);
}

.dd-score.dd-score-high {
  background: rgba(52, 211, 153, 0.16);
  box-shadow: none;
  color: var(--dd-ok);
}

.dd-score.dd-score-mid {
  background: rgba(251, 191, 36, 0.16);
  box-shadow: none;
  color: var(--dd-warn);
}

.dd-score.dd-score-low {
  background: rgba(248, 113, 113, 0.14);
  box-shadow: none;
  color: var(--dd-bad);
}

.dd-kind[data-kind="etf"],
.dd-kind[data-kind="cedear_proxy"],
.dd-kind[data-kind="us"] {
  color: var(--dd-muted);
  border-color: var(--dd-border);
  background: rgba(255, 255, 255, 0.04);
}

.dd-scroll-hint {
  display: none;
  margin: 0.15rem 0 0.4rem;
  color: var(--dd-muted-dim);
  font-size: 0.75rem;
}

.dd-more-label h2 {
  margin: 0.35rem 0 0.1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dd-muted);
}

.dd-more-label p {
  margin: 0;
  color: var(--dd-muted-dim);
  font-size: 0.85rem;
}

.dd-fold {
  background: var(--dd-card);
  border: 1px solid var(--dd-border);
  border-radius: 16px;
}

.dd-fold-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 58px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  list-style: none;
}

.dd-fold-summary::-webkit-details-marker {
  display: none;
}

.dd-fold-summary::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.2rem;
  border-right: 2px solid var(--dd-muted);
  border-bottom: 2px solid var(--dd-muted);
  transform: rotate(45deg) translateY(-2px);
  flex: 0 0 auto;
}

.dd-fold[open] > .dd-fold-summary::after {
  transform: rotate(-135deg) translateY(-2px);
}

.dd-fold-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dd-fold-hint {
  display: block;
  margin-top: 0.12rem;
  color: var(--dd-muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
}

.dd-fold-body {
  padding: 0.15rem 1rem 1rem;
  border-top: 1px solid var(--dd-border);
}

.dd-fold-body .dd-panel {
  background: transparent;
  border: 0;
  padding: 0.75rem 0 0;
  border-radius: 0;
}

.dd-formula-list {
  margin: 0;
}

.dd-formula-list > div {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--dd-border);
}

.dd-formula-list dt {
  font-weight: 700;
  font-size: 0.92rem;
}

.dd-formula-list dd {
  margin: 0.2rem 0 0;
  color: var(--dd-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.dd-earn-eps {
  display: block;
  width: 100%;
  color: var(--dd-muted);
  font-size: 0.75rem;
}

.dd-footer .dd-disclaimer {
  color: var(--dd-muted-dim);
  font-size: 0.78rem;
}

.dd-meta .dd-value {
  word-break: normal;
}

@media (max-width: 720px) {
  .dd-scroll-hint {
    display: block;
  }

  .dd-topbar .dd-label {
    display: none;
  }

  .dd-topbar .dd-meta .dd-value {
    font-size: 0.78rem;
  }

  .dd-topbar .dd-refresh-status,
  .dd-topbar .dd-last-ui-refresh:not([hidden]) {
    display: inline;
    margin-top: 0;
  }

  .dd-topbar .dd-logo {
    width: 30px;
    height: 28px;
  }

  .dd-topbar .dd-header {
    padding: 0.4rem 0.75rem 0;
    gap: 0.5rem;
  }

  .dd-section-nav-inner {
    padding-top: 0.2rem;
    padding-bottom: 0.4rem;
  }

  .dd-topbar .dd-header-actions {
    flex-direction: row;
    align-items: center;
    gap: 0.45rem;
  }

  .dd-topbar .dd-meta {
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .dd-topbar .dd-btn-refresh {
    width: auto;
    min-height: 36px;
    padding: 0.4rem 0.7rem;
  }

  .dd-topbar .dd-title {
    font-size: 1.25rem;
  }

  .dd-section-nav-inner {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .dd-session-banner {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    font-size: 0.72rem;
  }

  .dd-main,
  .dd-footer {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .dd-today-stats {
    grid-template-columns: 1fr 1fr;
  }

  .dd-today-stat .dd-kpi-value {
    font-size: 1.45rem;
  }

  .dd-kpis-wrap .dd-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dd-fold-body,
  .dd-fold-summary {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
}

/* ── Secciones: una a la vez, barra abajo en el teléfono ── */

.dd-pane:not(.is-on) {
  display: none !important;
}

.dd-tabbar {
  display: flex;
  gap: 0.2rem;
  max-width: var(--dd-max);
  margin: 0 auto;
  padding: 0.35rem 0.75rem 0.55rem;
}

.dd-tabbar a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-height: 46px;
  padding: 0.3rem 0.15rem;
  border-radius: 12px;
  color: var(--dd-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.dd-tabbar a svg {
  width: 22px;
  height: 22px;
}

.dd-tabbar a.is-active {
  color: var(--dd-accent-start);
  background: var(--dd-accent-soft);
}

.dd-podio-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 0.55rem;
  align-items: stretch;
}

.dd-podio-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.75rem 0.7rem 0.8rem;
  border: 1px solid var(--dd-border);
  border-radius: 16px;
  background: #161616;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.dd-podio-card.is-first {
  border-color: rgba(255, 107, 53, 0.45);
  background: radial-gradient(120% 80% at 0% 0%, rgba(255, 107, 53, 0.16), #161616 55%);
}

.dd-podio-pos {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--dd-muted);
}

.dd-podio-score {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--dd-ok);
}

.dd-podio-card .dd-gauge {
  width: 84px;
  margin: 0;
}

.dd-podio-id {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.dd-podio-id span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dd-podio-id strong {
  font-size: 0.95rem;
}

.dd-podio-id em {
  font-style: normal;
  font-size: 0.68rem;
  color: var(--dd-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dd-sig-table {
  min-width: 46rem;
}

.dd-sig-table th,
.dd-sig-table td {
  text-align: center;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
}

.dd-sig-table .dd-col-ticker,
.dd-sig-table td.dd-col-ticker {
  left: 0;
  text-align: left;
  min-width: 7.4rem;
}

.dd-sig-ticker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.dd-pager[hidden],
.dd-rrg-extra[hidden] {
  display: none !important;
}

.dd-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.dd-pager button {
  min-height: 36px;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--dd-border-strong);
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
}

.dd-pager button:disabled {
  opacity: 0.35;
}

.dd-pager span {
  color: var(--dd-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.dd-sig-tools,
.dd-rrg-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.2rem 0 0.7rem;
}

.dd-select,
.dd-sig-tools .dd-search {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--dd-border-strong);
  background: #141414;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.25rem 0.55rem;
}

.dd-sig-tools .dd-search {
  flex: 1 1 10rem;
}

.dd-universe-mark,
.dd-rrg-cap {
  margin: 0.35rem 0 0.7rem;
  color: var(--dd-muted);
  font-size: 0.78rem;
}

.dd-rrg-cap:empty {
  display: none;
}

.dd-sigdot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  vertical-align: middle;
}

.dd-sigdot.is-on {
  background: var(--dd-ok);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.dd-sig-n {
  font-weight: 700;
  color: var(--dd-muted);
}

.dd-sig-n.is-hot {
  color: var(--dd-ok);
}

.dd-sig-lists {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1rem;
}

.dd-sig-list h3 {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
}

.dd-sig-count,
.dd-sig-quiet {
  color: var(--dd-muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.dd-sig-quiet {
  margin: 0.2rem 0 0;
}

.dd-sig-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.dd-sig-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.14);
  color: var(--dd-ok);
  font-size: 0.78rem;
  font-weight: 650;
}

.dd-rrg-stage {
  position: relative;
  margin-top: 0.35rem;
}

.dd-rrg-svg {
  display: block;
  width: 100%;
  height: auto;
}

.dd-rrg-hit {
  cursor: pointer;
}

.dd-rrg-tip[hidden] {
  display: none !important;
}

.dd-rrg-tip {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 9.5rem;
  max-width: 14rem;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  border: 1px solid var(--dd-border-strong);
  background: rgba(18, 18, 18, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 0.75rem;
  color: var(--dd-muted);
  pointer-events: none;
}

.dd-rrg-tip strong {
  color: #fff;
  font-size: 0.9rem;
}

.dd-rrg-controls {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.45rem;
}

.dd-rrg-play {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 107, 53, 0.55);
  background: var(--dd-accent-soft);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.dd-rrg-play[aria-pressed="true"] {
  background: var(--dd-accent-gradient);
  border-color: transparent;
}

.dd-rrg-controls input[type="range"] {
  flex: 1 1 auto;
  accent-color: #ff6b35;
}

.dd-rrg-frame {
  flex: 0 0 auto;
  min-width: 5.5rem;
  text-align: right;
  color: var(--dd-muted);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.dd-rrg-notes {
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dd-rrg-notes li {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: #161616;
  border: 1px solid var(--dd-border);
  color: #ececec;
  font-size: 0.84rem;
}

.dd-suggest {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.4rem 0 0.6rem;
}

.dd-suggest button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 40px;
  padding: 0.3rem 0.45rem;
  border: 0;
  border-radius: 10px;
  background: #1a1a1a;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dd-suggest button span {
  color: var(--dd-muted);
  font-size: 0.8rem;
}

#analisis .dd-ficha {
  max-width: none;
  margin: 0.4rem 0 0;
  padding: 0;
}

#analisis .dd-search {
  width: 100%;
}

@media (max-width: 899px) {
  body {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  .dd-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    max-width: none;
    margin: 0;
    padding: 0.2rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom, 0px));
    background: rgba(13, 13, 13, 0.96);
    border-top: 1px solid var(--dd-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .dd-podio-grid {
    grid-template-columns: 1fr;
  }

  .dd-podio-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .dd-podio-card.is-first {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 900px) {
  .dd-tabbar {
    border-bottom: 1px solid var(--dd-border);
  }

  .dd-tabbar a {
    flex-direction: row;
    gap: 0.4rem;
    font-size: 0.86rem;
    min-height: 42px;
  }

  .dd-rrg-svg {
    max-height: 520px;
  }
}
