/* V78 — cartões de Fantasia e Casa mais compactos.
   Ajuste exclusivamente visual: preserva lógica, IDs e limites de fotos. */

/* Fantasias */
.child-card-v07{
  grid-template-columns:64px minmax(0,1fr) !important;
  grid-template-rows:auto auto !important;
  gap:8px 10px !important;
  align-items:start !important;
  padding:10px !important;
  border-radius:14px !important;
}
.child-card-v07 .child-avatar{
  width:64px !important;
  height:64px !important;
  border-radius:13px !important;
}
.child-card-v07 .child-main{
  min-width:0 !important;
}
.child-card-v07 .child-main h4{
  margin:0 0 2px !important;
}
.child-card-v07 .child-main p{
  line-height:1.25 !important;
}
.child-card-v07 .photo-counter{
  margin:3px 0 5px !important;
}
.child-card-v07 .child-photo-strip{
  gap:4px !important;
  flex-wrap:nowrap !important;
  overflow-x:auto !important;
  scrollbar-width:none !important;
}
.child-card-v07 .child-photo-strip::-webkit-scrollbar{
  display:none !important;
}
.child-card-v07 .mini-photo{
  flex:0 0 62px !important;
  width:62px !important;
  height:62px !important;
  border-radius:9px !important;
}

/* Duas linhas de ações:
   linha 1 = aparelho / editar / excluir
   linha 2 = escolher / tirar */
.child-card-v07 .child-actions{
  grid-column:1 / -1 !important;
  display:grid !important;
  grid-template-columns:1.35fr .82fr .82fr !important;
  gap:6px !important;
  width:100% !important;
  margin-top:1px !important;
  justify-content:stretch !important;
  align-items:stretch !important;
}
.child-card-v07 .child-actions > button{
  min-width:0 !important;
  width:100% !important;
  min-height:38px !important;
  height:38px !important;
  padding:0 7px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  border-radius:10px !important;
  font-size:.68rem !important;
  line-height:1 !important;
  white-space:nowrap !important;
}
.child-card-v07 .child-actions > button[data-track-child]{
  order:1 !important;
}
.child-card-v07 .child-actions > button[data-edit-child]{
  order:2 !important;
}
.child-card-v07 .child-actions > button[data-del-child]{
  order:3 !important;
  color:#ffd8d8 !important;
  border-color:rgba(255,92,92,.28) !important;
  background:rgba(120,34,34,.16) !important;
}
.child-card-v07 .child-photo-source-actions{
  order:4 !important;
  grid-column:1 / -1 !important;
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:6px !important;
  width:100% !important;
}
.child-card-v07 .child-upload-btn{
  width:100% !important;
  min-width:0 !important;
  min-height:38px !important;
  height:38px !important;
  padding:0 8px !important;
  border-radius:10px !important;
  font-size:.68rem !important;
  line-height:1 !important;
  white-space:nowrap !important;
  box-sizing:border-box !important;
}

/* Casa: controles sempre compactos e pareados */
#houseParticipationFields > .grid2{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:6px !important;
}
#setHouseGpsBtn,
#pickHouseMapBtn{
  width:100% !important;
  min-width:0 !important;
  min-height:40px !important;
  height:40px !important;
  padding:0 7px !important;
  font-size:.69rem !important;
  border-radius:10px !important;
  white-space:nowrap !important;
}
#houseParticipationFields .photo-source-actions{
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  gap:6px !important;
  margin-top:6px !important;
}
#houseParticipationFields .photo-source-btn{
  min-width:0 !important;
  min-height:40px !important;
  height:40px !important;
  padding:0 7px !important;
  font-size:.69rem !important;
  border-radius:10px !important;
  white-space:nowrap !important;
}
#houseParticipationFields .candy-picker{
  gap:6px !important;
}
#houseParticipationFields .candy-picker button{
  min-height:40px !important;
  padding:7px 8px !important;
  font-size:.71rem !important;
  border-radius:10px !important;
}

/* Galeria da casa também ocupa menos altura visual */
#housePhotoGallery{
  gap:6px !important;
  margin-top:8px !important;
}
#housePhotoCount{
  margin:6px 0 10px !important;
}

@media(max-width:390px){
  .child-card-v07{
    grid-template-columns:58px minmax(0,1fr) !important;
    gap:7px 9px !important;
    padding:9px !important;
  }
  .child-card-v07 .child-avatar{
    width:58px !important;
    height:58px !important;
  }
  .child-card-v07 .mini-photo{
    flex-basis:58px !important;
    width:58px !important;
    height:58px !important;
  }
  .child-card-v07 .child-actions{
    grid-template-columns:1.3fr .8fr .8fr !important;
    gap:5px !important;
  }
  .child-card-v07 .child-actions > button,
  .child-card-v07 .child-upload-btn{
    min-height:36px !important;
    height:36px !important;
    padding:0 5px !important;
    font-size:.64rem !important;
  }
  #setHouseGpsBtn,
  #pickHouseMapBtn,
  #houseParticipationFields .photo-source-btn{
    min-height:38px !important;
    height:38px !important;
    font-size:.65rem !important;
  }
}
