/* MIND FIRST — "Mi progreso" (rediseño v3 "Estudio de noche"). Gráficos en SVG/HTML propio: sin librerías externas.
   Mismo código de autoría que el resto de la app: lo tuyo en azul aciano, lo de la IA en violeta. */

.principal { container-type: inline-size; container-name: principal; }
.progreso { flex: 1; overflow-y: auto; min-height: 0; }
.progreso__grid {
  max-width: 1180px; margin: 0 auto; padding: clamp(28px, 4vw, 48px) clamp(16px, 3vw, 36px) 64px;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; align-content: start;
}
.progreso__cab { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.progreso__titulos { display: flex; flex-direction: column; gap: 6px; }
.progreso__titulos .hero__kicker { display: none; }
.progreso__titulos h1 { margin: 0; font-size: clamp(32px, 4vw, 44px); letter-spacing: -0.03em; }
.progreso__aviso { grid-column: 1 / -1; margin: -4px 0 10px; display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text-2); }
.progreso__aviso .ico { color: var(--vos); font-size: 17px; }
.progreso__vacio { grid-column: 1 / -1; padding: 28px; border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--borde-papel);
  color: var(--text-2); font-size: 15px; text-align: center; }

/* tarjetas */
.card-p {
  padding: 20px 22px 18px; border-radius: var(--radius-xl); background: var(--surface);
  box-shadow: var(--borde-papel), var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; min-width: 0;
  animation: mfIn 0.5s var(--ease-salida) both;
}
.card-p--ancho { grid-column: 1 / -1; }
.card-p--mitad { grid-column: span 6; }
.card-p__cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.card-p__cab h2 { margin: 0; font-size: 18px; }
.card-p__der { display: flex; align-items: center; gap: 14px; }
.card-p__texto { margin: 4px 0 0; font-size: 13.5px; color: var(--text-2); text-wrap: pretty; }
.card-p__mono { font-size: 12px; color: var(--text-3); }
.card-p__mono b { font-weight: 600; color: var(--text); }
.card-p__nota { font-size: 12.5px; color: var(--text-3); }
@container principal (max-width: 940px) {
  .card-p--mitad { grid-column: 1 / -1; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.leyenda { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.leyenda span { display: flex; align-items: center; gap: 7px; }
.leyenda__linea { width: 16px; height: 3px; border-radius: 2px; background: var(--vos); display: inline-block; }
.leyenda__guion { width: 16px; border-top: 2px dashed var(--text-3); display: inline-block; }
.leyenda__cuadro { width: 10px; height: 10px; border-radius: 3px; background: var(--vos); display: inline-block; }
.leyenda__cuadro--ia { background: var(--ia); opacity: 0.6; }
.sesion-select { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.sesion-select .input { min-height: 38px; font-size: 13.5px; max-width: 100%; }

/* curva */
.curva { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; margin-top: 8px; }
.curva__eje { position: relative; height: 240px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-4); }
.curva__eje span { position: absolute; right: 0; transform: translateY(-50%); }
.curva__area { position: relative; height: 240px; }
.curva__area svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.curva__area .linea { stroke: var(--vos); }
.curva__punto { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; background: var(--surface);
  box-shadow: 0 0 0 2.5px var(--vos); transition: width 0.15s, height 0.15s; width: 9px; height: 9px; }
.curva__punto--hover { width: 13px; height: 13px; background: var(--vos); }
.curva__guia { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-fuerte); pointer-events: none; }
.curva__zonas { position: absolute; inset: 0; display: flex; }
.curva__zonas div { flex: 1; }
.tooltip { position: absolute; transform: translate(-50%, calc(-100% - 16px)); pointer-events: none; padding: 9px 12px; border-radius: 10px; background: var(--surface-3);
  box-shadow: var(--borde-papel), var(--shadow-lg); font-size: 12.5px; white-space: nowrap; display: flex; flex-direction: column; gap: 2px; z-index: 5; }
:root[data-tema="claro"] .tooltip { background: var(--surface); }
.tooltip span:nth-child(1) { color: var(--text-3); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.tooltip span:nth-child(2) { color: var(--text); font-weight: 600; }
.tooltip span:nth-child(3) { color: var(--text-2); }
.curva__ejex { grid-column: 2; display: flex; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-4); }
.curva__ejex span { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* KPIs: una sola franja de números, no una grilla de tarjetas sueltas */
.kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden;
  border-radius: var(--radius-xl); background: var(--line); box-shadow: var(--borde-papel), var(--shadow-sm); }
.kpi.glow-box { border-radius: 0; box-shadow: none; animation: none; background: var(--surface); }
.kpi.glow-box:focus-within { box-shadow: none; }
.kpi__in { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; }
.kpi__t { font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.kpi__fila { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.kpi__v { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi__a { font-size: 12px; color: var(--text-3); display: block; margin-top: 2px; }
.kpi svg { width: 72px; height: 30px; flex: none; overflow: visible; }
.kpi svg polyline { stroke: var(--vos); stroke-width: 1.75; }

/* barras vos / ia */
.barras { display: flex; gap: 10px; height: 200px; padding-top: 6px; }
.barras__col { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; max-width: 64px; margin-inline: auto; }
.barras__pila { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.barras__ia { flex: 1; border-radius: 6px 6px 2px 2px; background: var(--ia-suave); box-shadow: inset 0 0 0 1px var(--ia-borde); }
.barras__yo { border-radius: 2px 2px 6px 6px; background: var(--vos); min-height: 3px; }
.barras__lbl { text-align: center; font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* comparativa */
.comparativa { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.cmp { display: flex; flex-direction: column; gap: 7px; }
.cmp__cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cmp__cab span:first-child { font-size: 13.5px; font-weight: 500; color: var(--text); }
.cmp__cab span:last-child { font-family: var(--font-mono); font-size: 12px; color: var(--vos-texto); }
.cmp__pista { position: relative; height: 10px; border-radius: 6px; background: var(--surface-3); }
.cmp__actual { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--vos); }
.cmp__marca { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px var(--surface); }
.cmp__pie { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* tabla */
.tabla-scroll { overflow-x: auto; margin-inline: -8px; }
.tabla .t-fecha { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.tabla .t-sesion { min-width: 200px; font-weight: 500; }
.tabla .t-sesion--borrada { color: var(--text-4); font-weight: 400; font-style: italic; }
.tabla .t-mono { font-family: var(--font-mono); font-size: 12.5px; }
.tabla .t-ip { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; }
.tabla .t-ip > span:first-child { width: 26px; text-align: right; }
.tabla .t-ip .mini { width: 56px; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.tabla .t-ip .mini i { display: block; height: 100%; border-radius: 4px; background: var(--vos); }

/* selector de sesiones (uno por gráfico) */
.selector { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.selector__resumen { margin: 0; font-size: 12.5px; color: var(--text-3); }
.selector__boton { border: 1px solid var(--line-fuerte); background: var(--surface-2); color: var(--text); border-radius: 9px; padding: 6px 12px; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s; }
.selector__boton:hover { background: var(--surface-3); }
.selector__boton[aria-expanded="true"] { border-color: var(--ia); box-shadow: 0 0 0 3px var(--ia-suave); }
.selector__panel { position: absolute; top: 100%; right: 0; z-index: 20; width: min(100%, 360px); margin-top: 6px; padding: 12px; border-radius: 14px;
  background: var(--surface-2); box-shadow: var(--borde-papel), var(--shadow-lg); animation: mfIn 0.2s var(--ease-salida) both; }
:root[data-tema="claro"] .selector__panel { background: var(--surface); }
.selector__acciones { display: flex; gap: 6px; margin-bottom: 8px; }
.selector__atajo { border: 0; background: var(--ia-suave); color: var(--ia-fuerte); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 500; cursor: pointer; }
:root[data-tema="claro"] .selector__atajo { color: var(--ia); }
.selector__atajo:hover { background: var(--ia); color: #fff; }
.selector__lista { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.selector__item { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.selector__item:hover { background: var(--surface-3); }
:root[data-tema="claro"] .selector__item:hover { background: var(--surface-2); }
.selector__item input { accent-color: var(--marca-solida); }
.selector__nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selector__fecha { flex: none; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }

/* ayuda: botón "?" y card */
.ayuda-btn { flex: none; width: 28px; height: 28px; border-radius: 999px; border: 1px solid var(--line-fuerte); background: transparent; color: var(--text-2);
  font: 600 13px var(--font-body); cursor: pointer; transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
.ayuda-btn:hover { background: var(--ia-suave); border-color: var(--ia-borde); color: var(--ia-fuerte); }
.ayuda-card { width: min(94vw, 520px); max-height: 88vh; overflow-y: auto; gap: 14px; }
.ayuda-card__bloque { margin: 0; }
.ayuda-card__bloque h3 { margin: 0 0 4px; font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--ia-fuerte); }
:root[data-tema="claro"] .ayuda-card__bloque h3 { color: var(--ia); }
.ayuda-card__bloque p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-2); }

@media (max-width: 640px) {
  .card-p { padding: 16px; }
  .kpi__v { font-size: 26px; }
  .progreso__cab { align-items: flex-start; }
}
/* (va al final para ganarle a la definición base de .kpis) */
@container principal (max-width: 940px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
