:root{
  --bg:#0D0F10; --card:#1A1D20; --line:#2B2F33; --ink:#F1F3F5; --muted:#8C9196;
  --accent:#BFBFBF; --ok:#D0D0D0; --chip:#22262B;
}
*{box-sizing:border-box} html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.45 'Inter',system-ui}
.app{max-width:520px;margin:0 auto;min-height:100%;display:flex;flex-direction:column}
header{position:sticky;top:0;z-index:30;background:rgba(13,15,16,.9);border-bottom:1px solid var(--line);backdrop-filter:blur(10px)}
.h{display:flex;align-items:center;justify-content:space-between;padding:14px 16px}
main{flex:1;padding:16px}
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:14px}
.row{display:flex;gap:10px;flex-wrap:wrap}
.kpi{flex:1 1 0;background:#15181B;border:1px solid var(--line);border-radius:12px;padding:12px}
.kpi h4{margin:0 0 6px;font-size:12px;color:var(--muted)} .kpi strong{font-size:18px}
.btn{background:var(--accent);color:#0D0F10;border:none;padding:10px 14px;border-radius:12px;font-weight:800}
.btn.ghost{background:#15181B;color:var(--ink);border:1px solid var(--line)}
.nav{position:sticky;bottom:0;background:#0E1113;border-top:1px solid var(--line)}
.nav-inner{max-width:520px;margin:0 auto;display:flex;gap:8px;padding:8px}
.navbtn{flex:1;padding:12px;background:#22262B;border:1px solid var(--line);border-radius:12px;color:#F1F3F5;font-weight:700}
.navbtn.active{background:var(--accent);color:#0D0F10}
.select{appearance:none;background:#22262B;border:1px solid var(--line);color:#F1F3F5;padding:10px 12px;border-radius:12px;font-weight:600}
.title{font-size:18px;font-weight:800;margin:8px 0 4px} .desc{margin:0 0 12px;color:var(--muted)}
.progress{display:flex;align-items:center;gap:10px;margin:10px 0}
.bar{flex:1;height:10px;background:#0f1113;border:1px solid var(--line);border-radius:999px;overflow:hidden}
.bar>i{display:block;height:100%;width:0%;background:var(--accent);transition:width .25s ease}
.pct{min-width:44px;font-weight:800}
.ex{display:flex;gap:10px;background:#15181B;border:1px solid var(--line);border-radius:12px;padding:10px;margin-bottom:10px}
.thumb{width:100px;height:70px;border-radius:10px;background:#0b0d10 center/cover no-repeat;position:relative;flex:0 0 100px}
.play{position:absolute;right:6px;bottom:6px;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:rgba(0,0,0,.5);border:1px solid rgba(255,255,255,.2)}
.ex-name{font-weight:700} .meta{font-size:13px;color:var(--muted)} .note{font-size:12px;color:#c3c7cc;margin-top:2px}
.chk{align-self:center;width:24px;height:24px;border-radius:8px;border:1.5px solid var(--line);display:grid;place-items:center;cursor:pointer}
.chk.on{background:var(--ok);color:#0D0F10;border-color:var(--ok)}
.modal{position:fixed;inset:0;display:none;background:rgba(0,0,0,.5)} .modal.on{display:block}
.sheet{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(520px,94vw);background:var(--card);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.media{height:220px;background:#0b0d10 center/cover no-repeat}
.sheet-body{padding:14px}
.close{position:absolute;right:10px;top:10px;width:34px;height:34px;border-radius:10px;display:grid;place-items:center;background:#0f1114;border:1px solid var(--line);color:#F1F3F5}
/* ✅ Ajuste visual de miniaturas de video */
.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background-color: #000;
}

.thumb-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  background-color: #000;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  pointer-events: none; /* evita clics sobre el video */
}

/* Oculta controles en Safari/iPhone */
.thumb-video::-webkit-media-controls,
.thumb-video::-webkit-media-controls-enclosure {
  display: none !important;
  opacity: 0 !important;
}

/* Asegura el botón “play” flotante */
.thumb .play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.6rem;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  padding: 0.2rem 0.5rem;
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background-color: #000;
}

/* =========================================================
   🧩 Estructura fija de ejercicios con alineación de check
   ========================================================= */
.ex {
  display: grid;
  grid-template-columns: 90px 1fr 40px; /* Miniatura | Info | Check */
  align-items: center;
  gap: 12px;
  background: #15181B;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  transition: background 0.2s ease;
}
.ex:hover { background: #1a1d21; }

.thumb {
  width: 90px;
  height: 70px;
  border-radius: 10px;
  overflow: hidden;
  background: #0b0d10 center/cover no-repeat;
  position: relative;
  flex-shrink: 0;
}

.thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background-color: #000;
}

.ex-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
}

.ex-name {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  line-height: 1.2;
}

.meta {
  font-size: 13px;
  color: var(--muted);
}

.note {
  font-size: 12px;
  color: #c3c7cc;
  margin-top: 2px;
}

/* ✅ Checkmark fijo y alineado */
.chk {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  margin-right: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  color: transparent;
  transition: all 0.2s ease;
}

.chk.on {
  background: var(--ok);
  color: #0D0F10;
  border-color: var(--ok);
}

/* 🎬 Botón de play centrado en la miniatura */
.play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  color: rgba(255,255,255,0.9);
  background: rgba(0,0,0,0.45);
  border-radius: 50%;
  padding: 0.3rem 0.55rem;
  border: 1px solid rgba(255,255,255,0.2);
  transition: background 0.2s ease;
}
.play:hover { background: rgba(255,255,255,0.15); }
