/* Primera lectura (último slide). Se carga última: usa los tokens de tema-blanco.css. */
.dm-lectura.dm-slide { padding: calc(var(--bar-h) + 8px) 0 28px; }
.dm-lectura .wrap { max-width: 1560px; padding: 0 clamp(24px, 4vw, 72px); }
.lx-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 18px; }
.lx-head h2 { flex-basis: 100%; font-size: clamp(30px, 3.1vw, 46px); line-height: 1.08; text-wrap: balance; }
#lx-ej-pill { background: var(--sol); color: var(--sol-tinta); border: 0; font-weight: 600; }
#lx-ej-pill[hidden] { display: none; }

/* ── Tiles ──────────────────────────────────────────────────────────────────── */
.lx-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.lx-tile { position: relative; min-width: 0; padding: 16px 20px 15px; border: 1px solid var(--border); border-radius: 20px; background: var(--panel); box-shadow: var(--sombra); }
.lx-k { font-size: 15px; color: var(--muted); }
.lx-v { margin-top: 2px; font-size: clamp(30px, 2.8vw, 42px); font-weight: 500; line-height: 1.12; letter-spacing: -0.035em; white-space: nowrap; color: var(--border-strong); transition: color .3s; }
.lx-s { margin-top: 3px; min-height: 1.25em; font-size: 14px; line-height: 1.25; color: var(--faint); text-wrap: pretty; }
.lleno .lx-v { color: var(--text); }
.lleno .lx-s { color: var(--muted); }
.lx-nivel { position: absolute; top: 13px; right: 14px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.lx-nivel[hidden] { display: none; }
.lx-nivel svg { font-size: 14px; }
.lx-nivel.alto { background: var(--durazno); color: var(--durazno-tinta); }
.lx-nivel.medio { background: var(--sol); color: var(--sol-tinta); }
.lx-nivel.bajo { background: var(--menta); color: var(--accent); }

/* ── Dos columnas: gráfico a la izquierda; soltar, lectura o mejoras a la derecha ─ */
.lx-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); gap: 14px; margin-top: 14px; }
.lx-card { min-width: 0; border: 1px solid var(--border); border-radius: 20px; background: var(--panel); box-shadow: var(--sombra); }
.lx-graf { position: relative; display: flex; flex-direction: column; padding: 16px 20px 14px; }
.lx-graf-t { font-size: 16px; font-weight: 500; }
.lx-graf-s { font-size: 14px; color: var(--muted); }
.lx-graf-svg { position: relative; flex: 1; min-height: 190px; margin-top: 10px; }
#lx-chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.lx-ghost { fill: var(--bg-raised); }
.lx-base { stroke: var(--border-strong); stroke-width: 1; }
.lx-rejilla { stroke: var(--border); stroke-width: 1; }
.lx-eje { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.lx-barra { fill: var(--s1); }
.lx-barra.parcial { fill: rgb(22 168 119 / .35); }
.lx-barra.crece { animation: lx-crece .7s var(--ease) calc(var(--i) * 28ms) backwards; }
@keyframes lx-crece { from { transform: scaleY(0); } }
.lx-hit { fill: transparent; outline: none; }
.lx-hit:hover, .lx-hit:focus-visible { fill: rgb(90 75 40 / .06); }
.lx-tip { position: absolute; top: -6px; translate: -50% 0; display: grid; padding: 6px 10px; border-radius: 10px; background: var(--text); color: #fff; font-size: 13px; white-space: nowrap; pointer-events: none; z-index: 2; }
.lx-tip[hidden] { display: none; }
.lx-tip span { opacity: .75; font-size: 12px; }
.lx-tip b { font-weight: 600; }
.lx-pie { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.lx-pie:has(span:empty:first-child) { display: none; }
.lx-cuerpo { display: flex; flex-direction: column; min-height: 390px; padding: 14px; }

/* ── Soltar ─────────────────────────────────────────────────────────────────── */
.lx-drop { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 28px; border: 2px dashed var(--border-strong); border-radius: 14px; background: var(--bg-soft); color: var(--text); font: inherit; cursor: pointer; transition: border-color .2s, background-color .2s, scale .2s var(--ease); }
.lx-drop:hover, .lx-drop:focus-visible { border-color: var(--good); background: var(--menta); outline: none; }
.arrastrando .lx-drop { border-color: var(--good); background: var(--menta); scale: 1.012; }
.lx-drop-ic { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; border-radius: 20px; background: var(--menta); color: var(--accent); font-size: 30px; transition: translate .25s var(--ease); }
.arrastrando .lx-drop-ic { translate: 0 6px; background: #fff; }
.lx-drop b { font-size: clamp(30px, 3vw, 44px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.lx-drop-sub { font-size: 17px; color: var(--muted); }
.lx-priv { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; font-size: 14px; color: var(--muted); text-align: center; }
.lx-priv svg { color: var(--accent); }
.lx-mas { margin-left: 6px; padding: 0; border: 0; background: none; font: inherit; font-weight: 500; color: var(--accent); text-decoration: underline; cursor: pointer; }
.lx-aviso { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--durazno); color: #8f3a1c; font-size: 15px; }
.lx-aviso b { font-weight: 600; }

/* ── Leyendo ────────────────────────────────────────────────────────────────── */
.lx-abriendo { flex: 1; display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 18px; color: var(--muted); }
.lx-spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--good); animation: lx-gira .8s linear infinite; }
@keyframes lx-gira { to { transform: rotate(360deg); } }
.lx-log { display: flex; flex-direction: column; flex: 1; padding: 6px 8px; }
.lx-log-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; }
.lx-log-top b { font-weight: 500; }
.lx-log-top span { color: var(--muted); font-variant-numeric: tabular-nums; }
.lx-prog { height: 6px; margin-top: 8px; border-radius: 999px; background: var(--bg-raised); overflow: hidden; }
.lx-prog i { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--good); transition: width 1s linear; }
.lx-pasos { display: grid; gap: 2px; margin-top: 10px; }
.lx-pasos li { display: grid; grid-template-columns: 20px minmax(0, auto) minmax(0, 1fr); align-items: center; gap: 8px; padding: 5px 0; font-size: 15.5px; animation: rv-up .35s var(--ease) backwards; }
.lx-marca { display: grid; place-items: center; color: var(--good); }
.lx-paso-t { color: var(--muted); }
.corriendo .lx-paso-t { color: var(--text); font-weight: 500; }
.lx-paso-r { justify-self: end; max-width: 100%; color: var(--text); font-weight: 500; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.corriendo .lx-paso-r { color: var(--faint); font-weight: 400; }

/* ── Mapeo de columnas ──────────────────────────────────────────────────────── */
.lx-mapeo { padding: 8px; font-size: 16px; color: var(--muted); }
.lx-mapeo b { color: var(--text); font-weight: 500; }
.lx-mapeo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.lx-mapeo label { display: grid; gap: 6px; font-size: 14px; min-width: 0; }
.lx-mapeo select { width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--panel); font: 15px var(--font); color: var(--text); }
.lx-mapeo-ctas { display: flex; gap: 10px; margin-top: 16px; }

/* ── Las 3 mejoras ──────────────────────────────────────────────────────────── */
.lx-mejoras { flex: 1; display: grid; gap: 8px; }
.lx-mejora { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 11px 14px; border-radius: 14px; background: var(--bg-soft); animation: rv-up .55s var(--ease) calc(var(--i) * 260ms + 100ms) backwards; }
.lx-num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; }
.lx-mejora-txt { min-width: 0; }
.lx-mejora-txt > b { display: block; font-size: 19px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.2; }
.lx-bajada { margin-top: 1px; font-size: 14px; color: var(--muted); }
.lx-ej { margin-top: 5px; display: grid; gap: 1px; }
.lx-ej li { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lx-ej b { color: var(--text); font-weight: 500; }
.lx-ej li:nth-child(3) { display: none; }
@media (min-height: 1000px) { .lx-ej li:nth-child(3) { display: list-item; } }
.lx-accion { display: flex; align-items: baseline; gap: 6px; margin-top: 5px; font-size: 14px; font-weight: 500; color: var(--accent); }
.lx-accion svg { translate: 0 2px; flex-shrink: 0; }
.lx-mejora-v { text-align: right; white-space: nowrap; }
.lx-mejora-v b { display: block; font-size: clamp(24px, 2.2vw, 32px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.lx-mejora-v span { font-size: 13px; color: var(--muted); }

/* Sin mejoras: lo dice, no deja el panel en blanco */
.lx-sin { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 24px 28px; }
.lx-sin b { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; }
.lx-sin p { font-size: 16px; color: var(--muted); max-width: 56ch; }

/* ── Cierre ─────────────────────────────────────────────────────────────────── */
.lx-cierre { margin-top: 12px; animation: rv-up .6s var(--ease) .9s backwards; }
.lx-cierre[hidden] { display: none; }
.lx-cierre-fila { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 13px 20px; border-radius: 20px; background: var(--menta); }
.lx-cierre-fila p { font-size: 16.5px; line-height: 1.3; color: var(--text); text-wrap: pretty; }
.lx-cierre-fila b { font-weight: 600; }
.lx-cierre-fila .btn { flex-shrink: 0; white-space: nowrap; }
.lx-nota { display: flex; justify-content: space-between; gap: 16px; margin-top: 7px; font-size: 12.5px; color: var(--muted); }
.lx-otro { flex-shrink: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* Notebook de 900 px de alto: el resultado entra justo */
@media (max-height: 960px) {
  .lx-head { margin-bottom: 12px; }
  .lx-head h2 { font-size: clamp(28px, 2.8vw, 40px); }
  .lx-tile { padding: 12px 18px 11px; }
  .lx-mejoras { gap: 6px; }
  .lx-mejora { padding: 8px 14px; }
}

/* Pantallas bajas: se resigna lo accesorio, nunca los números */
@media (max-height: 860px) {
  .lx-head { margin-bottom: 10px; }
  .lx-head h2 { font-size: clamp(26px, 2.6vw, 36px); }
  .lx-tile { padding: 11px 16px 10px; }
  .lx-v { font-size: 30px; }
  .lx-s { min-height: 0; font-size: 13px; }
  .lx-grid { margin-top: 10px; }
  .lx-cuerpo { min-height: 320px; padding: 10px; }
  .lx-bajada { display: none; }
  .lx-mejora { padding: 8px 12px; }
  .lx-mejora-txt > b { font-size: 17px; }
  .lx-pasos li { padding: 2px 0; font-size: 14.5px; }
  .lx-cierre-fila { padding: 9px 16px; }
  .lx-cierre-fila p { font-size: 15px; }
}
@media (max-height: 800px) {
  .dm-lectura.dm-slide { padding-bottom: 14px; }
  .lx-pie { display: none; }
  .lx-accion { margin-top: 2px; }
  .lx-ej li:nth-child(2) { display: none; }
  .lx-cuerpo { min-height: 280px; }
  .lx-cierre { margin-top: 8px; }
  .lx-nota { margin-top: 4px; }
}
@media (max-width: 1100px) {
  .lx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lx-grid { grid-template-columns: minmax(0, 1fr); }
  .lx-graf-svg { min-height: 170px; }
  .lx-cierre-fila { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .lx-mejora, .lx-cierre, .lx-pasos li { animation: none; }
  .lx-spin { animation-duration: 3s; }
}

/* Panel del presentador */
.dm-panel-lx { display: flex; flex-wrap: wrap; gap: 8px; }
.dm-panel-lx .ui-btn { cursor: pointer; font: 500 13px var(--font); color: var(--text); }
