/* SPRINT-C-002 — Informe dinámico: score circular + delta + benchmark
 * Mobile-first (base ~380px), desktop media query at the end.
 * Uses --y-* tokens from tokens.css. Inside .diag-completa these resolve
 * to the page-local light overrides (see completa.html <style> block).
 */

.y-informe-dinamico {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 0.5rem;
  box-sizing: border-box;
}

/* ── Score hero: stacked on mobile, side-by-side on desktop ── */
.y-score-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* ── Circular score (SVG) ── */
.y-score-circular {
  width: 140px;
  height: 140px;
  flex: 0 0 auto;
  display: block;
}
.y-score-track {
  fill: none;
  stroke: var(--y-border-input, rgba(0,0,0,0.08));
  stroke-width: 10;
}
.y-score-progress {
  fill: none;
  stroke: var(--y-brand);
  stroke-width: 10;
  stroke-linecap: round;
  /* stroke-dasharray="<score> 100" set inline; pathLength=100 normalizes */
  transition: stroke-dasharray 0.6s ease;
}
.y-score-num {
  fill: var(--y-text, var(--y-text-1));
  font-family: var(--y-font-sans, system-ui, sans-serif);
  font-size: 2.25rem;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}
.y-score-denom {
  fill: var(--y-text-secondary, var(--y-text-3));
  font-family: var(--y-font-sans, system-ui, sans-serif);
  font-size: 0.875rem;
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* ── Delta block ── */
.y-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
}
.y-delta-arrow { font-size: 0.75rem; line-height: 1; }
.y-delta-value { font-weight: 700; }
.y-delta-label { font-weight: 500; opacity: 0.85; }

.y-delta--positive {
  color: var(--y-brand);
  background: var(--y-brand-subtle, rgba(27,109,99,0.10));
}
.y-delta--negative {
  color: var(--y-amber, #D4891A);
  background: var(--y-amber-subtle, rgba(212,137,26,0.10));
}
.y-delta--neutral {
  color: var(--y-text-secondary, var(--y-text-3));
  background: var(--y-border, rgba(0,0,0,0.07));
}
.y-delta--first {
  color: var(--y-text-secondary, var(--y-text-3));
  background: var(--y-border, rgba(0,0,0,0.07));
}

/* ── Benchmark bar ── */
.y-benchmark {
  margin-top: 1.75rem;
  padding: 0 0.5rem;
}
.y-benchmark-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--y-amber-subtle, rgba(212,137,26,0.18)) 0%,
    var(--y-brand-subtle, rgba(27,109,99,0.18)) 100%
  );
  margin: 2.25rem 0 2.5rem;
}
.y-benchmark-marker {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 16px;
  transform: translate(-50%, -50%);
  background: var(--y-text-secondary, var(--y-text-3));
}
.y-benchmark-marker span {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--y-text-secondary, var(--y-text-3));
}
/* Media + Top labels above the bar; You label below to avoid overlap */
.y-benchmark-marker--media,
.y-benchmark-marker--top {
  background: var(--y-text-muted, var(--y-text-3));
}
.y-benchmark-marker--media span,
.y-benchmark-marker--top span {
  bottom: calc(100% + 4px);
}
.y-benchmark-marker--you {
  width: 3px;
  height: 22px;
  background: var(--y-brand);
}
.y-benchmark-marker--you span {
  top: calc(100% + 4px);
  color: var(--y-brand);
  font-weight: 700;
}

/* ── Desktop ── */
@media (min-width: 768px) {
  .y-informe-dinamico { padding: 2rem 2rem 0.5rem; }
  .y-score-hero {
    flex-direction: row;
    justify-content: center;
    gap: 2.5rem;
  }
  .y-score-circular { width: 160px; height: 160px; }
  .y-benchmark { max-width: 40rem; margin: 1.75rem auto 0; }
}

/* SPRINT-C-003 — Dimensiones grid 2x2 con highlight de dimensión mínima.
 * No existe token --y-space-3 en tokens.css; se usa 1rem (consistente con
 * el gap del .y-score-hero en C-002). Mobile-first: 2 columnas SIEMPRE.
 */
.y-dimensiones-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 40rem;
  margin: 0 auto;
}
.y-dim-card {
  padding: 0.75rem 0.85rem;
  border-radius: 12px;
  background: var(--y-surface-sub, #F0FAF8);
  border: 1px solid var(--y-border, rgba(0,0,0,0.07));
  box-sizing: border-box;
}
.y-dim-card--min {
  border: 1px solid var(--y-amber, #D4891A);
  background: var(--y-amber-subtle, rgba(212,137,26,0.10));
}
.y-dim-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--y-text-secondary, var(--y-text-3));
}
.y-dim-score {
  margin-top: 0.15rem;
  font-family: var(--y-font-sans, system-ui, sans-serif);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--y-text, var(--y-text-1));
  line-height: 1.1;
}
.y-dim-denom {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--y-text-secondary, var(--y-text-3));
}
.y-dim-bar {
  margin-top: 0.5rem;
  height: 6px;
  border-radius: 3px;
  background: var(--y-border, rgba(0,0,0,0.08));
  overflow: hidden;
}
.y-dim-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--y-brand);
  /* width set inline */
  transition: width 0.6s ease;
}

@media (min-width: 768px) {
  .y-dimensiones-grid { margin: 0.5rem auto 0; }
  .y-dim-card { padding: 1rem 1.1rem; }
}

/* SPRINT-C-004 — Evolución: tabs de rango temporal + gráfico SVG.
   Mobile-first, consistente con bloques previos. */
.y-evolucion {
  margin: 1.25rem auto 0;
  max-width: 420px;
}
.y-evolucion .y-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
.y-evolucion .y-tab {
  flex: 0 0 auto;
  padding: 0.4rem 0.95rem;
  border: 1px solid var(--y-border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--y-text-3);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.y-evolucion .y-tab:hover {
  border-color: var(--y-brand);
}
.y-evolucion .y-tab--active {
  background: var(--y-brand, #1B6D63);
  border-color: var(--y-brand, #1B6D63);
  color: #fff;
}
.y-evolucion .y-tab:focus-visible {
  outline: 2px solid var(--y-brand, #1B6D63);
  outline-offset: 2px;
}
.y-chart-wrap {
  position: relative;
  width: 100%;
  height: 160px;
}
.y-chart {
  width: 100%;
  height: 100%;
  display: block;
}
.y-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: var(--y-text-3);
  font-size: 0.9rem;
}

/* SPRINT-C-005 */
.y-acciones-recientes {
  margin-top: 1.5rem;
}
.y-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--y-text-1, #1A1A1A);
}
.y-acciones-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.y-accion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--y-border, rgba(0,0,0,0.07));
}
.y-accion-item:last-child {
  border-bottom: none;
}
.y-accion-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  color: var(--y-brand);
  background: var(--y-brand-subtle, rgba(27,109,99,0.10));
}
.y-accion-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}
.y-accion-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}
.y-accion-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--y-text-1, #1A1A1A);
}
.y-accion-meta {
  font-size: 0.78rem;
  color: var(--y-text-secondary, var(--y-text-3));
}
.y-accion-delta {
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
}
.y-accion-delta--pos {
  color: var(--y-brand);
  background: var(--y-brand-subtle, rgba(27,109,99,0.10));
}
.y-accion-delta--neg {
  color: var(--y-amber, #D4891A);
  background: var(--y-amber-subtle, rgba(212,137,26,0.10));
}
.y-empty-state {
  margin: 0;
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--y-text-secondary, var(--y-text-3));
  font-size: 0.88rem;
}
.y-cta-dinamico {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 12px;
  background: var(--y-brand-subtle, rgba(27,109,99,0.10));
  text-align: center;
}
.y-cta-titulo {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--y-brand);
}
.y-cta-cuerpo {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--y-text-1, #1A1A1A);
}
.y-cta-boton {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 9999px;
  background: var(--y-brand);
  color: #FFFFFF;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}
.y-cta-boton:hover {
  filter: brightness(0.95);
}
