/* ==========================================================================
   Retención: dos curvas que se dibujan y una línea de lectura por día.
   ========================================================================== */

.aret {
  background: var(--panel);
  color: var(--panel-ink);
}
.aret__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}
.aret .h2 {
  color: #fff;
}
.aret__lede {
  margin-top: 20px;
  color: var(--panel-muted);
  max-width: 50ch;
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}
.aret__kpis {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  color: var(--panel-muted);
}
.aret__kpis li {
  padding-left: 22px;
  position: relative;
}
.aret__kpis li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--brand-lime);
}
.aret__kpis b {
  color: #fff;
  font-weight: 500;
}

.aret__chart {
  margin: 0;
  padding: clamp(20px, 3vw, 32px);
  border-radius: 28px;
  background: var(--panel-2);
  border: 1px solid var(--panel-line);
}
.aret__days {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}
.aret__days button {
  border: 0;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 999px;
  background: none;
  color: var(--panel-muted);
  font: 600 0.875rem/1 var(--f-display);
  transition:
    background-color 200ms ease,
    color 200ms ease,
    transform 160ms var(--ease-out);
}
.aret__days button[aria-pressed='true'] {
  background: var(--brand-lime);
  color: #1b1e3b;
}
.aret__days button:active {
  transform: scale(0.96);
}
.aret__plot {
  position: relative;
  margin-top: 22px;
}
.aret__plot svg {
  display: block;
  width: 100%;
  height: clamp(220px, 28vw, 320px);
  overflow: visible;
}
.aret__grid-lines line {
  stroke: var(--panel-line);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.curve {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.curve--install {
  stroke: #8f93b8;
  stroke-dasharray: 0.012 0.012;
  stroke-dashoffset: 0;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1400ms var(--ease-io);
}
.curve--value {
  stroke: var(--brand-lime);
  transition: stroke-dashoffset 1600ms var(--ease-io) 700ms;
}
.aret.on .curve--install {
  clip-path: inset(0 0 0 0);
}
.aret.on .curve--value {
  stroke-dashoffset: 0;
}
.aret__scan {
  stroke: #fff;
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
  vector-effect: non-scaling-stroke;
  transform: translateX(var(--x, 141px));
  transition: transform 520ms var(--ease-out);
}
.aret__read {
  position: absolute;
  top: 8%;
  right: 0;
  display: grid;
  gap: 8px;
  justify-items: end;
}
.aret__pill {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(14, 16, 40, 0.55);
  font-size: 0.8125rem;
  color: var(--panel-muted);
}
.aret__pill b {
  font: 700 1.375rem/1 var(--f-display);
  transition:
    opacity 180ms ease,
    filter 180ms ease;
}
.aret__pill--value b {
  color: var(--brand-lime);
}
.aret__pill--install b {
  color: #fff;
}
.aret__read.swap b {
  opacity: 0;
  filter: blur(3px);
}
.aret__axis {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--panel-muted);
}
.aret__chart figcaption {
  margin-top: 18px;
  font-size: 0.875rem;
  color: var(--panel-muted);
}
.aret__tag {
  display: inline-block;
  margin-right: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(232, 251, 140, 0.12);
  color: var(--brand-lime);
  font-size: 0.75rem;
  font-weight: 600;
}
@media (scripting: none) {
  .curve--install {
    clip-path: none;
  }
  .curve--value {
    stroke-dashoffset: 0;
  }
}
@media (max-width: 960px) {
  .aret__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .aret__read {
    position: static;
    margin-top: 14px;
    justify-items: stretch;
  }
  .aret__pill {
    justify-content: space-between;
  }
}

/* Celular: botones de D1, D7 y D30 con área de toque de 40 px. */
@media (max-width: 760px) {
  .aret__days button {
    min-height: 40px;
    min-width: 52px;
  }
}
